Skip to content

_extract_xyz Tests and clean up#42

Merged
elkogerville merged 7 commits into
mainfrom
tests
Jul 12, 2026
Merged

_extract_xyz Tests and clean up#42
elkogerville merged 7 commits into
mainfrom
tests

Conversation

@elkogerville

@elkogerville elkogerville commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Closes #30

  • Move _extract_xy tests to test_numerical_utils
  • Move image_utils related tests to test_image_utils

*Created tests for _extract_xyz

  • fixed _is_scalar so it returns False for str


if isinstance(obj, np.ndarray) and obj.shape == ():
return True

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pep8 says no new line here?

@shadowbehindthebread shadowbehindthebread left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(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)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(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)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very comprehensive looking tests !! me n future chris need to inspect some things later but this looks good 👍

Comment thread tests/test_plotting/test_image_utils.py Outdated
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)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is there a space before 'power' ?

@elkogerville elkogerville merged commit 6628ccb into main Jul 12, 2026
15 checks passed
@elkogerville elkogerville deleted the tests branch July 12, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Tests for _extract_xyz

3 participants