Recent Releases of xscen
xscen - v0.12.3
v0.12.3 (2025-05-26)
Contributors to this version: Juliette Lavoie (@juliettelavoie).
Bug fixes
- Python
Published by RondeauG 9 months ago
xscen - v0.12.2
v0.12.2 (2025-05-16)
Contributors to this version: Juliette Lavoie (@juliettelavoie), Éric Dupuis (@coxipi), Gabriel Rondeau-Genesse (@RondeauG).
Breaking changes
- Remove
adapt_freqargument fromxs.train. This argument should be passed to xsdba directly. (PR/589). ### New features and enhancements - Add annual global tas timeseries for CMIP6's model UKESM1-0-LL ssp585 r4i1p1f2 (PR/573).
- Add
strict_unitsoption to health checks. (PR/574, GH/574). - Add 10yr and 30yr frequencies support in CVs. (PR/576).
- New converters
hurslogit_from_hursandhurs_from_hurslogit. (PR/590). ### Bug fixes xs.utils.change_unitswill now always check that the units returned are exactly the same as the requested units. (PR/578).- Fixed a bug in
xs.catalog.subset_file_coveragewhere the function could not process dates after 2262. (GH/587, PR/591).
- Python
Published by RondeauG 10 months ago
xscen - v0.12.1
Contributors to this version: Juliette Lavoie (@juliettelavoie), Gabriel Rondeau-Genesse (@RondeauG), Éric Dupuis (@coxipi), Pascal Bourgault (@aulemahal).
New features and enhancements
xscenofficially supports Python 3.13. (PR/551).
Breaking changes
- Make
strip_cat_metadataFalse by default inxs.save_to_zarrandxs.save_to_netcdf. (PR/556, GH/555). - New official column
driving_member. For RCMs, this should store the driver's realisation number, while themembercolumn should now store the RCM simulation's realisation number, noted as "rX". Thismembershould approximately map to the "realization" part of CORDEX-CMIP6's "versionrealization" facet (the version part mapping to the already existingversioncolumn). The member restricting feature of ``searchdatacatalogshas been adapted, but continues to work with catalogs missing thedrivingmember`` column. (PR/559). - Also adapted from the CORDEX-CMIP6 specifications, the
driving_modelcolumn does not need to indicate the driver's institution name anymore. (PR/559). - For Python 3.13 support,
xscennow requiresclisops>=0.16.1andxsdba>=0.4.0. (PR/551). - Minimum required
intake-esmhas been updated to>=2025.2.3. (PR/551). - Temporarily pinned
numcodecsto<0.16.0for compatibility withzarr. (PR/571).
Bug fixes
- Fixed the default for
xs.utils.maybe_unstack. (PR/553). - Patch
xsdba.units.convert_units_towithxclim.core.units.convert_units_towithcontext="infer"locally inxs.trainandxs.adjustinstead of usingxc.core.settings.context. (PR/552). - Fixed a bug in
xs.utils.clean_upwhere attributes would be dropped when using themissing_by_varsargument. (PR/569, GH/568). - Allow undetectable frequencies in
xs.extract.resample. (PR/567).
Internal changes
- Added the ability to test
xESMF-related functions withtox / pip. (PR/554). - Updated the pins for
xclim,xarray,dask, andrechunker. (PR/570). - More accurate listing of dependencies for the project in
pyproject.tomlandenvironment*.yml. (PR/557). sphinxdependencies are more streamlined in thedocsenvironment. (PR/557).- Added
codespell,deptry,vulture, andyamllintto the linting checks. (PR/557).
- Python
Published by Zeitsperre 11 months ago
xscen - v0.12.0
Contributors to this version: Trevor James Smith (@Zeitsperre), Pascal Bourgault (@aulemahal), Juliette Lavoie (@juliettelavoie), Sarah Gammon (@SarahG-579462), Éric Dupuis (@coxipi).
Breaking changes
xscennow usesflitas its build-engine and no longer usessetuptools,setuptools-scm, orwheel. (PR/519).- Update to support Python3.13 and
xclimv0.55.0 (PR/532). xscennow requires thexsdbapackage for bias adjustment functionality (replacement forxclim.sdba). (PR/530).
New features and enhancements
- Include station-obs and forecasts in the derived schema for
build_path. (PR/534). - Project catalog now allows
check_validanddrop_duplicateskeyword arguments. (PR/536, GH/535). - Add annual global tas timeseries for CMIP6's models CanESM5 r1i1p2f1 (ssp126, ssp245, ssp370, ssp585), MPI-ESM1-2-LR ssp370 (r2i1p1f1, r3i1p1f1, r4i1p1f1, r5i1p1f1) (PR/544).
- Allow pd.Timestamp and more precise datetime strings for xs.searchdatacatalogs and dc.search (PR/547, GH/546)
Bug fixes
- Docstrings and documentation have been updated to remove several small grammatical errors. (PR/527).
Internal changes
- Updated the cookiecutter template to the latest commit. (PR/527):
- Updated versions of many GitHub Actions and Python dependencies.
- Removed
coverallsfrom the CI dependencies. - Added
pre-commithooks forvulture(dead code) andcodespell(typos).
- The minimum supported
clisopsversion has been raised to v0.15.0. (PR/533). - Dependency pins have been synchronized across the repository. (PR/533).
- GitHub Workflows for conda builds now use the
coverallsapp/github-actionaction for coverage reporting. (PR/533). xsdbais now used instead ofxclim.sdba. (PR/530).
- Python
Published by github-actions[bot] 12 months ago
xscen - v0.11.0
Contributors to this version: Gabriel Rondeau-Genesse (@RondeauG), Juliette Lavoie (@juliettelavoie), Trevor James Smith (@Zeitsperre).
New features and enhancements
- Improve
xs.ensembles.build_partition_data. (PR/504). ### Breaking changes xs.utils.publish_release_notesandxs.utils.show_versionshave been moved toxs.testing. (PR/492).- The previously-deprecated
xs.reducemodule has been removed. Refer toxs.ensembles.make_criteriaandxs.ensembles.reduce_ensemblefor replacement functionality. (PR/517). ### Bug fixes - Added a missing library (
openpyxl) to the requirements. (PR/492). - Fixed a bug in
xs.io.subset_maxsizewhere the function would drop the last year. (PR/492). - Fixed a bug in
xs.io.clean_incompletewhere the.zmetadatafile was not removed. (PR/492). - Fixed a bug in the saving of datasets where encoding was sometimes not applied, resulting for example in rechunking not being respected. (PR/492).
- Fixed multiple bugs in
xs.io.save_to_zarrwithmode='a'. (PR/492). - Fixed a few minor bugs in
xs.io.save_to_table. (PR/492). ### Internal changes - Added a new parameter
latesttoxs.testing.publish_release_notesto only print the latest release notes. (PR/492). - The estimation method in
xs.io.estimate_chunkshas been improved. (PR/492). - A new parameter
incompletehas been added toxs.io.clean_incompleteto remove incomplete variables. (PR/492). - Continued work on adding tests. (PR/492).
- Modified a CI build to test against the oldest supported version of
xclim. (PR/505). - Updated the cookiecutter template version: (PR/507)
- Added
vultureto pre-commit hooks (finding dead code blocks). - Added
zizmorto the pre-commit hooks (security analysis for CI workflows). - Secured token usages on all workflows (using
zizmor). - Simplified logic in
bump-version.yml. - Synchronized a few dependencies.
- Added
- Fixed a few socket blocks and configuration issues in the CI workflows. (PR/512).
- Added Open Source Security Foundation Best Practices badge, Zenodo DOI badge, FOSSA license compliance badge to the README. (PR/514).
- Several deprecated usages within the code base have been addressed. The number of warnings emitted from the test suite have been significantly reduced. (GH/515, PR/516).
- Python
Published by github-actions[bot] about 1 year ago
xscen - v0.10.1
v0.10.1 (2024-11-04)
Contributors to this version: Gabriel Rondeau-Genesse (@RondeauG), Pascal Bourgault (@aulemahal), Éric Dupuis (@coxipi), Juliette Lavoie (@juliettelavoie).
New features and enhancements
xs.io.make_tocnow includes the global attributes of the dataset after the information about the variables. (PR/473).- New function
xs.get_warming_level_from_periodto get the warming level associated with a given time horizon. (PR/474). - Added ability to skip whole folders to
xs.parse_directorywith argumentskip_dirs. (PR/478, PR/479). diagnostics.measures_improvementnow acceptsdim, which specifiesdimension(s)on which the proportion of improved pixels are computed. (PR/416)- The argument
indicatorsinxs.produce_horizonis now optional. Added an argumentopto control the climatological operation. (PR/483). ### Breaking changes xs.get_warming_levelhas been renamed toxs.get_period_from_warming_level. Its argumentreturn_horizonwas reversed and renamedreturn_central_year(PR/474).- Removed support for the deprecated
xclimfunctionchange_significanceinensemble_stats. (PR/482). - The argument
indicatorsinxs.produce_horizonis no longer positional. (PR/483). ### Bug fixes xs.io.save_to_tablenow correctly handles the case where the input is aDataArrayor aDatasetwith a single variable. (PR/473).- Fixed a bug in
xs.utils.change_unitswhere the original dataset was also getting modified. (PR/482). - Fixed a bug in
xs.compute_indicatorswhere thecat:variableattribute was not correctly set. (PR/483). - Fixed a bug in
xs.climatological_opwhere kwargs were not passed to the operation function. (PR/486). - Fixed a bug in
xs.climatological_opwheremin_periodswas not passed when the operation waslinregress. (PR/486). ### Internal changes - Include CF convention for temperature differences and on scale (PR/428, GH/428).
- Bumped the version of
xclimto 0.53.2. (PR/482). - More tests added. (PR/486).
- Fixed a bug in
xs.testing.datablock_3dwhere some attributes of the rotated pole got reversed half-way through the creation of the dataset. (PR/486). - The function
xs.regrid._get_grid_mappingwas moved toxs.spatial.get_grid_mappingand is now a public function. (PR/486).
- Python
Published by RondeauG over 1 year ago
xscen - 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
maskargument instack_drop_nanscan 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_calendarnow accepts a list as input. (PR/450).- More calendars are now recognized in
translate_time_chunk. (PR/450). new_diminunstack_datesis now None by default and changes depending on the frequency. It becomesmonthif the data is exactly monthly, and keep the old default ofseasonotherwise. (PR/450).- Updated the list of libraries in
show_versionsto reflect our current environment. (PR/450). - New
xscen.catutils.patterns_from_schemato 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_filesto copy all files of catalog to a new destination, unzipping if needed and returning a new catalog. (PR/431). - Convenience functions
xs.io.zip_directoryandxs.io.unzip_directory(for zarrs). (PR/431). - New argument
compute_indicators:rechunk_inputto rechunk the inputs to resample-appropriate chunks before calling xclim. (PR/431). - New
xs.indicators.get_indicator_outputsto retrieve what variable name(s) and frequency to expect from an xclim indicator. (PR/431). xscennow supports launches tests frompytestwith the--numprocessesoption. 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_datasetis now more explicit to avoid errors, but now requirescat:idandcat:domainarguments 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_dswhen "time" is a coordinate, but not a dimension. (:pull:417). - Avoid modification of mutable arguments in
search_data_catalogs(PR/413). ensure_correct_timenow correctly handles cases where timesteps are missing. (PR/440).- If using the argument
tile_bufferwith ashapemethod inspatial.subset, the shapefile will now be reprojected to a WGS84 grid before the buffer is applied. (PR/440). maybe_unstacknow works if the dimension name is not the default. (PR/450).unstack_fill_nannow works if given a dictionary that contains both dimensions and coordinates. (PR/450).clean_upno longer modifies the original dataset. (PR/450).unstack_datesnow works correctly for yearly datasets whenwinter_starts_year=True, as well as multi-year datasets. (PR/450).- Fix
xs.catalog.concat_data_catalogsfor 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_polenow uses the default value if the dataset has nonorth_pole_grid_longitudeattribute, 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_calendarinclean_upnow usesxarrayinstead ofxclim. Keywords aren't compatible between the two, but given thatxclimwill abandon its function, no backwards compatibility was sought. (PR/450).attrs_to_removeandremove_all_attrs_exceptinclean_upnow 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
xscenv0.8.0 or earlier have been removed. (PR/461). pytest-xdistis now a development dependency. (PR/464).xs.regrid.create_bounds_rotated_polehas been renamed toxs.regrid.create_bounds_gridmapping. (PR/467).- The
weights_locationargument inregrid_datasetis no longer positional. (PR/467). - The
xs.regrid.create_maskfunction now requires explicit arguments instead of a dictionary. (PR/467). ### Internal changes DataCatalog.to_datasetcan now accept apreprocessargument even ifcreate_ensemble_onis given. The user assumes calendar handling. (PR/431).- Include domain in
weight_locationinregrid_dataset. (PR/414). - Added pins to
xarray,xclim,h5py, andnetcdf4. (PR/414). - Add
.zipand.zarr.zipas 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. Dependabotwill now group updates by type.- Dependencies have been updated and synchronized.
- Contributor guidance documentation has been adjusted.
numpydoc-validatehas been added to the linting tools.- Linting checks are more reliant on
ruffsuggestions and stricter. flake8-alphabetizehas 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
numpydocstandard. (PR/452). ### CI changes - The
bump-version.ymlworkflow now uses the Ouranosinc GitHub Helper Bot to sign bump version commits. (PR/462).
- Python
Published by github-actions[bot] over 1 year ago
xscen - v0.9.1
v0.9.1 (2024-06-04)
Contributors to this version: Pascal Bourgault (@aulemahal), Trevor James Smith (@Zeitsperre), Juliette Lavoie (@juliettelavoie).
Breaking changes
xscennow uses a src layout in lieu of a flat layout. (PR/407). ### Bug fixes- Fixed defaults for
xr_combine_kwargsinextract_dataset(PR/402). - Fixed bug with
xs.utils.update_attr(GH/404, PR/405). - Fixed template 1 bugs due to changes in dependencies. ( PR/405). ### Internal changes
cartopyhas been pinned above version '0.23.0' in order to address a licensing issue. (PR/403).- The cookiecutter template has been updated to the latest commit via
cruft. (PR/407).- GitHub Workflows now point to commits rather than tags.
Dependabotwill now only update on a monthly schedule.- Dependencies have been updated and synchronized.
CHANGES.rstis nowCHANGELOG.rst(see: KeepAChangelog).- The
CODE_OF_CONDUCT.rstfile adapted toContributor Covenant v2.1 <https://www.contributor-covenant.org/version/2/1/code_of_conduct/>_. - Maintainer-specific directions are now found under
releasing.rst
- Python
Published by RondeauG over 1 year ago
xscen - v0.9.0
v0.9.0 (2024-05-07)
Contributors to this version: Trevor James Smith (@Zeitsperre), Pascal Bourgault (@aulemahal), Gabriel Rondeau-Genesse (@RondeauG), Juliette Lavoie (@juliettelavoie), Marco Braun (@vindelico).
New features and enhancements
xs.reduce_ensemblewill now callxclim.ensembles.create_ensembleandxclim.ensembles.make_criteraif required. (PR/386). ### Breaking changes- Removed support for the old instances of the
regionargument inspatial_mean,extract_dataset, andsubset. (PR/367). - Removed
xscen.extract.clisops_subset. (PR/367). dtr(the function) was renamed todtr_from_minmaxto avoid confusion with thedtrvariable. (PR/372).- The
xscen.reducemodule has been abandoned. (PR/386).build_reduction_datahas been made redundant byxclim.ensembles.make_criteraand will be removed in a future release.xscen.reduce.reduce_ensemblehas been moved toxscen.ensembles.reduce_ensemble, as a module was no longer necessary. ### Internal changes
- Modified
xscen.utils.change_unitto always adopt the name from thevariables_and_units dictionaryif the physical units are equal but their names are not (ex. degC <-> ˚C) (PR/373). - Updated the
cookiecuttertemplate to the latest version. (PR/358):- Addresses a handful of misconfigurations in the GitHub Workflows.
- Added a few free
grep-based hooks for finding unwanted artifacts in the code base. - Updated
ruffto v0.2.0 andblackto v24.2.0.
- Added more tests. (PR/366, PR/367, PR/372).
- Refactored
xs.spatial.subsetinto smaller functions. (PR/367). - An
encodingargument was added toxs.config.load_config. (PR/370). - Various small fixes to the code to address FutureWarnings. (PR/380).
xs.spatial.subsetwill try to guess CF coordinate if it can't find "latitude" or "longitude" inds.cf. (PR/384).xs.extract_datasetandxs.DataCatalog.to_datasetwill now default to opening datasets with optionchunks={}, which tries to respect chunking on disk. (PR/398, GH/368). ### Bug fixes- Fix
unstack_datesfor the new frequency syntax introduced by pandas v2.2. (PR/359). subset_warming_levelwill not return partial subsets if the warming level is reached at the end of the timeseries. (GH/360, PR/359).- Loading of training in
adjustis now done outside of the periods loop. (PR/366). - Fixed bug for adding the preprocessing attributes inside the
adjustfunction. (PR/366). - Fixed a bug to accept
group = Falseinadjustfunction. (PR/366). creep_weightsnow correctly handles the case where the grid is small,nis large, andmode=wrap. (GH/367).- Fixed a bug in
tasmin_from_dtrandtasmax_from_dtr, whendtrunits differed from tasmin/max. (PR/372). - Fixed a bug where the requested chunking would be ignored when saving a dataset (PR/379).
- The missing value check in
health_checkswill no longer crasg if a variable has no time dimension. (PR/382).
- Python
Published by github-actions[bot] almost 2 years ago
xscen - v0.8.3
Contributors to this version: Juliette Lavoie (@juliettelavoie), Trevor James Smith (@Zeitsperre), Gabriel Rondeau-Genesse (@RondeauG), Pascal Bourgault (@aulemahal).
Announcements
xscennow has a security disclosure policy. (PR/353).- Various frequency-related changes to match the new
pandasnaming conventions. (PR/351).
Internal changes
- Added tests for diagnostics. (PR/352).
- Added a
SECURITY.mdfile to the repository and the documentation. (PR/353). - Added
toxmodifier for testing builds against themaindevelopment branch ofxclim. (PR/351, PR/355). - Added a
requirements_upstream.txtfile to the repository to track the development branches of relevant dependencies. (PR/355). - Added a dedicated GitHub Workflow to evaluate compatibility with upstream dependencies. (PR/355).
Breaking changes
xscennow requirespandas>= 2.2 andxclim>= 0.48.2. (PR/351).- Functions that output a dict with keys as xrfreq (such as
extract_dataset,compute_indicators) will now return the new nomenclature (e.g."YS-JAN"instead of"AS-JAN"). (PR/351). - Going from
xrfreqto frequencies or timedeltas will still work, but the opposite (frequency --> xrfreq/timedelta) will now only result in the newpandasnomenclature. (PR/351).
- Python
Published by Zeitsperre about 2 years ago
xscen - v0.8.2
v0.8.2 (2024-02-12)
Contributors to this version: Trevor James Smith (@Zeitsperre), Pascal Bourgault (@aulemahal)
New features and enhancements
- Added a new argument
indicators_kwtoxs.ensembles.build_partition_data. (PR/315). xscenisSemantic Versioning 2.0.0 <https://semver.org/spec/v2.0.0.html>_ compliant. (PR/319).xesmfmade an optional dependency, makingxsceneasier to install withpip. (PR/337). ### Internal changes- Granular permissions and dependency scanning actions have been added to all GitHub CI Workflows. (PR/313).
- Updated the list of dependencies to add missing requirements. (PR/314).
- The
cookiecuttertemplate has been updated to the latest commit viacruft. (PR/319):actions-versions-updater.ymlhas been replaced with Dependabot (it's just better).- The OpenSSF
scorecard.ymlworkflow has been added to the GitHub workflows to evaluate package security. - Code formatting tools (
black,blackdoc,isort) are now hard-pinned. These need to be kept in sync with changes frompre-commit. (Dependabot should perform this task automatically.) - The versioning system has been updated to follow the Semantic Versioning 2.0.0 standard.
- Python
Published by RondeauG about 2 years ago
xscen - v0.8.0
Changelog
v0.8.0 (2024-01-16)
Contributors to this version: Gabriel Rondeau-Genesse (@RondeauG), Pascal Bourgault (@aulemahal), Juliette Lavoie (@juliettelavoie), Sarah-Claude Bourdeau-Goulet (@sarahclaude), Trevor James Smith (@Zeitsperre), Marco Braun (@vindelico).
Announcements
xscennow adheres to PEPs 517/518/621 using thesetuptoolsandsetuptools-scmbackend for building and packaging. (PR/292). ### New features and enhancements- New function
xscen.indicators.select_inds_for_avail_varsto filter the indicators that can be calculated with the variables available in axarray.Dataset. (PR/291). - Replaced aggregation function
climatological_mean()withclimatological_op()offering more types of operations to aggregate over climatological periods. (PR/290) - Added the ability to search for simulations that reach a given warming level. (PR/251).
xs.spatial_meannow accepts theregion="global"keyword to perform a global average (GH/94, PR/260).xs.spatial_meanwithmethod='xESMF'will also automatically segmentize polygons (down to a 1° resolution) to ensure a correct average (PR/260).- Added documentation for
require_all_oninsearch_data_catalogs. (PR/263). xs.save_to_tableandxs.io.to_tableto transform datasets and arrays to DataFrames, but with support for multi-columns, multi-sheets and localized table of content generation.- Better
xs.extract.resample: support for weighted resampling operations when starting with frequencies coarser than daily and missing timesteps/values handling. (GH/80, GH/93, PR/265). - New argument
attribute_weightstogenerate_weightsto allow for custom weights. (PR/252). xs.io.round_bitsto round floating point variable up to a number of bits, allowing for a better compression. This can be combined with the saving step through argument"bitround"ofsave_to_netcdfandsave_to_zarr. (PR/266).- Added annual global tas timeseries for CMIP6's models CMCC-ESM2 (ssp245, ssp370, ssp585), EC-Earth3-CC (ssp245, ssp585), KACE-1-0-G (ssp245, ssp370, ssp585) and TaiESM1 (ssp245, ssp370). Moved global tas database to a netCDF file. (GH/268, PR/270).
- Implemented support for multiple levels and models in
xs.subset_warming_level. Better support forDataArrayandDataFrameinxs.get_warming_level. (PR/270). - Added the ability to directly provide an ensemble dataset to
xs.ensemble_stats. (PR/299). - Added support in
xs.ensemble_statsfor the new robustness-related functions available inxclim. (PR/299). - New function
xs.ensembles.get_partition_input(PR/289). ### Breaking changes climatological_mean()has been replaced withclimatological_op()and will be abandoned in a future version. (PR/290)experiment_weightsargument ingenerate_weightswas renamed tobalance_experiments. (PR/252).- New argument
attribute_weightstogenerate_weightsto allow for custom weights. (PR/252). - For a sequence of models, the output of
xs.get_warming_levelis now a list. Revert to a dictionary withoutput='selected'(PR/270). - The global average temperature database is now a netCDF, custom databases must follow the same format (PR/270). ### Bug fixes
- Fixed a bug in
xs.search_data_catalogswhen searching for fixed fields and specific experiments/members. (PR/251). - Fixed a bug in the documentation build configuration that prevented stable/latest and tagged documentation builds from resolving on ReadTheDocs. (PR/256).
- Fixed
get_warming_levelto avoid incomplete matches. (PR/269). search_data_catalogsnow eliminates anything that matches any entry inexclusions. (GH/275, PR/280).- Fixed a bug in
xs.scripting.save_and_updatewherebuild_path_kwargswas ignored when trying to guess the file format. (PR/282). - Add a warning to
xs.extract._dispatch_historical_to_future. (GH/286, PR/287). - Modify usecftime for the calendar conversion in ``todataset``. (GH/303, PR/289). ### Internal changes
- Continued work on adding tests. (PR/251).
- Fixed
pre-commit'spretty-format-jsonhook so that it ignores notebooks. (PR/254). - Fixed the labeler so docs/CI isn't automatically added for contributions by new collaborators. (PR/254).
- Made it so that
testsare no longer treated as an installable package. (PR/248). - Renamed the pytest marker from
requires_docstorequires_netcdf. (PR/248). - Included the documentation in the source distribution, while excluding the NetCDF files. (PR/248).
- Reduced the size of the files in
/docs/notebooks/samplesand changed the notebooks and tests accordingly. (GH/247, PR/248). - Added a new
xscen.testingmodule with thedatablock_3dfunction previously located in/tests/conftest.py. (PR/248). - New function
xscen.testing.fake_datato generate fake data for testing. (PR/248). - xESMF 0.8 Regridder and SpatialAverager argument
out_chunksis now accepted byxs.regrid_datasetandxs.spatial_mean. (PR/260). - Testing, Packaging, and CI adjustments. (PR/274):
xscenbuilds now install in atoxenvironment withconda-providedESMFin GitHub Workflows.toxnow offers a method for installing esmpy from a tag/branch (via ESMF_VERSION environment variable).$ make translateis now called on ReadTheDocs and withintox.- Linters are now called by order of most common failures first, to speed up the CI.
Manifest.inis much more specific about what is installed.- Re-adds a dev recipe to the
setup.py.
- Multiple improvements to the docstrings and type annotations. (PR/282).
pip checkin conda builds in GitHub workflows have been temporarily set to always pass. (PR/288).- The
cookiecuttertemplate has been updated to the latest commit viacruft. (PR/292):setup.pyhas been mostly hollowed-out, save for thebabel-related translation function.pyproject.tomlhas been added, with most package configurations migrated into it.HISTORY.rsthas been renamed toCHANGES.rst.actions-version-updater.ymlhas been added to automate the versioning of the package.pre-commithooks have been updated to the latest versions;check-tomlandtoml-sorthave been added to cleanup thepyproject.tomlfile, andcheck-json-schemahas been added to ensure GitHub and ReadTheDocs workflow files are valid.ruffhas been added to the linting tools to replace mostflake8andpydocstyleverifications.toxbuilds are more pure Python environment/PyPI-friendly.xscennow usesTrusted Publishingfor TestPyPI and PyPI uploads.
- Linting checks now examine the testing folder, function complexity, and alphabetical order of
__all__lists. (PR/292). publish_release_notesnow uses better logic for finding and reformatting theCHANGES.rstfile. (PR/292).bump2versionversion-bumping utility was replaced bybump-my-version. (PR/292).- Documentation build checks no longer fail due to broken external links; Notebooks are now nested and numbered. (PR/304).
- Python
Published by github-actions[bot] about 2 years ago
xscen - v0.7.0
v0.7.0 (2023-08-22)
Contributors to this version: Gabriel Rondeau-Genesse (@RondeauG), Pascal Bourgault (@aulemahal), Trevor James Smith (@Zeitsperre), Juliette Lavoie (@juliettelavoie), Marco Braun (@vindelico).
Announcements
- Dropped support for Python 3.8, added support for 3.11. (PR/199, PR/222).
xscenis now available onconda-forge <https://anaconda.org/conda-forge/xscen>_, and can be installed withconda install -c conda-forge xscen. (PR/241) ### New features and enhancementsxscennow tracks code coverage using coveralls. (PR/187).- New function
get_warming_levelto search within the IPCC CMIP global temperatures CSV without requiring data. (GH/208, PR/210). - File re-structuration from catalogs with
xscen.catutils.build_path. (PR/205, PR/237). - New scripting functions
save_and_updateandmove_and_delete. (PR/214). - Spatial dimensions can be generalized as X/Y when rechunking and will be mapped to rlon/rlat or lon/lat accordingly. (PR/221).
- New argument
var_as_stringforget_cat_attrsto return variable names as strings. (PR/233). - New argument
copyformove_and_delete. (PR/233). - New argument
restrict_yearforcompute_indicators. (PR/233). - Add more comments in the template. (PR/233, GH/232).
generate_weightsnow allows to split weights between experiments, and make them vary along the time/horizon axis. (GH/108, PR/231).- New independencelevel,
institution, added to ``generateweights``. (PR/231). - Updated
produce_horizonso it can accept multiple periods or warming levels. (PR/231, PR/240). - Add more comments in the template. (PR/233, PR/235, GH/232).
- New function
diagnostics.health_checksthat can perform multiple checkups on a dataset. (PR/238). ### Breaking changes - Columns
date_startanddate_endnow use adatetime64[ms]dtype. (PR/222). - The default output of
date_parseris nowpd.Timestamp(output_dtype='datetime'). (PR/222). date_parser(date, end_of_period=True)has time "23:59:59", instead of "23:00". (PR/222, PR/237).driving_institutionwas removed from the "default" xscen columns. (PR/222).- Folder parsing utilities (
parse_directory) moved toxscen.catutils. Signature changed :globpatternremoved,dirglobadded, newpatternsspecifications. See doc for all changes. (PR/205). compute_indicatorsnow returns all outputs produced by indicators with multiple outputs (such asrain_season). (PR/228).- In
generate_weights, independence_levelallwas renamedmodel. (PR/231). - In response to a bugfix, results for
generate_weights(independence_level='GCM')are significantly altered. (GH/230, PR/231). - Legacy support for
stats_kwargsinensemble_statswas dropped. (PR/231). periodinproduce_horizonhas been deprecated and replaced withperiods. (PR/231).- Some automated
to_levelwere updated to reflect more recent changes. (PR/231). - Removed
diagnostics.fix_unphysical_values. (PR/238). ### Bug fixes - Fix bug in
unstack_dateswith seasonal climatological mean. (GH/202, PR/202). - Added NotImplemented errors when trying to call
climatological_meanandcompute_deltaswith daily data. (PR/187). - Minor documentation fixes. (GH/223, PR/225).
- Fixed a bug in
unstack_dateswhere it failed for anything other than seasons. (PR/228). cleanupwithcommon_attrs_onlynow works even when nocatattribute is present in the datasets. (PR/231). ### Internal changes- Removed the pin on xarray's version. (GH/175, PR/199).
- Folder parsing utilities now in pure python, platform independent. New dependency
parse. (PR/205). - Updated ReadTheDocs configuration to prevent
--eagerinstallation of xscen (PR/209). - Implemented a template to be used for unit tests. (PR/187).
- Updated GitHub Actions to remove deprecation warnings. (PR/187).
- Updated the cookiecutter used to generate boilerplate documentation and code via
cruft. (PR/212). - A few changes to
subset_warming_levelso it doesn't needdriving_institution. (PR/215). - Added more tests. (PR/228).
- In
compute_indicators, the logic to manage indicators returning multiple outputs was simplified. (PR/228).
- Python
Published by RondeauG over 2 years ago
xscen - v0.6.0
History
v0.6.0 (2023-05-04)
Contributors to this version: Trevor James Smith (@Zeitsperre), Juliette Lavoie (@juliettelavoie), Pascal Bourgault (@aulemahal), Gabriel Rondeau-Genesse (@RondeauG).
Announcements
xscenis now offered as a conda package available through Anaconda.org. Refer to the installation documentation for more information. (GH/149, PR/171).- Deprecation: Release 0.6.0 of
xscenwill be the last version to supportxscen.extract.clisops_subset. Usexscen.spatial.subsetinstead. (PR/182, PR/184). - Deprecation: The argument
region, used in multiple functions, has been slightly reformatted. Release 0.6.0 ofxscenwill be the last version to support the old format. (GH/99, GH/101, PR/184). ### New features and enhancements - New 'cos-lat' averaging in
spatial_mean. (GH/94, PR/125). - Support for computing anomalies in
compute_deltas. (PR/165). - Add function
diagnostics.measures_improvement_2d. (PR/167). - Add function
regrid.create_bounds_rotated_poleand automatic use inregrid_datasetandspatial_mean. This is temporary, while we wait for a functionning method incf_xarray. (PR/174, GH/96). - Add
spatialsubmodule with functionscreep_weightsandcreep_fillfor filling NaNs using neighbours. (PR/174). - Allow passing
GeoDataFrameinstances inspatial_mean'sregionargument, not only geospatial file paths. (PR/174). - Allow searching for periods in
catalog.search. (GH/123, PR/170). - Allow searching and extracting multiple frequencies for a given variable. (GH/168, PR/170).
- New masking feature in
extract_dataset. (GH/180, PR/182). - New function
xs.spatial.subsetto replacexs.extract.clisops_subsetand add method "sel". (GH/180, PR/182). - Add long_name attribute to diagnostics. ( PR/189).
- Added a new YAML-centric notebook (GH/8, PR/191).
- New
utils.standardize_periodsto standardize that argument across multiple functions. (GH/87, PR/192). - New
coverage_kwargsargument added tosearch_data_catalogsto allow modifying the default values ofsubset_file_coverage. (GH/87, PR/192). ### Breaking changes - 'mean' averaging has been deprecated in
spatial_mean. (PR/125). - 'interpcoord' has been renamed to 'interpcentroid' in
spatial_mean. (PR/125). - The 'datasets' dimension of the output of
diagnostics.measures_heatmapis renamed 'realization'. (PR/167). _subset_file_coveragewas renamedsubset_file_coverageand moved tocatalog.pyto prevent circular imports. (PR/170).extract_datasetdoesn't fail when a variable is in the dataset, but notvariables_and_freqs. (PR/185).- The argument
period, used in multiple function, is now always a single list, whileperiodsis more flexible. (GH/87, PR/192). - The parameters
reference_periodandsimulation_periodofxscen.trainandxscen.adjustwere renamedperiod/periodsto respect the point above. (GH/87, PR/192). ### Bug fixes - Forbid pandas v1.5.3 in the environment files, as the linux conda build breaks the data catalog parser. (GH/161, PR/162).
- Only return requested variables when using
DataCatalog.to_dataset. (PR/163). compute_indicatorsno longer crashes if less than 3 timesteps are produced. (PR/125).xarrayis temporarily pinned below v2023.3.0 due to an API-breaking change. (GH/175, PR/173).xscen.utils.unstack_fill_nan` can now handle datasets that have non dimension coordinates. (GH/156, PR/175).extract_datasetnow skips a simulation way earlier if the frequency doesn't match. (PR/170).extract_datasetnow correctly tries to extract in reverse timedelta order. (PR/170).compute_deltasno longer creates all NaN values if the input dataset is in a non-standard calendar. (PR/188). ### Internal changesxscennow manages packaging for PyPi and TestPyPI via GitHub workflows. (PR/159).- Pre-load coordinates in
extract.clisops_subset(PR/163). - Minimal documentation for templates. (PR/163).
xscenis now indexed in Zenodo, under theouranoscommunity of projects. (PR/164).- Added a few relevant Shields to the README.rst. (PR/164).
- Better warning messages in
_subset_file_coveragewhen coverage is insufficient. (PR/125). - The top-level Makefile now includes a
linkcheckrecipe, and the ReadTheDocs configuration no longer reinstalls thellvmlitecompiler library. (PR/173). - The checkups on coverage and duplicates can now be skipped in
subset_file_coverage. (PR/170). - Changed the
ProjectCatalogdocstrings to make it more obvious that it needs to be created empty. (GH/99, PR/184). - Added parseconfig to `creepfill
,creepweights, andreduceensemble` (PR/191).
- Python
Published by RondeauG almost 3 years ago
xscen - v0.5.0
Contributors to this version: Gabriel Rondeau-Genesse (@RondeauG), Juliette Lavoie (@juliettelavoie), Trevor James Smith (@Zeitsperre), Sarah Gammon (@sg2475962) and Pascal Bourgault (@aulemahal).
New features and enhancements
- Possibility of excluding variables read from file from the catalog produced by
parse_directory. (PR/107). - New functions
extract.subset_warming_levelandaggregate.produce_horizon. (PR/93). - add
round_vartoxs.clean_up. (PR/93). - New "timeoutcleanup" option for ``saveto_zarr
, which removes variables that were in the process of being written when receiving aTimeoutException``. (PR/106). - New
scripting.skippablecontext, allowing the use of CTRL-C to skip code sections. (PR/106). - Possibility of fields with underscores in the patterns of
parse_directory. (PR/111). - New
utils.show_versionsfunction for printing or writing to file the dependency versions ofxscen. (GH/109, PR/112). - Added previously private notebooks to the documentation. (PR/108).
- Notebooks are now tested using
pytestwithnbval. (PR/108). - New
restrict_warming_levelargument forextract.search_data_catalogsto filter dataset that are not in the warming level csv. (GH/105, PR/138). - Set configuration value programmatically through
CONFIG.set. (PR/144). - New
to_datasetmethod onDataCatalog. The same asto_dask, but exposing more aggregation options. (PR/147).
Breaking changes
- Functions that are called internally can no longer parse the configuration. (PR/133).
Bug fixes
clean_upnow converts the calendar of variables that use "interpolate" in "missingbyvar" at the same time.properties_and_measuresno longer casts month coordinates to string. (PR/106).search_data_catalogsno longer crashes if it finds nothing. (GH/42, PR/92).- Prevented fixed fields from being duplicated during
_dispatch_historical_to_future(GH/81, PR/92). - Added missing
parse_configto functions inreduce.py(PR/92). - Added deepcopy before
skipnais popped inspatial_mean(PR/92). subset_warming_levelnow validates that the data exists in the dataset provided (GH/117, PR/119).- Adapt
stack_drop_nanfor the newest version of xarray (2022.12.0). (GH/122, PR/126). - Fix
stack_drop_nannot working if intermediate directories don't exist (GH/128). - Fixed a crash when
compute_indicatorsproduced fixed fields (PR/139).
Internal changes
compute_deltasskips the unstacking step if there is no time dimension and cast object dimensions to string. (PR/9)- Added the "2sem" frequency to the translations CVs. (PR/111).
- Skip files we can't read in
parse_directory. (PR/111). - Fixed non-numpy-standard Docstrings. (PR/108).
- Added more metadata to package description on PyPI. (PR/108).
- Faster
search_data_catalogsandextract_datasetthrough a fasterDataCatalog.unique, date parsing and a rewrite of theensure_correct_timelogic. (PR/127). - The
search_data_catalogsfunction now acceptsstrorpathlib.Pathvariables (in addition to lists of either data type) for performing catalog lookups. (PR/121). produce_horizonsnow supports fixed fields (PR/139).- Rewrite of
unstack_datesfor better performance with dask arrays. (PR/144).
- Python
Published by Zeitsperre about 3 years ago
xscen - v0.4.0
v0.4.0 (2022-09-28)
Contributors to this version: Gabriel Rondeau-Genesse (@RondeauG), Juliette Lavoie (@juliettelavoie), Trevor James Smith (@Zeitsperre) and Pascal Bourgault (@aulemahal).
New features and enhancements
- New functions
diagnostics.properties_and_measures,diagnostics.measures_heatmapanddiagnostics.measures_improvement. (GH/5, PR/54). - Add argument
resample_methodstoxs.extract.resample. (GH/57, PR/57) - Added a ReadTheDocs configuration to expose public documentation. (GH/65, PR/66).
xs.utils.stack_drop_nans/xs.utils.unstack_fill_nanwill now format theto_file/coordsstring to add the domain and the shape. (GH/59, PR/67).- New unstack_dates function to "extract" seasons or months from a timeseries. (PR/68).
- Better spatial_mean for cases using xESMF and a shapefile with multiple polygons. (PR/68).
- Yet more changes to parse_directory: (PR/68).
- Better parallelization by merging the finding and name-parsing step in the same dask tree.
- Allow cvs for the variable columns.
- Fix parsing the variable names from datasets.
- Sort the variables in the tuples (for a more consistent output)
- In extractdataset, add option ``ensurecorrect_time`
to ensure the time coordinate matches the expected freq. Ex: monthly values given on the 15th day are moved to the 1st, as expected when asking for "MS". (:issue:53`). - In regrid_dataset: (PR/68).
- Allow passing skipna to the regridder kwargs.
- Do not fail for any grid mapping problem, includin if a grid_mapping attribute mentions a variable that doesn't exist.
- Default email sent to the local user. (PR/68).
- Special accelerated pathway for parsing catalogs with all dates within the datetime64[ns] range. (PR/75).
- New functions
reduce_ensembleandbuild_reduction_datato support kkz and kmeans clustering. (GH/4, PR/63). ensemble_statscan now loop through multiple statistics, support functions located inxclim.ensembles._robustness, and supports weighted realizations. (PR/63).- New function
ensemble_stats.generate_weightsthat estimates weights based on simulation metadata. (PR/63). - New function
catalog.unstack_idto reverse-engineer IDs. (PR/63). generate_idnow accepts Datasets. (PR/63).- Add
rechunkoption toproperties_and_measures(PR/76). - Add
createargument toProjectCatalog(GH/11, PR/77). - Add percentage deltas to
compute_deltas(GH/82, PR/90). ### Breaking changes statistics / stats_kwargshave been changed/eliminated inensemble_stats, respectively. (PR/63). ### Bug fixes- Add a missing dependencies to the env (
pyarrow, for faster string handling in catalogs). (PR/68). - Allow passing
compute=Falsetosave_to_zarr. (PR/68). ### Internal changes - Small bugfixes in
aggregate.py. (PR/55, PR/56). - Default method of
xs.extract.resamplenow depends on frequency. (GH/57, PR/58). - Bugfix for
_restrict_by_resolutionwith CMIP6 datasets (PR/71). - More complete check of coverage in
_subset_file_coverage. (GH/70, PR/72) - The code that performs
common_attrs_onlyinensemble_statshas been moved toclean_up. (PR/63). - Removed the default
to_levelinclean_up. (PR/63). xscennow has an official logo. (PR/69).- Use numpy max and min in
properties_and_measures(PR/76). - Cast catalog datestart and dateend to "%4Y-%m-%d %H:00" when writing to disk. (GH/83, PR/79)
- Skip test of coverage on the sum if the list of select files is empty. (PR/79)
- Added missing CMIP variable names in conversions.yml and added the ability to provide a custom file instead (GH/86, PR/88)
- Changed 'allowconversion' and 'allowresample' default to False in searchdatacatalogs (GH/86, PR/88)
- Python
Published by RondeauG over 3 years ago
xscen - v0.3.0
Contributors to this version: Gabriel Rondeau-Genesse (@RondeauG), Juliette Lavoie (@juliettelavoie), Trevor James Smith (@Zeitsperre) and Pascal Bourgault (@aulemahal).
New features and enhancements
- New function
clean_upadded. (GH/22, PR/24). parse_directory: Fixes toxr_open_kwargsand support for wildcards (*) in the directories. (PR/19).- New function
xscen.ensemble.ensemble_statsadded. (GH/3, PR/28). - New functions
spatial_mean,climatological_meananddeltasadded. (GH/4, PR/35). - Add argument
intermediate_reg_gridstoxscen.regridding.regrid. (GH/34, PR/39). - Add argument
moving_yearly_windowtoxscen.biasadjust.adjust. (PR/39). - Many adjustments to
parse_directory: better wildcards (GH/24), allow custom columns, fastpaths forparse_from_ds, and more (PR/30). - Documentation now makes better use of autodoc to generate package index. (PR/41).
periodsargument added tocompute_indicatorsto support datasets with jumps in time (PR/35). ### Breaking changes- Patterns in
parse_directorystart at the end of the paths indirectories. (PR/30). - Argument
extensionofparse_directoryhas been renamedglobpattern. (PR/30). - The
xscenAPI and filestructure have been significantly refactored. (GH/40, PR/41). The following functions are available from the top-level:adjust,train,ensemble_stats,clisops_subset,dispatch_historical_to_future,extract_dataset,resample,restrict_by_resolution,restrict_multimembers,search_data_catalogs,save_to_netcdf,save_to_zarr,rechunk,compute_indicators,regrid_dataset, andcreate_mask.
- xscen now requires geopandas and shapely (PR/35).
- Following a change in intake-esm xscen now uses "cat:" to prefix the dataset attributes extracted from the catalog. All catalog-generated attributes should now be valid when saving to netCDF. (GH/13, PR/51). ### Internal changes
parse_directory: Fixes toxr_open_kwargs. (PR/19).- Fix for indicators removing the 'time' dimension. (PR/23).
- Security scanning using CodeQL and GitHub Actions is now configured for the repository. (PR/21).
- Bumpversion action now configured to automatically augment the version number on each merged pull request. (PR/21).
- Add
align_on = 'year'argument in bias adjustment converting of calendars. (PR/39). - GitHub Actions using Ubuntu-22.04 images are now configured for running testing ensemble using
tox-conda. (PR/44). import xscensmoke test is now run on all pull requests. (PR/44).- Fix for
create_maskremoving attributes (PR/35).
- Python
Published by Zeitsperre over 3 years ago
xscen - v0.2.0
Contributors to this version: Gabriel Rondeau-Genesse (:user:RondeauG), Pascal Bourgault (:user:aulemahal), Trevor James Smith (:user:Zeitsperre), Juliette Lavoie (:user:juliettelavoie).
Announcements
- This is the first official release for xscen!
New features and enhancements
- Supports workflows with YAML configuration files for better transparency, reproducibility, and long-term backups.
- Intake_esm-based catalog to find and manage climate data.
- Climate dataset extraction, subsetting, and temporal aggregation.
- Calculate missing variables through Intake-esm's DerivedVariableRegistry.
- Regridding with xESMF.
- Bias adjustment with xclim.
Breaking changes
- N/A
Internal changes
- N/A
- Python
Published by RondeauG over 3 years ago