Skip to content

fix: calculate rel_increase_comp independently of plotting - #137

Open
cbueth wants to merge 1 commit into
mainfrom
feat/calculate-rel-increase-comp-independently
Open

cbueth wants to merge 1 commit into
mainfrom
feat/calculate-rel-increase-comp-independently

Conversation

@cbueth

@cbueth cbueth commented Sep 16, 2026

Copy link
Copy Markdown
Member

Description

Moves the component-wise travel increase calculation out of plot_component_wise_travel_increase into a new write_component_wise_travel_increase in measures.py, called from Metric.calculate_all. rel_increase_comp is available independent of the plotting option.

fixes the LTN-level rel_increase being written to throwaway dicts from get_partition_nodes() instead of the actual components. Registers rel_increase_comp in the graphml dtype map.

Related Issue

Fixes #136

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📝 Documentation update
  • 🧹 Code refactor (no functional changes)
  • ✅ Test update

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual testing

Test configuration:

  • OS: Mac OS

Screenshots (if applicable)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix/feature works
  • New and existing tests pass locally

Additional Notes

Move the component-wise travel increase calculation out of plot_component_wise_travel_increase and call it unconditionally in Metric.calculate_all, so rel_increase_comp is available when make_plots=False. Also write the LTN-level rel_increase to the actual components via get_ltns() instead of the throwaway dicts from get_partition_nodes().
@cbueth cbueth self-assigned this Sep 16, 2026
@cbueth cbueth added the enhancement New feature or request label Sep 16, 2026
@cbueth
cbueth requested a review from mszell September 16, 2026 10:51
@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
superblockify/metrics/measures.py 83.33% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@mszell

mszell commented Sep 16, 2026

Copy link
Copy Markdown
Member

Nice, thank you!
I am traveling / at conferences for a week now and can't look into it line by line, but it looks like you copied over the code and adapted it so it's always executed, so that would be fine!

@cbueth

cbueth commented Sep 17, 2026

Copy link
Copy Markdown
Member Author

Yes, this is the case. Have good travels

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Calculate rel_increase_comp independently of plotting

2 participants