Add experimental floweaver "compiler"#139
Merged
ricklupton merged 11 commits intomasterfrom Feb 8, 2026
Merged
Conversation
Older sphinx wasn't compatible with newer Python versions. Also moved the source code into the src/ subdirectory for better package layout.
I'm not sure why this wasn't causing a problem before, but it seems to be needed; original Elsewhere bundles are added like this when building the original view graph. Motivated by adding compiler implementation
This introduces a compiler that takes a SankeyDefinition and "compiles" it to a "spec" which includes all the information needed to actually create a Sankey diagram from a particular dataset later. Testing compares results from the new version with the original code for a variety of input definitions and datasets. The implementation uses a routing tree-based approach which should be O(rows × tree_depth), rather the (perhaps more obvious) approach based on filtering dataset rows, like the current implementation, which is less efficient for large diagrams/datasets -- O(rows × edges).
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #139 +/- ##
===========================================
+ Coverage 0.00% 82.30% +82.30%
===========================================
Files 18 26 +8
Lines 1035 2034 +999
Branches 0 385 +385
===========================================
+ Hits 0 1674 +1674
+ Misses 1035 277 -758
- Partials 0 83 +83 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
01cd4b4 to
efc1d0c
Compare
efc1d0c to
69925fd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This introduces a compiler that takes a SankeyDefinition and "compiles" it to a "spec" which includes all the information needed to actually create a Sankey diagram from a particular dataset later.
Testing compares results from the new version with the original code for a variety of input definitions and datasets.
As part of this, also made a lot of updates to typing, linting, formatting of files to bring the code up to date and easier to work with. This includes switching from setup.py to pyproject.toml and updating minimum Python version.
One change to existing code logic about how Elsewhere stubs are handled when added implicitly; I think this was a bug in the previous version.