v0.10.0
v0.10.0 (2024-09-30)
Contributors to this version: Juliette Lavoie (@juliettelavoie), Pascal Bourgault (@aulemahal), Gabriel Rondeau-Genesse (@RondeauG), Trevor James Smith (@Zeitsperre).
New features and enhancements
- The
mask
argument instack_drop_nans
can now be a list of dimensions. In that case, adropna(how='all')
operation will be used to create the mask on-the-fly. (PR/450). - Few changes to
clean_up
: minimum_calendar
now accepts a list as input. (PR/450).- More calendars are now recognized in
translate_time_chunk
. (PR/450). new_dim
inunstack_dates
is now None by default and changes depending on the frequency. It becomesmonth
if the data is exactly monthly, and keep the old default ofseason
otherwise. (PR/450).- Updated the list of libraries in
show_versions
to reflect our current environment. (PR/450). - New
xscen.catutils.patterns_from_schema
to generate all possible patterns from a given schema (or one of xscen's default), to use with :py:func:parse_directory
. (PR/431). - New
DataCatalog.copy_files
to copy all files of catalog to a new destination, unzipping if needed and returning a new catalog. (PR/431). - Convenience functions
xs.io.zip_directory
andxs.io.unzip_directory
(for zarrs). (PR/431). - New argument
compute_indicators
:rechunk_input
to rechunk the inputs to resample-appropriate chunks before calling xclim. (PR/431). - New
xs.indicators.get_indicator_outputs
to retrieve what variable name(s) and frequency to expect from an xclim indicator. (PR/431). xscen
now supports launches tests frompytest
with the--numprocesses
option. See thepytest-xdist documentation <https://pytest-xdist.readthedocs.io/en/stable/>
_ for more information. (PR/464).- Conservative regridding now supports oblique mercator projections. (PR/467).
- The automatic name for the weight file in
regrid_dataset
is now more explicit to avoid errors, but now requirescat:id
andcat:domain
arguments for both the source and target datasets. (PR/467).
Bug fixes
- Fixed bug with reusing weights. (GH/411, PR/414).
- Fixed bug in
update_from_ds
when "time" is a coordinate, but not a dimension. (:pull:417
). - Avoid modification of mutable arguments in
search_data_catalogs
(PR/413). ensure_correct_time
now correctly handles cases where timesteps are missing. (PR/440).- If using the argument
tile_buffer
with ashape
method inspatial.subset
, the shapefile will now be reprojected to a WGS84 grid before the buffer is applied. (PR/440). maybe_unstack
now works if the dimension name is not the default. (PR/450).unstack_fill_nan
now works if given a dictionary that contains both dimensions and coordinates. (PR/450).clean_up
no longer modifies the original dataset. (PR/450).unstack_dates
now works correctly for yearly datasets whenwinter_starts_year=True
, as well as multi-year datasets. (PR/450).- Fix
xs.catalog.concat_data_catalogs
for catalogs that have not been search yet. (PR/431). - Fix indicator computation using
freq=2Q*
by assuming this means a semiannual frequency anchored at the given month (pandas assumes 2 quarter steps, any of them anchored at the given month). (PR/431). create_bounds_rotated_pole
now uses the default value if the dataset has nonorth_pole_grid_longitude
attribute, instead of crashing. (PR/455).- Rewrote the global tas data file with latest HDF5/h5py to avoid errors when using h5py 3.11 and hdf5 1.14.2. (PR/1861).
- Remove reference of deprecated xclim functions (
convert_calendar
,get_calendar
) and adapt the code for supporting xclim 0.52.2 and its subsequent development version. (PR/465).
Breaking changes
convert_calendar
inclean_up
now usesxarray
instead ofxclim
. Keywords aren't compatible between the two, but given thatxclim
will abandon its function, no backwards compatibility was sought. (PR/450).attrs_to_remove
andremove_all_attrs_except
inclean_up
now use real regex. It should not be too breaking since afullmatch()
is used, but*
is now.*
. (PR/450).- Python 3.9 is no longer supported. (PR/456).
- Functions and arguments that were deprecated in
xscen
v0.8.0 or earlier have been removed. (PR/461). pytest-xdist
is now a development dependency. (PR/464).xs.regrid.create_bounds_rotated_pole
has been renamed toxs.regrid.create_bounds_gridmapping
. (PR/467).- The
weights_location
argument inregrid_dataset
is no longer positional. (PR/467). - The
xs.regrid.create_mask
function now requires explicit arguments instead of a dictionary. (PR/467).
Internal changes
DataCatalog.to_dataset
can now accept apreprocess
argument even ifcreate_ensemble_on
is given. The user assumes calendar handling. (PR/431).- Include domain in
weight_location
inregrid_dataset
. (PR/414). - Added pins to
xarray
,xclim
,h5py
, andnetcdf4
. (PR/414). - Add
.zip
and.zarr.zip
as possible file extensions for Zarr datasets. (PR/426). - Explicitly assign coords of multiindex in
xs.unstack_fill_nan
. (PR/427). - French translations are compiled offline. A new check ensures no PR are merged with missing messages. (GH/342, PR/443).
- Continued work to add tests. (PR/450).
- Updated the cookiecutter template via
cruft
: (PR/452)- GitHub Workflows that use rely on
PyPI
-based dependencies now use commit hashes. Dependabot
will now group updates by type.- Dependencies have been updated and synchronized.
- Contributor guidance documentation has been adjusted.
numpydoc-validate
has been added to the linting tools.- Linting checks are more reliant on
ruff
suggestions and stricter. flake8-alphabetize
has been replaced byruff
.- License information has been updated in the library top-level
__init__.py
.
- GitHub Workflows that use rely on
- Docstrings have been adjusted to meet the
numpydoc
standard. (PR/452).
CI changes
- The
bump-version.yml
workflow now uses the Ouranosinc GitHub Helper Bot to sign bump version commits. (PR/462).