You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Remove obsolete warning exclusions from pyproject.toml
Removed 11 warning exclusions that are no longer needed:
- Invalid cast warnings from duck_array_ops and test_array_api
- CachingFileManager deallocation warnings from backends
- Deprecated treenode methods (ancestors, iter_lineage, lineage)
- Test-specific deprecations that no longer exist
These exclusions were verified to be safe to remove through testing.
The test suite passes with 20,779 tests after removal.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Remove additional obsolete UserWarning exclusions
Removed 3 more warning exclusions that are no longer needed:
- UserWarning from test_coding_times
- UserWarning from test_computation
- UserWarning from test_dataset
All test files pass without these warning exclusions.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Remove 3 more obsolete warning exclusions
Removed warning exclusions that are no longer needed:
- "No index created" UserWarning - Tests properly handle with pytest.warns
- "pandas.MultiIndex" FutureWarning - No longer triggered
- "Duplicate dimension names" UserWarning - Tests handle with local filterwarnings
These warnings are either properly tested or no longer occur.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Use pytest.warns consistently for quantile interpolation deprecation
Fixed test_dataset.py to use pytest.warns instead of warnings.catch_warnings
for testing the interpolation->method deprecation warning. This makes it
consistent with the other test files.
Note: We cannot remove the global warning exclusion because the error:::xarray.*
rule converts warnings to errors before pytest.warns can catch them. This is
a known limitation of the current filterwarnings configuration.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Add local filterwarnings to quantile interpolation deprecation tests
Instead of relying on a global warning exclusion, added
@pytest.mark.filterwarnings decorators to the specific tests that
test the interpolation->method deprecation warning. This allows
the warning to be properly tested while avoiding the conflict
with the error:::xarray.* rule.
Now the global exclusion for this warning can be safely removed.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Remove non-tuple sequence indexing warning exclusion
Fixed the test in test_nputils.py that was using deprecated list indexing
x[[1, 2], [1, 2]] by changing it to tuple indexing x[([1, 2], [1, 2])].
This allows us to remove the global warning filter for 'Using a non-tuple
sequence for multidimensional indexing is deprecated'.
* Remove two obsolete NumPy DeprecationWarning exclusions
Removed the following warning exclusions from pyproject.toml:
- 'Failed to decode variable.*NumPy will stop allowing conversion...'
- 'NumPy will stop allowing conversion of:DeprecationWarning'
These exclusions are no longer needed as the tests pass without them.
The remaining 'invalid value encountered in cast' warnings are legitimate
and occur when casting NaN values to integer types.
* Change Zarr V3 warnings to default
These warnings are no longer ignored and will be reported in CI.
Co-authored-by: Claude <[email protected]>
* Remove 'invalid value encountered in cast' warning exclusions
Fixed tests to properly handle the expected RuntimeWarning when casting
NaN values to integer types:
- Updated test_conventions.py::test_missing_fillvalue to explicitly catch
both the SerializationWarning and the numpy RuntimeWarning
- Added create_nan_array() helper function in test_units.py that suppresses
the cast warning when creating test arrays with NaN values for int dtypes
- Removed the two warning exclusions from pyproject.toml
These warnings were legitimate - they occur when casting float arrays
containing NaN to integer types, which is expected behavior in these
test scenarios.
* Fix NumPy out-of-bound integer conversion warning
Handle overflow when casting _FillValue to dtype in CFMaskCoder.encode().
This fixes CI failures on older NumPy versions where casting 255 to int8
raises a DeprecationWarning (newer NumPy raises OverflowError).
The fix:
- Wraps the dtype.type(fv) call in a try/except block
- Suppresses the NumPy DeprecationWarning for older versions
- Catches OverflowError for newer NumPy versions
- Uses np.array(fv).astype(dtype) which properly wraps the value
* Fix remaining NumPy out-of-bound integer conversion warnings
Added comprehensive handling for NumPy's DeprecationWarning about
out-of-bound integer conversion in multiple locations:
- Added _safe_type_cast() helper function to handle the conversion safely
- Updated _encode_unsigned_fill_value() to suppress the warning
- Fixed missing_value encoding to use _safe_type_cast()
- Refactored _FillValue encoding to use the helper function
This should fix all test failures in the bare-min-and-scipy CI environment
where older NumPy versions raise DeprecationWarning instead of OverflowError.
* Simplify NumPy overflow handling with cleaner approach
Replaced complex warning suppression with a simpler, more consistent approach:
- _safe_type_cast() now uses np.array(value).astype(dtype).item() which works
consistently across NumPy 1.x and 2.x for overflow cases
- _encode_unsigned_fill_value() now explicitly checks bounds using np.iinfo()
before attempting the cast, making the logic clearer
- This removes unnecessary try/except blocks and warning filters
The root issue: NumPy changed behavior between versions:
- NumPy 1.x: dtype.type(out_of_bounds) raises DeprecationWarning but succeeds
- NumPy 2.x: dtype.type(out_of_bounds) raises OverflowError
The test itself (test_roundtrip_unsigned) is correctly testing edge cases
where unsigned values (255) need to be stored as signed int8, which is a
legitimate use case in CF conventions for unsigned integer encoding.
* Add autouse fixture for NumPy 1.x warning handling
- Added handle_numpy_1_warnings autouse fixture to conftest.py
- Removes need for workarounds in the actual code
- Handles NumPy version differences cleanly at the test level
- Reverted variables.py to simpler implementation without _safe_type_cast
---------
Co-authored-by: Claude <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Claude <[email protected]>
0 commit comments