bugfix/incorrect-ome-tiff-dim-order#24
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24 +/- ##
==========================================
+ Coverage 86.96% 87.23% +0.26%
==========================================
Files 27 27
Lines 1036 1042 +6
==========================================
+ Hits 901 909 +8
+ Misses 135 133 -2
Continue to review full report at Codecov.
|
AetherUnbound
left a comment
There was a problem hiding this comment.
A couple minor logic things, but looks good! 👍
| """ | ||
|
|
||
| # Hold onto known dims until data is requested | ||
| if known_dims: |
There was a problem hiding this comment.
Since known_dims is None by default anyway, can't this just be self._known_dims?
| if self._known_dims: | ||
| pass_dims = self._known_dims | ||
| else: | ||
| pass_dims = self.reader.dims |
There was a problem hiding this comment.
Optionally: (this could also be done below on L139)
| if self._known_dims: | |
| pass_dims = self._known_dims | |
| else: | |
| pass_dims = self.reader.dims | |
| pass_dims = self._known_dims or self.reader.dims |
There was a problem hiding this comment.
It's enough to make me think it should be named override_dims instead of known_dims :)
| dimension_order = dimension_order.replace("Z", "") | ||
| if self.size_z() < 2: | ||
| dimension_order = dimension_order.replace("Z", "") | ||
| if self.size_c() < 2: |
| (np.zeros((10, 20)), "XY", (1, 1, 1, 1, 20, 10)), | ||
| pytest.param(np.zeros((2, 2, 2)), "ABI", None, marks=pytest.mark.raises(exception=TypeError)) | ||
| ]) | ||
| def test_known_dims(data, dims, expected_shape): |
There was a problem hiding this comment.
Freaking love pytest.mark.parametrize
| if self.size_c() < 2: | ||
| dimension_order = dimension_order.replace("Z", "") | ||
| if self.size_z() < 2: | ||
| dimension_order = dimension_order.replace("Z", "") |
4c09fc7 to
2db3c09
Compare
Pull request recommendations:
known_dimskwarg to theAICSImageobject to allow explicit override of dimension ordering. The data is still reshaped to the standardSTCZYX.Thanks for contributing!