-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(disordered_tracing): Work with skan-0.12.2 #1052
Conversation
Closes #986 With the release of `skan-0.12.2` we can remove the code which converts `-` in the variable names of Pandas DataFrames to instead use `_` which allows the use of "dot-notation" when referring to the variables of data frames. We therefore unpin the `skan` version in `pyproject.toml`, explicitly state the `separator="_"` argument to `skan.summarize()` and adapt the hard-coded variable names appropriately. As noted in the [release notes](https://github.com/jni/skan/releases/tag/v0.12.2) the default will be `_` from `v0.13.0` and the flag allows backwards compatibility but since we have gone with the use of `_` in variable names it will do no harm leaving these in place (although they could be removed when `skan-v0.13.0` is released).
In addressing #986 I tested in a fresh virtual environment. This pulled in [matplotlib-3.10.0](https://github.com/matplotlib/matplotlib/releases/tag/v3.10.0) which was released 2024-12-14 (two days ago!). Our dependency on [topoly](topoly.cent.uw.edu.pl/documentation.html) doesn't work with this new version because of the removal of `inset_location.InsetPosition` in favour of `inset_axes`. This has been reported to the Topoly developers, see [ImportError: cannot import name 'InsetPosition' from 'mpl_toolkits.axes_grid1.inset_locator' · Issue #5 · ilbsm/topoly_tutorial](ilbsm/topoly_tutorial#5) and hopefully won't take long to resolve. For now though we pin our dependency `matplotlib~=3.9.4` and all tests pass.
Hey Neil, thanks for following up on this issue with the skan and topoly people! I've not had time to test but does this then change any of the disordered_stats column names? |
Too Long; Did not ReadNo, the PR doesn't include any changes to test files where changes in column names would have an impact, ergo nothing in the scripts needs changing because none of the column names have actually changed. Long; Did ReadSkan originally used This means that you can't use the notation In discussion with the skan developer it was agreed to switch this out and I made a PR to skan to use When This PR removes the line that made that change to the returned data frame (see line itself and associated comment) and also explicitly calls Thus the output doesn't actually change at all, which is why all the tests pass without any need to modify any of the test files. It also threw up the mentioned problem with Matplotlib 3.10.0 causing problems with Topoly which was pure chance but I've addressed it as otherwise the tests in Continuous Integration would pull in the new version and throw errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ace! In that case this looks clean and good to go, thanks Neil!
Closes #986
With the release of
skan-0.12.2
we can remove the code which converts-
in the variable names of Pandas DataFrames to instead use_
which allows the use of "dot-notation" when referring to the variables of data frames.We therefore unpin the
skan
version inpyproject.toml
, explicitly state theseparator="_"
argument toskan.summarize()
and adapt the hard-coded variable names appropriately. As noted in the release notes the default will be_
fromv0.13.0
and the flag allows backwards compatibility but since we have gone with the use of_
in variable names it will do no harm leaving these in place (although they could be removed whenskan-v0.13.0
is released).In addressing #986 I tested in a fresh virtual environment. This pulled in matplotlib-3.10.0 which was released 2024-12-14 (two days ago!). Our dependency on topoly doesn't work with this new version because of the removal of
inset_location.InsetPosition
in favour ofinset_axes
.This has been reported to the Topoly developers, see ImportError: cannot import name 'InsetPosition' from
'mpl_toolkits.axes_grid1.inset_locator' · Issue #5 · ilbsm/topoly_tutorial and hopefully won't take long to resolve. For now though we pin our dependency
matplotlib~=3.9.4
and all tests pass.Before submitting a Pull Request please check the following.