-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
adjust repr tests to account for different platforms (#9127) #9128
Conversation
Adjust the expectations in repr tests to account for different object sizes and numpy type representations across platforms, particularly fixing the tests on 32-bit platforms. Firstly, this involves getting the object type size from NumPy and using it to adjust the expectations in DataArray and Dataset tests. The tests were already using int64 type consistently, so only the sizes used for Python objects needed to be adjusted. Secondly, this involves fixing `test_array_repr_dtypes_unix`. The test specifically focuses on testing a 32-bit, 64-bit and "native" data type, which affect both size and actual representation (NumPy skips the dtype attribute for the native data type). Get the expected size from NumPy for the native int type, and reuse `repr()` from NumPy for all array types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, thanks @mgorny
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Somewhat related is the script that creates the docstring examples which is also always giving the wrong numbers if run on Windows, this was annoying me already quite a few times... Would be a nice follow-up PR!
Thanks! |
* main: Split out distributed writes in zarr docs (pydata#9132) Update zendoo badge link (pydata#9133) Support duplicate dimensions in `.chunk` (pydata#9099) Bump the actions group with 2 updates (pydata#9130) adjust repr tests to account for different platforms (pydata#9127) (pydata#9128)
* main: (48 commits) Add test for #9155 (#9161) Remove mypy exclusions for a couple more libraries (#9160) Include numbagg in type checks (#9159) Improve zarr chunks docs (#9140) groupby: remove some internal use of IndexVariable (#9123) Improve `to_zarr` docs (#9139) Split out distributed writes in zarr docs (#9132) Update zendoo badge link (#9133) Support duplicate dimensions in `.chunk` (#9099) Bump the actions group with 2 updates (#9130) adjust repr tests to account for different platforms (#9127) (#9128) Grouper refactor (#9122) Update docstring in api.py for open_mfdataset(), clarifying "chunks" argument (#9121) Add test for rechunking to a size string (#9117) Move Sphinx directives out of `See also` (#8466) new whats-new section (#9115) release v2024.06.0 (#9113) release notes for 2024.06.0 (#9092) [skip-ci] Try fixing hypothesis CI trigger (#9112) Undo custom padding-top. (#9107) ...
Adjust the expectations in repr tests to account for different object sizes and numpy type representations across platforms, particularly fixing the tests on 32-bit platforms.
Firstly, this involves getting the object type size from NumPy and using it to adjust the expectations in DataArray and Dataset tests. The tests were already using int64 type consistently, so only the sizes used for Python objects needed to be adjusted.
Secondly, this involves fixing
test_array_repr_dtypes_unix
. The test specifically focuses on testing a 32-bit, 64-bit and "native" data type, which affect both size and actual representation (NumPy skips the dtype attribute for the native data type). Get the expected size from NumPy for the native int type, and reuserepr()
from NumPy for all array types.test_repr_multiindex*
andtest_array_repr_dtypes_unix
tests failing on 32-bit platforms #9127