_extract_xyz Tests and clean up#42
Merged
Merged
Conversation
qiushitian
approved these changes
Jul 11, 2026
|
|
||
| if isinstance(obj, np.ndarray) and obj.shape == (): | ||
| return True | ||
|
|
Collaborator
There was a problem hiding this comment.
Pep8 says no new line here?
shadowbehindthebread
approved these changes
Jul 11, 2026
shadowbehindthebread
left a comment
Collaborator
There was a problem hiding this comment.
sublime !! me n chis n polvora have much to learn 😊
| y = [4,5,6] | ||
|
|
||
| X, Y = _extract_xy(x, y) | ||
| assert np.array_equal(X, x) and Y == y |
Collaborator
There was a problem hiding this comment.
(note to future audrey and future chris: check why this is legal tho / why this is different than test single)
| assert X == x and np.array_equal(Y, y) | ||
|
|
||
| def test_scalars(self): | ||
| X, Y = _extract_xy(1) |
Collaborator
There was a problem hiding this comment.
(note to future audrey and future chris: does len(1) throw an error? we assume it's good bc it passed ur tests but we will inspect more on the comp)
Collaborator
There was a problem hiding this comment.
very comprehensive looking tests !! me n future chris need to inspect some things later but this looks good 👍
| def test_supported_norms(self): | ||
| assert isinstance(get_imshow_norm('asinh', 0.1, 9), ImageNormalize) | ||
| assert isinstance(get_imshow_norm('log', 0.1, 9), LogNorm) | ||
| assert isinstance(get_imshow_norm( 'power', 0.1, 9), PowerNorm) |
Collaborator
There was a problem hiding this comment.
why is there a space before 'power' ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #30
_extract_xytests totest_numerical_utilsimage_utilsrelated tests totest_image_utils*Created tests for
_extract_xyz_is_scalarso it returnsFalseforstr