Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the list of support numpy dtypes with DTYPES_NUMERIC in tests #3565

Merged
merged 3 commits into from
Nov 4, 2024

Conversation

seisman
Copy link
Member

@seisman seisman commented Oct 31, 2024

The long list of supported numpy types are used in many places. Currently, we usually use

"int8 int16 int32 int64 uint8 uint16 uint32 uint64 float32 float64".split()

it can be replaced by:

[dtype for dtype in DTYPES_NUMERIC if dtype != np.timedelta64]

This is also a small step towards #3547.

@seisman seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog needs review This PR has higher priority and needs review. labels Oct 31, 2024
@seisman seisman added this to the 0.14.0 milestone Oct 31, 2024
@seisman seisman marked this pull request as draft October 31, 2024 03:06
@seisman seisman removed the needs review This PR has higher priority and needs review. label Oct 31, 2024
return "int8 int16 int32 int64 uint8 uint16 uint32 uint64 float32 float64".split()


@pytest.fixture(scope="module", name="dtypes_pandas")
Copy link
Member Author

Choose a reason for hiding this comment

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

This fixture is no longer used in this file.

@seisman seisman marked this pull request as ready for review October 31, 2024 04:06
@seisman seisman added the needs review This PR has higher priority and needs review. label Oct 31, 2024
@seisman seisman changed the title Simplify the list of support numpy dtypes with DTYPES_NUMERIC Replace the list of support numpy dtypes with DTYPES_NUMERIC Oct 31, 2024
@seisman seisman changed the title Replace the list of support numpy dtypes with DTYPES_NUMERIC Replace the list of support numpy dtypes with DTYPES_NUMERIC in tests Oct 31, 2024
@@ -43,7 +45,7 @@ def test_grdimage_image_dataarray(xr_image):

@pytest.mark.parametrize(
"dtype",
["int8", "uint16", "int16", "uint32", "int32", "float32", "float64"],
[dtype for dtype in DTYPES_NUMERIC if dtype not in {np.uint8, np.timedelta64}],
Copy link
Member Author

Choose a reason for hiding this comment

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

Currently, only uint8 images are supported.

@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Nov 3, 2024
@seisman seisman merged commit a0e4226 into main Nov 4, 2024
20 checks passed
@seisman seisman deleted the tests/dtypes branch November 4, 2024 00:06
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant