Skip to content

Clustering Coefficient 1.0.1: fix runs after a cancellation and on filtered views - #370

Merged
mbastian merged 1 commit into
master-forgefrom
fix/clustering-coefficient-cancel-and-views
Nov 8, 2026
Merged

mbastian merged 1 commit into
master-forgefrom
fix/clustering-coefficient-cancel-and-views

Conversation

@mbastian

@mbastian mbastian commented Nov 8, 2026

Copy link
Copy Markdown
Member

Found by the SPI contract tests of gephi-plugins-tests (StatisticsContractTest), run against Gephi 0.11.4.

  • Runs after a cancellation: ClusteringCoefficientStatistic.cancel is static and was never reset. After one cancelled run, every later run in the same Gephi session skipped the calculation, then threw NullPointerException reading the missing Clustering Coefficient values. execute() now clears the flag, and a node without a value counts as 0 in the report.
  • Filtered views: ClusteringCoefficientAlgorithm iterated the nodes of the whole graph but read neighbors in the visible view, which throws Node doesn't belong to this view for the nodes a filter left out. It now iterates the view's own nodes.
  • Version 1.0.0 → 1.0.1.

Verified: the contract tests (gephi-plugins-tests 1.1.1) pass on this module apart from two findings that become warnings in the next gephi-plugins-tests release: an existing column of another type, and a report that changes when saved and reloaded. Short-lived branch off master-forge, 3 files.

The cancel flag is static and was never cleared, so once a run had been cancelled no later run calculated anything and the next one failed with a NullPointerException reading the missing values. Clear it when a run starts, and treat a node without a value as 0. The algorithm iterated the nodes of the whole graph but read neighbors in the visible view, which throws for the nodes a filter left out, iterate the view's nodes. Version 1.0.1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mbastian
mbastian merged commit cd0d28e into master-forge Nov 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant