Closed ns-rse closed 8 months ago
Moving columns to a config file has always felt like the ideal solution! Happy to give this a look soon — is there a reason tests are failing still?
Yes, I figured if I was going to change lots of things in lots of places it would be sensible to abstract it out and parameterise the values so its easier to change and extend in the future.
Tests passed locally (for once I checked before pushing and making the PR).
I'll have a look tomorrow.
Haha, just beat me to it! https://peps.python.org/pep-0604/ (minimum version of 3.10)
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 72.37%. Comparing base (
329b88d
) to head (4d49244
). Report is 2 commits behind head on master.:exclamation: Current head 4d49244 differs from pull request most recent head 2cf0534. Consider uploading reports for the commit 2cf0534 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@ns-rse Unfortunately looks like some Windows demons to slay — I've tried a couple of times to re-run it, but with no luck. I'm also stuck without a Windows machine to replicate it outside of the CI!
After that's ironed out, I'll review!
The error stems from pgfinder.gui.internal.uploaded_file()
and the function with tempfile.TemporaryDirectory() as tempdir:
these haven't been touched in the current Pull Request and work fine on other OS's so my crude guess at the moment is that it is something outside of this code base.
I don't see any way the changes this PR introduces could cause these errors, the with ... :
statement is meant to implicitly close files when it is done using them, perhaps its an artifact of using tempdir
"with"in the subsequent call to with open(file) as f:
would be one possible cause at a guess but since it doesn't happen elsewhere its somewhat confusing.
@ns-rse Not sure how you'd like to carry on from here — I'd agree it doesn't seem to be the fault of this diff. Would you want to drop the 3.11 testing for Windows from the CI in the meantime?
@TheLostLambda Tricky, Python and OS versions are defined via matrixes, so changing that makes it fiddly. We could over-ride the merging rules of requiring all tests to pass and write it up as an issue to be addressed in due course perhaps.
@ns-rse I'm happy enough with that! I'll review this and we can get it merged then!
Closes #267
Parametrises the column headers for input files (different versions of
ftrs
andmaxquant
, theoretical masses) and the columns PGFinder renames these to and subsequently derived columns based on these.These values were hard-coded at various places through out the code, this makes updating them awkward and fickle. Instead the values are defined in the file
pgfinder/config/columns.yaml
and this is loaded to a Python dictionary. The reference to these values are then used at various points rather than hard coded values themselves.Required tweaks to...
pgfinder/pgio.py
pgfinder/validation.py
pgfinder/matching.py
...as well as some of the test files which were used for comparison (including the regression tests) where the header columns have changed.
This should in theory make it somewhat easier to...
ftrs
version changes.Other changes
str | Path
rather than the olderUnion[str, Path]
. This can be supported under Python 3.8 withfrom __future__ import annotations
but Python 3.8 is due to reach End of Life in 2024-10-31.