Simplify checks for 1D/2D spectra and traces#4176
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4176 +/- ##
==========================================
- Coverage 84.76% 84.74% -0.03%
==========================================
Files 205 205
Lines 30552 30554 +2
==========================================
- Hits 25897 25892 -5
- Misses 4655 4662 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| data_type = None | ||
|
|
There was a problem hiding this comment.
This is, on first glance, confusing... any objection to moving the data_type instantiations into __init__ via self.data_type = ... for all of these importers?
There was a problem hiding this comment.
You know, it made more sense when I was going to check data_type for all of the validity checks instead of sticking with looking at _importer in most cases. I think I can simplify this for now since the only times I'm looking at _data_type are in the override cases, and not set it on the importer class at all. Unless it's something we do want to start adding to meta for every importer.
Now checks for the importer in these cases like a lot of the other is_valid checks, and additionally adds a
_data_typefield inmetato distinguish cases where a collapsed 1D spectrum is being loaded by the 2D or 3D spectrum importer. This is purely internal so I don't think it needs a changelog, and it should be covered by existing tests.