Conversation
…hub.com/AFM-SPM/AFMReader into maxgamill-sheffield/general-file-loader
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #140 +/- ##
==========================================
+ Coverage 74.62% 79.44% +4.81%
==========================================
Files 8 11 +3
Lines 607 832 +225
==========================================
+ Hits 453 661 +208
- Misses 154 171 +17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
SylviaWhittle
left a comment
There was a problem hiding this comment.
this is great, thank you. a general loader also makes it easier for quickly loading images in notebooks when experimenting, so I'll get use out of this personally.
The code looks good, given it a bit of a rushed review as you'll want this wrapped up before next week I assume.
It might be nice to document this in the usage docs, however, that can be pushed to an issue instead of this PR, IMO, especially as this is just for Napari for now and may change.
my comments here are pedantic and not very useful. completely optional
Co-authored-by: Sylvia Whittle <86117496+SylviaWhittle@users.noreply.github.com>
Co-authored-by: Sylvia Whittle <86117496+SylviaWhittle@users.noreply.github.com>
Co-authored-by: Sylvia Whittle <86117496+SylviaWhittle@users.noreply.github.com>
|
Thank you for the lightning quick review @SylviaWhittle and catching the lack of return typehints (although it seems I was too quick in my haste to accept them! (Moving this so its easier to see)
Yep totally agree! I understand that we'd want software to fail early when it does and this really doesn't help that. The only other thing I can think of atm is to move this into a "napari-specific general loader" and have a "general general loader" of a similar structure but with less janky code, that perhaps can also return the metadata as this might be useful for other applications. |
|
Yeah maybe a napari specific loader later on, but for now this is great |
|
Ah, needs |
There was a problem hiding this comment.
The general_ part is perhaps redundant, loader.py would suffice and be descriptive enough.
This PR adds a general file loader into
TopoStatsAFMReader which handles any filepath and uses the file extention to ship it to the correct reader.This does include a few funky additions changes:
(image, px2nm).(ValueError(<message>), None)..topostatsfiles, it uses the channel input to identify any image keys ("image" and "image_original" from the file). These are also returned for the error message.