Recent Releases of xclim
xclim - v0.57.0
Contributors to this version: Éric Dupuis (@coxipi), Trevor James Smith (@Zeitsperre), Juliette Lavoie (@juliettelavoie), Pascal Bourgault (@aulemahal), Armin Hofmann (@HofmannGeo), Baptiste Hamon (@baptistehamon).
Announcements
- The
xclim.sdbamodule has been split fromxcliminto the new package xsdba. Users must installxsdbafromPyPIorconda-forgein order to maintainxclim.sdbafunctionality. Refer to the xsdba Migration Guide for more information. (GH/2074, PR/2099).
New indicators and features
- New indicator
xclim.atmos.clearness_indexcomputes theclearness_index(ratio of downwards solar radiation to extraterrestrial solar radiation). (PR/2140). - New conversion indice
xclim.indices.shortwave_downwelling_radiation_from_clearness_indexprovides the inverse ofxclim.indices.clearness_index. (PR/2140). - Added
cooling_degree_days_approximationandheating_degree_days_approximationindices to compute the number of cooling and heating degree days with consideration for daily temperature cycles. (GH/1941, PR/2135). - Added dtr in variables.yml. (GH/2146, PR/2147).
- Added Mahalanobis distance. (GH/2151, PR/2157).
- Support for
DataTreeobjects in indicators. All non-empty nodes of the tree must contain all required variables, non-variable parameters are the same for all nodes. (GH/2127, PR/2144). - Support for
DatasetandDataTreeobjects inxclim.core.units.convert_units_to. Target units are passed as a mapping from variable name to units. Unmentioned variables are left untouched. (GH/2127, PR/2144).
Bug fixes
- Adjustments were made to the
xclim[docs]installation recipe to ensure that the documentation builds correctly. The minimum required Python for rendering the documentation is now 3.11. (PR/2141). xclim.core.calendar.stack_periodswas fixed to work with larger-than-daily source timesteps. Users are still encouraged to useda.resample(time=FREQ).construct('period')when possible. (GH/2148, PR/2150).- Updated the
create_ensembledocstring to avoid confusion about how the function aligns realizations with different calendars. (GH/2108, PR/2164). - Fixed
xclim.indices.run_length.find_eventsfor multidimensional input using acftimecalendar. (PR/2172). xclim.ensembles.robustness_fractionswill now return '0' when all members are invalid (have missing values), avoiding faulty flags inrobustness_categories. The latter was also modified to read thevalidfraction and mask its output accordingly. (GH/2167, PR/2178).
Breaking changes
xclim.sdbais now a convenience mapping that importsxsdbamembers instead of being its own submodule. This implies a number of breaking changes (GH/2074, PR/2099, PR/2181):- The sub-module
xclim.sdbais no longer installed by default. Users must installxsdbaseparately usingpip install xclim[extras]or{pip|conda} install xsdba. - Units handling: The "infer" context is no longer used in unit conversion in
xclim.sdbafunctions. - The
SDBA_EXTRA_OUTPUTglobal option can no longer be activated withxclim.set_options; Instead usexsdba.set_optionswhere the option is now calledEXTRA_OUTPUT. - The other global variable
SDBA_ENCODE_CFwas removed as it has been rendered obsolete.
- The sub-module
- The previously deprecated functions
sfcwind_2_uas_vasanduas_vas_2_sfcwindhave been removed. (PR/2139). xclim.testing.open_datasethas been significantly modified and is now a thin wrapper for thenimbustesting data fetching class. It also no longer supports thedap_urlparameter. Contributors are encouraged to consult the documentation pertaining toxclim.testing.utils.nimbusfor the new approach to fetching testing data. (PR/2139).- The
xclim[dev]installation recipe now requirespytest-timeoutfor ending stalled tests. (PR/2176).
Internal changes
- Added a
pre-commithook for formatting BibTeX files and reformatted existing BibTeX files. (PR/2135). pre-commithooks have been updated to their latest versions. (PR/2141).- Updated a deprecated
pathlibusage in thexclimdocumentation that was causing failures under Python 3.13. (PR/2141). - Call signatures for most
oparguments inxclimhave been updated to use 'Literal' types instead of 'str'. This change is intended to improve type checking and code clarity. (GH/1810, PR/2168). - Changes to
pylintconfiguration and to address low-hangingpylintissues. (PR/2170). - The
pyproject.tomlfile has been adjusted to leveragepytest-timeoutwith a maximum session time of 15 minutes and a maximum test duration of five (5) minutes. (PR/2176). - Fixed a bug present in tests due to the
netcdf4engine found intest_wind.pythat was causing failures when run in parallel. (GH/2179, PR/2176). - Faster backend for run length computations where the time is unchunked.
xclim.indices.run_length._cumsum_resetwas rewritten to include the fast track which is called withxclim.indices.run_length._cumsum_reset_np. The slow track usesxclim.indices.run_length._cumsum_reset_xrwhich preserves all functionalities of the oldxclim.indices.run_length._cumsum_reset. (PR/2136).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre 7 months ago
xclim - v0.56.0
Contributors to this version: Trevor James Smith (@Zeitsperre), Hui-Min Wang (@Hem-W), Jack Kit-tai Wong (@jack-ktw), Adrien Lamarche (@LamAdr), Éric Dupuis (@coxipi), Jens de Bruijn (@jensdebruijn), Pascal Bourgault (@aulemahal), Sarah Gammon (@SarahG-579462).
New indicators
- Added standardized indicators for hydrology:
xclim.land.standardized_streamflow_indexandxclim.land.standardized_groundwater_index. (GH/1444, PR/1877).
Bug fixes
- Fix installation instructions in the Contributing guide. (GH/2088, PR/2089).
- Fixed parameter order in typing.cast() causing intermittent errors in solarzenithangle calculation. (GH/2097, PR/2098).
xclimnow uses theoperatorstandard library instead of usingxarray's derivedget_opfunction. A refactoring inxarrayhad changed the position ofget_opwhich caused breakage. (GH/2113, PR/2114).- All other uses of
xarray's internal API were also removed. (PR/2116).
- All other uses of
- Fixed an issue with star-annotated call signatures to maintain Python 3.10 compatibility. (PR/2116).
- Fixed
to_agg_unitsthat was converting units of temperature differences prematurely, without changing the values accordingly in the related DataArrays. (GH/2121, PR/2122). get_calendarnow supportspandas.DatetimeIndex.xclimno longer usesxarray.cftime_range, which has been deprecated. (PR/2130).- Avoid unnecessary time resampling in
xclim.indices.stats.preprocess_standardized_indexwhenfreqis notNonebut the same as the input data. (GH/2111, PR/2112). - Fixed an issue with
fire_seasonthat made it fail with datasets having non-uniform chunks. (GH/2129, PR/2132).
Breaking changes
xclimno longer supports Python 3.10. The minimum required version is now Python 3.11. (PR/2082).- Reverted: Extended support for Python3.10 will continue until further notice. (PR/2100).
- The minimum versions of several key dependencies have been raised (
numpy>=1.24.0;scikit-learn>=1.2.0;scipy>=1.11.0). (PR/2082). - To ensure consistent naming of converters, the following indices have been deprecated with replacements. Changes will be made permanent in
xclimv0.57.0. (GH/2039, PR/2117):sfcwind_2_uas_vas: Usesfcwind_to_uas_vasinstead.uas_vas_2_sfcwind: Useuas_vas_to_sfcwindinstead.
Internal changes
black,isort, andnbqahave all been dropped from the development dependencies. (GH/1805, PR/2082).ruffhas been configured to provide code formatting. (PR/2083):- The maximum line-length is now 120 characters.
- Docstring formatting is now enabled.
- Line endings in files now must be
Unix-compatible (LF).
- The
blackdocpre-commit hook now only examines.rstand.mdfiles. (PR/2083). - The
xclimdocumentation now has asupportpage for detailing the project's usage and version support policies. (PR/2100). - The indicator
heat_wave_indexnow useshot_spell_total_lengthindex. Theheat_wave_indexindex is identical tohot_spell_total_lengthand will be dropped in future versions. (GH/2031, PR/2102). - Updated pre-commit hooks to their latest versions. (PR/2116).
.. math::tags in documentation are now properly indented with three (3) spaces. (PR/2128).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre 9 months ago
xclim - v0.55.0
Contributors to this version: Juliette Lavoie (@juliettelavoie), Trevor James Smith (@Zeitsperre), Sascha Hofmann (@saschahofmann), Pascal Bourgault (@aulemahal), Éric Dupuis (@coxipi), Baptiste Hamon (@baptistehamon), Sarah Gammon (@SarahG-579462).
Breaking changes
- Missing value method "WMO" was modified to remove the criterion that the timeseries needs to be continuous (without holes). (PR/2058).
Announcements
xclimnow officially supports Python 3.13 (usingnumbav0.61.0). (GH/2022, PR/2054).xclimversion 0.55.0 will be the last version to support Python 3.10. The next version will require Python 3.11 or higher. (PR/2054).
New indicators
- Added
xclim.land.holiday_snow_daysto compute the number of days with snow on the ground during holidays ("Christmas Days"). (GH/2029, PR/2030). - Added
xclim.land.holiday_snow_and_snowfall_daysto compute the number of days with snow on the ground and measurable snowfall during holidays ("Perfect Christmas Days"). (GH/2029, PR/2030). - Added
xclim.atmos.vapor_pressure_deficitto compute the vapor pressure deficit from temperature and relative humidity. (GH/1917, PR/2072).
New features and enhancements
- New function
ensemble.partition.general_partition. (PR/2035). - Added a new
xclim.indices.generic.bivariate_count_occurrencesfunction to count instances where operations and performed and validated for two variables. (PR/2030). xclim.testing.helpers.test_timeseriesnow accepts acalendarargument that is forwarded toxr.cftime_range. (PR/2019).- New
xclim.indices.fao_allen98, exporting the FAO-56 Penman-Monteith equation for potential evapotranspiration (GH/2004, PR/2067). - Missing values method "pct" and "atleastn" now accept a new "subfreq" option that allows to compute the missing mask in two steps. When given, the algorithm is applied at this "subfreq" resampling frequency first and then the result is resampled at the target indicator frequency. In the output, a period is invalid if any of its subgroup where flagged as invalid by the chosen method. (PR/2058, GH/1820).
scipy.stats.rv_continuousinstances can now be given directly as thedistargument instandardized_precipitation_indexandstandardized_precipitation_evapotranspiration_indexindicators. This includeslmoments3distributions when specifyingmethod="PWM". (GH/2043, PR/2045).- Time selection in
xclim.core.calendar.select_timeand the**indexerargument of indicators now supports day-of-year bounds given as DataArrays with spatial and/or temporal dimensions. (GH/1987, PR/2055). - Maximum Spacing Estimation method for distribution fitting has been added to
xclim.indices.stats.fit(GH/2078, PR/2077)
Bug fixes
- Fixed a bug in
xclim.sdba.Grouper.get_indexthat didn't correctly interpolate seasonal values (GH/2014, PR/2019). - Fixed a bug where
xclim.indicators.atmos.potential_evapotranspirationwould return wrong results whenhurswas provided in%(PR/2067). - Fixed the default "op" argument of
xclim.atmos.growing_season_end(GH/2056, PR/2080). - Removed the useless "thresh" argument from
xclim.atmos.precip_accumulation(GH/1763, PR/2080).
Internal changes
- Adjusted the
TestOfficialYamltest to use a dynamic method for finding the installed location ofxclim. (PR/2028). - Adjusted two tests for better handling when running in Windows environments. (PR/2057).
- Refactor of the
xclim.core.missingmodule, usage of theMissingobjects has been broken. (PR/2058, PR/2055, PR/2076, GH/1820, GH/2000).- Objects are initialized with their options and then called with the data, input frequency, target frequency and indexer.
- Subclasses receive non-resampled DataArray in their
is_missingmethods. - Subclasses receive the array of valid timesteps
validinstead ofnull, the invalid ones. MissingWMOnow usesxclim.indices.helpers.resample_mapwhich should greatly improve performance in a dask context.
- There is now a warning stating that
fitkwargsare not employed when using thelmoments3distribution. One exception is the use of'floc'which is allowed with the gamma distribution.'floc'is used to shift the distribution before computing fitting parameters with thelmoments3distribution sinceloc=0is always assumed in the library. (GH/2043, PR/2045). xclimnow tracks energy usage and carbon emissions ("last run", "average", and "total") during CI workflows using theeco-ci-energy-estimationGitHub Action. (PR/2046).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre 10 months ago
xclim - v0.54.0
Contributors to this version: Trevor James Smith (@Zeitsperre), Pascal Bourgault (@aulemahal), Éric Dupuis (@coxipi), Sascha Hofmann (@saschahofmann).
New features and enhancements
- Python 3.9 coding conventions have been dropped in favour of Python 3.10+ conventions. (PR/1988).
xclim.indices.chill_unitnow accepts a new argumentpositive_onlyto compute the daily positive chill units. (PR/2003).
Breaking changes
- The minimum required version of
daskhas been increased to2024.8.1. (GH/1992, PR/1991). - The docstrings of many
xclimmodules, classes, methods, and functions have been slightly adjusted to ensure stricter compliance with establishednumpydocstring conventions. (PR/1988). - Using different time for
refandhistis now explicitly forbidden in many bias adjustment methods (e.g.EmpiricalQuantileMapping). Methods that combineref,hist, andsimin the samemap_groupsalso require that time arrays be equal in size. (GH/1903, PR/1995, PR/2013). xclimnow uses asrclayout for the codebase. Structure-dependent functions, documentation, and build commands have been adapted to reflect these changes. Developers will need to reinstallxclimusingpip install -e .. (PR/1971).- The call signature of
xclim.indices.hot_spell_magnitudeoriginally asked for anopargument that was not used. This argument has been removed. (PR/2018).
Bug fixes
- Fixed pickling issue with
xclim.sdba.Grouperand other classes for usage withdask>=2024.11. (GH/1992, PR/1993). - Fixed an issue with
nimbusthat was causing URL path components to be improperly joined. (PR/1997). base_kws_varsinMBCnis now copied inside theadjustfunction so that in-place changes do not change the dict globally. (PR/1999).- Fixed a bug in the logic of
xclim.testing.utils.load_registrythat impacted the ability to load aregistry.txtfrom a non-default repository. (PR/2001).
Internal changes
- Changed French translations with word "pluvieux" to "avec précipitations". (GH/1960, PR/1994).
- Nan values in
OTCanddOTCare only dropped and replaced at the lowest level so that the size of time arrays never changes onxarraylevels. (PR/1995, PR/2013) streamflowentry replaced with"q"invariables.yml. (GH/1912, PR/1996).- In order to address
Error 403(forbidden) requests when retrieving data from GitHub via ReadTheDocs, thenimbusclass has been modified to use an overloadedfetchmethod that appends a modified User-Agent header to the request. (PR/2001). - Addressed a very rare race condition that can happen if
pytestis tearing down the test environment when running across multiple workers. (PR/1863). - The
numpydoclinting tool has been added to the development dependencies, linting checks, and thepre-commitconfiguration. (PR/1988). - Added a more robust
yamllintconfiguration to ensure that all YAML files are linted consistently. (PR/1971). - Addressed a very rare singular matrix error that can happen in
test_loess_smoothing_nan. (PR/2015). - Addressed a handful of typing and call signature issues in the
xclimcodebase. (PR/2018).
CI changes
- Added the
green-coding-solutions/eco-ci-energy-estimationGitHub Action to the workflows to establish energy and carbon usage of CI activity. (PR/1863). - Various workflow security fixes: (PR/2023)
- Simplified the
bump-version.ymlversion string parsing to harden against template injection. - Further de-escalated privileges for most workflows.
- Simplified the
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre about 1 year ago
xclim - v0.53.2
Contributors to this version: Éric Dupuis (@coxipi), Pascal Bourgault (@aulemahal), Trevor James Smith (@Zeitsperre).
Breaking changes
- Due to a regression affecting symmetry of
polyfitandpolyvalinxarray,xclimnow requiresxarray>=2023.11.0,!=2024.10.0(see: pydata/xarray PR/9691). (PR/1978).
Bug fixes
- Fixed a bug where the units could be changed before a conversion of the magnitudes could occur. Conversion of units for multivariate
DataArrayis now properly handled insdba.TrainAdjustandsdba.Adjust. (PR/1972). - Fixed a units formatting bug with indicators that output "delta" Celsius degrees. (PR/1973).
- Corrected the
"choices"of parameteropin the docstring offrost_free_spell_max_length. (PR/1977). - Reorganised how
Indicatorsubclasses can be added arguments to the call signature. Injecting such arguments now works. Forxclim's subclasses, this bug only affected theindexerargument of indicators subclassingxc.core.indicator.IndexingIndicator. (PR/1981). - All-nan slices are now treated correctly in method
ExtremeValues. (GH/1982, PR/1983).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre about 1 year ago
xclim - v0.53.1
Contributors to this version: Trevor James Smith (@Zeitsperre).
Internal changes
- Fixed a few missing dependencies in the documentation build recipe that were causing errors in the CI workflow on ReadTheDocs. (PR/1970).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre about 1 year ago
xclim - v0.53.0
Contributors to this version: Adrien Lamarche (@LamAdr), Trevor James Smith (@Zeitsperre), Éric Dupuis (@coxipi), Pascal Bourgault (@aulemahal), Sascha Hofmann (@saschahofmann), David Huard (@huard).
Announcements
xclimhas now adopted the Scientific Python SPEC 0 conventions for its suggested dependency support schedule. (GH/1914, PR/1915).xclimhas dropped support for Python 3.9 and adopted Python 3.10+ code styling conventions. (GH/1914, PR/1915).
New indicators
- New
heat_spell_frequency,heat_spell_max_lengthandheat_spell_total_length: spell length statistics on a bivariate condition that uses the average over a window by default. (PR/1885, PR/1778). - New
hot_spell_max_magnitude: yields the magnitude of the most intensive heat wave. (PR/1926). - New
chill_portionandchill_unit: chill portion based on the Dynamic Model and chill unit based on the Utah model indicators. (GH/1753, PR/1909). - New
water_cycle_intensity: yields the sum of precipitation and actual evapotranspiration. (GH/410, PR/1947).
New features and enhancements
- New generic
xclim.indices.generic.spell_maskthat returns a mask of which days are part of a spell. Supports multivariate conditions and weights. Used in new generic indexxclim.indices.generic.bivariate_spell_length_statisticsthat extendsspell_length_statisticsto two variables. (PR/1885). - Indicator parameters can now be assigned a new name, different from the argument name in the compute function. (PR/1885).
- Add attribute
units_metadatato outputs representing a difference between temperatures. This is needed to disambiguate temperature differences from absolute temperature. Changes affect indicatorsdaily_temperature_range,daily_temperature_range_variability,extreme_temperature_range,interday_diurnal_temperature_range, and all degree-day indicators. Implemented using a newpint2cfattrsfunction to convert pint units to a dictionary of CF attributes.units2pintis also modified to supportunits_metadataattributes in DataArrays. Some SDBA properties and measures previously returning units ofdelta_degCwill now return the original input DataArray units accompanied with theunits_metadataattribute. (GH/1822, PR/1830). xclim.indices.run_length.windowed_max_run_sumaccumulates positive values across runs and yields the maximum valued run. (PR/1926).- Helper function
xclim.indices.helpers.make_hourly_temperatureto estimate hourly temperatures from daily min and max temperatures. (PR/1909). - New global option
resample_map_blocksto wrap allresample().map()code inside axr.map_blocksto lower the number of dask tasks. Uses utilityxclim.indices.helpers.resample_mapand requiresfloxto ensure the chunking allows such block-mapping. Defaults to False. (PR/1848). xclim.indices.run_length.runs_with_holesallows to input a condition that must be met for a run to start and a second condition that must be met for the run to stop. (PR/1778).- New generic compute function
xclim.indices.generic.thresholded_eventsthat finds events based on a threshold condition and returns basic stats for each. See also:xclim.indices.run_length.find_events. (PR/1778). xclim.core.units.rate2amountandxclim.core.units.amount2ratecan now also accept quantities (pint objects or strings), in which case thedimargument must be thetimecoordinate through which we can find the sampling rate. (PR/1778).xclim.indices.stats.standardized_indexnow supports a weekly resampling frequency. Only "standard" calendars usingnumpy'sdatetime64dtype are supported for this mode. (GH/1892, PR/1952)
Bug fixes
- Fixed
rate2amountandamount2ratefor sub-daily frequencies. (GH/1962, PR/1963). - Added the liquid water equivalent thickness ("[length]") to amount ("[mass]/[area]") transformation to the
hydrocontext (the inverse operation was already there). (PR/1963). - Fixed a small inefficiency in
_otc_adjust, and thestandardizemethod ofOTC/dOTCis now applied on individual variable. (PR/1890, PR/1896). - Removed deprecated cells in the tutorial notebook
sdba.ipynb. (PR/1895).
Breaking changes
platformdirsis no longer a direct dependency ofxclim, butpoochis required to use many of the new testing functions (installable viapip install poochorpip install 'xclim[dev]'). (PR/1889).- The following previously-deprecated functions have now been removed from
xclim:xclim.core.calendar.convert_calendar,xclim.core.calendar.date_range,xclim.core.calendar.date_range_like,xclim.core.calendar.interp_calendar,xclim.core.calendar.days_in_year,xclim.core.calendar.datetime_to_decimal_year. For guidance on how to migrate to alternatives, see the version 0.50.0 Breaking changes. (GH/1010, PR/1845). - The
transformargument ofOTC/dOTCclasses (and child functions) has been changed tonormalization, andnumIterMaxhas been changed tonum_iter_maxinxclim.core.utils.optimal_transport(PR/1896). xclimnow requiresnumpy >=1.23.0andscikit-learn >=1.1.0, as well as (optionally)ipython >=8.5.0,nbsphinx >=0.9.5, andmatplotlib >=3.6.0. (GH/1914, PR/1915).
Internal changes
- The
Ouranosinc/xclim-testdatarepository has been restructured for better organization and to make better use ofpoochand data registries for testing data fetching (see: xclim-testdata PR/29). (PR/1889). - The
xclim.testingmodule has been refactored to make use ofpoochwith file registries. Several testing functions have been removed as a result: (PR/1889)xclim.testing.utils.open_datasetnow uses apoochinstance to deliver locally-stored datasets. Its call signature has also changed.xclimnow accepts more environment variables to control the behaviour of the testing setup functions. These includeXCLIM_TESTDATA_BRANCH,XCLIM_TESTDATA_REPO_URL, andXCLIM_TESTDATA_CACHE_DIR.xclim.testing.utils.get_file,xclim.testing.utils.get_local_testdata,xclim.testing.utils.list_datasets, andxclim.testing.utils.file_md5_checksumhave been removed.xclim.testing.utils.nimbusreplaces much of this functionality. See thexclimdocumentation for more information.
- Many tests focused on evaluating the normal operation of remote file access tools under
xclim.testinghave been removed. (PR/1889). - Setup and teardown functions that were found under
tests/conftest.pyhave been optimised to reduce redundant calls when runningpytest xclim. Some obsoletepytestfixtures have also been removed. (PR/1889). - Many
DeprecationWarningandFutureWarningmessages emitted fromxarrayandpinthave been addressed. (GH/1719, PR/1881). - The code base has been adjusted to address many
pylint-related warnings and errors. In some cases,castingwas used to redefine somenumpyandxarrayobjects. (GH/1719, PR/1881). xclim.corenow uses absolute imports for clarity and some objects commonly used in the module have been moved to hidden submodules. (GH/1719, PR/1881).xclim.core.indicator.Parameterhas a new attributecompute_namewhilexclim.core.indicator.Indicatorlost its_variable_mapping. The translation from parameter (and variable) names in the indicator to the names on the compute function is now handled byIndicator._get_compute_args. (PR/1885).- Adopted many linting and formatting suggestions from the Scientific Python repo-review tool: (PR/1910)
- Applied several linting suggestions adopted by the
scipycommunity. - Replaced
isortwithruff-based import-sorting formatting. - Added formatting for
Markdownfiles. - Added the
bugbear,pyupgradechecks to theruffformatter. - Adjusted
mypychecks to be more standardized.
- Applied several linting suggestions adopted by the
- Renamed annual deprecated frequency alias
"A"to"Y"(PR/1930). - The
indicesdocumentation now includes the members ofxclim.indices.stats. (GH/1913, PR/1958). - The default URL for fetching testing data is now set to the
raw.githubusercontent.commirror ofxclim-testdata. (PR/1961). - The
upstreamtoxenvironment has been updated to not install the latestnumpyuntilnumbasupports it. (PR/1961).
CI changes
- The
pipcache,toxenvironments, and thexclim-testdatacache are now saved between workflow runs (usingactions/cache) to reduce the time spent installing dependencies and downloading testing data. (PR/1906).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre about 1 year ago
xclim - v0.52.2
Contributors to this version: Pascal Bourgault (@aulemahal).
Bug fixes
- Fixed
decimal_yearimport, fixed functionsrate2amount,amount2rate,time_bndsandstack_periodsforxarrayversion 2024.09.0. Removeddatetime_to_decimal_yearas the mirroredxarrayfunction was replaced byds.time.dt.decimal_year. (PR/1920).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 1 year ago
xclim - v0.52.1
Contributors to this version: Trevor James Smith (@Zeitsperre).
Bug fixes
- Adjusted the required base version of
pyarrowto bev10.0.1to address an environment resolution error on conda-forge. (PR/1918).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 1 year ago
xclim - v0.52.0
Contributors to this version: David Huard (@huard), Trevor James Smith (@Zeitsperre), Hui-Min Wang (@Hem-W), Éric Dupuis (@coxipi), Sarah Gammon (@SarahG-579462), Pascal Bourgault (@aulemahal), Juliette Lavoie (@juliettelavoie), Adrien Lamarche (@LamAdr).
Announcements
xclimnow supports bothnumpyversions>=1.20and>=2.0. (GH/1785, PR/1814, PR/1870).xclimnow needscf_xarray>=0.9.3but continues to support older versions ofpint(<0.24) for compatibility reasons. (PR/1870).
New features and enhancements
xclim.sdba.nbutils.quantileand its child functions are now faster. If thefastnanquantilelibrary is installed, it is used as the backend for the computation of quantiles and yields even faster results. This dependency is now listed in thexclim[extras]recipe. (GH/1255, PR/1513).- New multivariate bias adjustment class
MBCn, giving a faster and more accurate implementation of theMBCnalgorithm. (GH/1551, PR/1580). - New multivariate bias adjustment classes
OTCanddOTC. Requires thePOTlibrary which can be installed via thexclim[extras]recipe. (PR/1787). xclimis now compatible withpytestversions>=8.0.0. (PR/1632).
Breaking changes
- As of
cf_xarray>=0.9.3, dimensionless quantities now use the"1"units attribute as specified by the CF conventions, previously an empty string was returned. (PR/1814). - The definitions of the
frost_free_season_startandfrost_free_season_endhave been slightly changed to be coherent with thefrost_free_season_lengthandxclim's notion ofseasonin general. Indicator and indices signature have been adapted to the new conventions. (PR/1845). - Season length indicators have been modified to return
0for all cases where a proper season was not found, but the data is valid. Previously, ananwas given if neither a start nor an end were found, even if the data was valid, and a0was given if an end was found but without a valid start. (PR/1845).
Bug fixes
- Fixed the indexer bug in the
xclim.indices.standardized_index_fit_paramswhen multiple or non-array indexers are specified and fitted parameters are reloaded from netCDF. (GH/1842, PR/1843). - Addressed a bug found in
wet_spell_*indicators that was contributing to erroneous results. A new generic spell length statistic function (xclim.indices.generic.spell_length_statistics) is now used in wet and dry spells indicators. (GH/1834, PR/1838). - Syntax for
nanandinfwas adapted to supportnumpy>=2.0. (PR/1814, GH/1785). - The type in
jitternow works with modern version ofdask(>=2024.8.0). (PR/1864).
Internal changes
- Changed the French translation of "wet days" from "jours mouillés" to "jours pluvieux". (GH/1825, PR/1826).
- In order to adapt to changes in
pytest, the doctest fixtures have been split from the main testing suite and doctests are now run using$ python -c 'from xclim.testing.utils import run_doctests; run_doctests()'. (PR/1632). toxhas been reconfigured to run doctests in a separate environment (tox -e doctests). (PR/1632).- Added
xclim.indices.generic.seasonto make season start, end, and length indices. Added astatargument toxclim.indices.run_length.seasonto avoid returning a dataset. (PR/1845).
CI changes
pip-tools(pip-compile) has been used to generate a lock file with hashes for the CI dependencies. (PR/1841).- The
main.ymlworkflow has been updated to use simpler trigger logic. (PR/1841). - A workflow bug has been fixed that was causing multiple duplicate comments to be made on Pull Requests originating from forks. (PR/1841).
- The
upstream.ymlworkflow was adapted to not install upstream Python dependencies using hashes (as it is impossible to install directly from GitHub sources using--require-hashes). (PR/1859). - The
tox-ghconfiguration has been set to handle the environment configurations on GitHub Workflows. The tox.ini file is also a bit more organized/consistent. (PR/1859).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 1 year ago
xclim - v0.51.0
Contributors to this version: Trevor James Smith (@Zeitsperre), Pascal Bourgault (@aulemahal).
New features and enhancements
- Added the
opkeyword to thegrowing_season_{start|end}indices and indicators, allowing for customizable threshold operators usingindices.generic.compare(). (GH/1794, PR/1796). xclimnow separates the optional dependencies intodevanddocsrecipes. Both can be installed with thealloption ($ python -m pip install xclim[all]). (PR/1806).
Bug fixes
- Units of degree-days computations with Fahrenheit input fixed to yield "°R d". Added a new
xclim.core.units.ensure_absolute_temperaturemethod to convert from delta to absolute temperatures. (GH/1789, PR/1804). - Clarified a typo in the docstring formula for
xclim.indices.growing_season_length. (PR/1796).
Internal changes
netcdf4has been pinned below v1.7 for test stability reasons. (PR/1791).flake8-bandit-like checks have been enabled viaruff, with fixes for a few security-related issues. (PR/1806).xclim.testing.utilsnow employs more secure URL auditing checks. (PR/1806).CHANGES.rsthas been renamed toCHANGELOG.rst, adhering to suggestions from the keepachangelog v.1.1.0 specifications. (PR/1823).
CI changes
- GitHub repository now uses Rulesets for branch protection. (PR/1790).
- Version bumping and project triage is now handled by the Ouranos Helper GitHub App. (PR/1790).
bump-my-versionhas been updated to v0.23.0. (PR/1790).- The Ouranos Helper GitHub App now provides verified commits. (GH/1811, PR/1812).
- Added the deptry package to the
devlinter tools and linting workflows for performing dependency analyses. (PR/1806). - Several linting tools have been updated to the latest versions and pinned. (PR/1806).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 1 year ago
xclim - v0.50.0
Contributors to this version: Trevor James Smith (@Zeitsperre), Éric Dupuis (@coxipi).
New features and enhancements
- New properties: Bivariate Spell Length (
xclim.sdba.properties.bivariate_spell_length), Generalized Spell Lengths with an argument forwindow, and Specific Spell Lengths withwindowfixed to '1' (xclim.sdba.properties.threshold_count,xclim.sdba.properties.bivariate_threshold_count). (PR/1758). - New option
normalizeinsdba.measures.taylordiagramto obtain normalized Taylor Diagrams (divide standard deviations by standard deviation of the reference). (PR/1764).
Breaking changes
pinthas been pinned below v0.24 untilxclimcan be updated to support the latest version. (GH/1771, PR/1772).numpyhas been pinned below v2.0.0 untilxclimcan be updated to support the latest version. (PR/1783).- Calendar utilities that have an equivalent in
xarrayhave been deprecated and will be removed inxclimv0.51.0. (GH/1010, PR/1761). This concerns the following members ofxclim.core.calendar:convert_calendar: UseDataset.convert_calendar,DataArray.convert_calendarorxr.coding.calendar_ops.convert_calendarinstead.- If your code passes
targetas an array, first convert the source to the target's calendar and then reindex the result totarget. - If you were using the
doy=Trueoption, replace it withxc.core.calendar.convert_doy(source, target_cal).convert_calendar(target_cal). "default"is no longer a valid calendar name for any xclim functions and will not be returned byget_calendar. Xarray has ause_cftimeargument, xclim exposes it when the distinction is needed.
- If your code passes
date_range: Usexarray.date_rangeinstead.date_range_like: Usexarray.date_range_likeinstead.interp_calendar: UseDataset.interp_calendarorxarray.coding.calendar_ops.interp_calendarinstead.days_in_year: Usexarray.coding.calendar_ops._days_in_yearinstead.datetime_to_decimal_year: Usexarray.coding.calendar_ops._datetime_to_decimal_yearinstead.
Internal changes
- Synchronized tooling versions across
pyproject.tomlandtox.iniand pinned them to the latest stable releases in GitHub Workflows. (PR/1744). - Fixed a few small spelling and grammar issues that were causing errors with
codespell. Now ignoringSVGfiles. (PR/1769). - Temporarily skipping the
test_hawkins_sutton_smoketest due to strange behaviour withxarray. (PR/1769). - Fixed some previously uncaught errors raised from recent versions of
pylintandcodespell. (PR/1772). - Set the
doctestexamples to all useh5netcdfwith worker-separated caches to load datasets. (PR/1772).
Bug fixes
xclim.indices.{cold|hot}_spell_total_lengthnow properly uses the argumentwindowto only count spells with at leastwindowtime steps. (GH/1765, PR/1777).- Addressed an error in
xclim.ensembles._filters._concat_histwhere remnants of a scenario selection were not being dropped properly. (PR/1780).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 1 year ago
xclim - v0.49.0
Contributors to this version: Trevor James Smith (@Zeitsperre), Pascal Bourgault (@aulemahal), Juliette Lavoie (@juliettelavoie), David Huard (@huard), Gabriel Rondeau-Genesse (@RondeauG), Javier Diez-Sierra (@JavierDiezSierra), Sarah Gammon (@SarahG-579462), Éric Dupuis (@coxipi).
Announcements
New features and enhancements
- Indicator
xclim.atmos.potential_evapotranspirationand indicexclim.indices.potential_evapotranspirationnow accept a new value (DA02) for argumentmethodimplementing potential evapotranspiration based on Droogers and Allen (2002). (GH/1710, PR/1723). - The documentation now uses the furo theme for Sphinx. This theme supports native "light" and "dark" modes, adaptive screen resolution, as well as provides a better navigation layout for pages housing long lists of entries (e.g.
indices). (GH/1693, PR/1731). xclim.ensembles.ensemble_percentilesnow takes amethodargument, accepting one of:'interpolated_inverted_cdf','hazen','weibull','linear'(default),'median_unbiased', or'normal_unbiased'. (GH/1694, PR/1732).- Distributions with negative values are directly fitted without need for an offset for distributions such as
'gamma'and'fisk'inxclim.indices.standardized_precipitation_evapotranspiration_index. (GH/1477 PR/1720). xclim.indices.stats_fit_startgives an estimate of thelocparameter for'gamma'and'fisk'distributions. (GH/1477 PR/1720).
New indicators
- New
snw_season_lengthandsnd_season_lengthcomputing the duration between the start and the end of the snow season, both defined as the first day of a continuous period with snow above/under a threshold. Previous versions of these indicators were renamedsnw_days_aboveandsnd_days_aboveto better reflect what they computed : the number of days with snow above a given threshold (with no notion of continuity). (GH/1703, PR/1708). - Added
xclim.atmos.duff_moisture_code, part of the Canadian Forest Fire Weather Index System. It was already an output of thexclim.atmos.cffwis_indices, but now has its own standalone indicator. (GH/1698, PR/1712).
Breaking changes
- The previously deprecated functions
xclim.sdba.processing.construct_moving_yearly_windowandxclim.sdba.processing.unpack_moving_yearly_windowhave been removed. These functions have been replaced byxclim.core.calendar.stack_periodsandxclim.core.calendar.unstack_periods. (PR/1717). - The previously deprecated function
xclim.ensembles.change_significancehas been removed. (PR/1737). - Indicators
snw_season_lengthandsnd_season_lengthhave been modified. (GH/1703, PR/1708). - The
'hargeaves85'/'hg85'method for thepotential_evapotranspirationindicator and indice has been modified for precision and consistency with recent academic literature. (GH/1710, PR/1723). - The
__getitem__method ofxclim.core.indicator.Parameterinstances has been removed. Accessing members ofParametersnow uniquely uses dot notation. (PR/1721). - The obsolete function wrapper for generating Indicators
xclim.core.utils.wrapped_partialhas been removed. (PR/1721). - The default documentation theme has changed from
sphinx-rtd-themetofuro; Several modifications to the documentation configuration and CSS overrides have been made to accommodate the changes.furois now adocsdependency. (GH/1693, PR/1731). - Estimation of parameters using
_fit_startforgammaandfiskhas been changed and can affect the results obtained with full-fledged (e.g. "ML") methods. (GH/1477 PR/1720). - Method
APPinxclim.indices.standardized_precipitation_indexandxclim.indices.standardized_precipitation_evapotranspiration_indexnow requires the user to impose alocparameter throughfitkwargs['floc']. (GH/1477, PR/1720). - Zero inflated distributions used in
xclim.stats.standardized_indexnow appropriately use the probability of zeroes in the calibration data and not the entire dataset. (GH/1477 PR/1720).
Bug fixes
- Fixed a bug in
sdba'smap_groupsthat prevented passing DataArrays with cftime coordinates if thesdba_encode_cfoption was'True'. (GH/1673, PR/1674). - Fixed bug in
sdbawhere a loaded training dataset could not be used for adjustment. (GH/1678, PR/1679). - Fixed bug with loess smoothing for an array full of NaNs. (PR/1699).
- Fixed and adapted
time_bndsto the newest xarray. (PR/1700). - Fixed "agreement fraction" in
robustness_fractionsto distinguish between negative change and no change. Added "negative" and "changed negative" fractions (GH/1690, PR/1711). make_criterianow skips columns with NaNs across all realizations. (PR/1713).- Fixed bug where
QuantileDeltaMappingadjustment was failing for seasonal grouping. (GH/1704, PR/1716). - The codebase has been adjusted to address several (~400)
mypy-related errors attributable to inaccurate function call signatures and variable name shadowing. (GH/1719, PR/1721). xclim.core.formatting.generate_indicator_docstringhas been modified to ensure that thenumpy-docstrings of all Indicators are consistent in their formatting. (PR/1731).- Fixed documentation example for frequency adaptation with
sdba. (GH/1740, PR/1742).
Internal changes
- Added "doymin" and "doymax" to the possible operations of
generic.stats. Fixed a warning issue whenopwas "integral". (PR/1672). - Reorganized GitHub CI build matrices to run the doctests more consistently. (PR/1709).
- Removed the experimental
numbaandllvmdependency installation steps in thetox.inifile. Addednumba@mainto the upstream dependencies. (PR/1709). - Added the
tox-ghdependency to the development installation recipe. This will soon be required for running thetoxtest ensemble on GitHub Workflows. (PR/1709). - Added the
vulturestatic code analysis tool for finding dead code to the development dependency list and linters (makefile, tox and pre-commit hooks). (PR/1717). - Added error message when using
xclim.indices.stats.dist_methodwithnnlfand included note in docstring. (GH/1683, PR/1714). - PEP8 rule
N802is now enabled in theruffformatter. Function names should follow Snake case, with rare exceptions. (PR/1721). - Linting dependencies have been updated to the latest versions and made consistent across
environment.yml,pyproject.tomlandtox.inifiles. (PR/1717). - Code styling for the documentation now uses
sas("light" theme) andlightbulb("dark" theme) in order to ensure adequate contrast for code blocks. (PR/1731). - Added several CSS overrides related to the HTML elements generated by
xarrayin the notebook-sourced documentation. (PR/1731).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 1 year ago
xclim - v0.48.2
Contributors to this version: Juliette Lavoie (@juliettelavoie).
Bug fixes
- Add
measureto YAML validation schema (for building sdba properties) and allow skipping the YAML validation when building modules. (PR/1664).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre almost 2 years ago
xclim - v0.48.1
Contributors to this version: Trevor James Smith (@Zeitsperre).
Bug fixes
- Fixed an issue with missing
condadependencies in thexclimdocumentation. (PR/1657). - Adjusted the Mastodon publishing workflow. (PR/1657).
- Pinned
nbconvertto address regressions when building the documentation. (PR/1658).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre almost 2 years ago
xclim - v0.48.0
Contributors to this version: Juliette Lavoie (@juliettelavoie), Pascal Bourgault (@aulemahal), Trevor James Smith (@Zeitsperre), David Huard (@huard), Éric Dupuis (@coxipi), Dante Castro (@profesorpaiche), Gabriel Rondeau-Genesse (@RondeauG).
Announcements
xclimno longer supports Python3.8. (GH/1268, PR/1565).xclimnow officially supports Python3.12 (requiresnumba>=0.59.0). (PR/1613).xclimnow adheres to theSemantic Versioning 2.0.0 <https://semver.org/>_ specification. (GH/1556, PR/1569).- The
xclimrepository now uses GitHub Discussions to offer help for users, coordinate translation efforts, and support general Q&A for thexclimcommunity. ThexclimGitterroom has been deprecated in favour of GitHub Discussions. (GH/1571, PR/1572). - For secure correspondence,
xclimnow offers a PGP key for users to encrypt sensitive communications. For more information, see theSECURITY.md. (GH/1181, PR/1604).
New features and enhancements
- Added uncertainty partitioning method
lafferty_sriverfrom Lafferty and Sriver (2023), which can partition uncertainty related to the downscaling method. (GH/1497, PR/1529). - Validate YAML indicators description before trying to build module. (GH/1523, GH/1595, PR/1560, PR/1596, PR/1600).
- Support
indexerkeyword in YAML indicator description. (GH/1522, PR/1561). - New
xclim.core.calendar.stack_periodsandunstack_periodsfor performingrolling(time=...).construct(..., stride=...)but with non-uniform temporal periods like years or months. They replacexclim.sdba.processing.construct_moving_yearly_windowandunpack_moving_yearly_windowwhich are deprecated and will be removed in a future release. - New
as_datasetoptions forxclim.set_options. When True, indicators will output Datasets instead of DataArrays. (GH/1257, PR/1625). - Added new option for
universal_thermal_climate_indexcalculation (wind_cap_min: bool) to cap low wind velocities to a minimum of 0.5 m/s following Bröde (2012) guidelines. (GH/1634, PR/1635). - Added option
never_reachedtodegree_days_exceedance_dateto assign a custom value when the sum threshold is never reached. (GH/1459, PR/1647). - Added option
min_membersto ensemble statistics to mask elements when the number of valid members is under a threshold. (GH/1459, PR/1647). - Distribution instances can now be passed to the
distargument of most statistical indices. (PR/1644). - Added a new
xclim.indices.generic.select_rolling_resample_opfunction to allow for computing rolling statistics. (GH/1480, PR/1643). - Add the possibility to use a group with a window in
xc.sdba.processing.reordering. (PR/1566).
Breaking changes
xclimbase Python version has been raised to Python3.9. Python3.9+ coding conventions are now supported. (GH/1268, PR/1565).xclimbase dependencies have been raised topandas>=2.2.0andxarray>=2023.11.0to reflect changes to time frequency codes introduced inpandas==2.2.0. (GH/1534, PR/1565; see also:pydata/xarray GH/8394 <https://github.com/pydata/xarray/issues/8394>_ and ). Many default frequency string outputs have been modified (:- 'Y' (year) -> 'YE' (year end). (see:
pandas PR/55792 <https://github.com/pandas-dev/pandas/pull/55792>_). - 'M' (month) -> 'ME' (month end). (see:
pandas PR/52064 <https://github.com/pandas-dev/pandas/pull/52064>_). - 'Q' (quarter) -> 'QE' (quarter end). (see:
pandas PR/55553 <https://github.com/pandas-dev/pandas/pull/55553>_) - 'A' and 'AS' have been removed (use 'YE' and 'YS' instead). (see:
pandas PR/55252 <https://github.com/pandas-dev/pandas/pull/55252>_). ('YE' is only supported for cftime data inxarray >= 2024.1.1). - 'T' (minute), 'L' (millisecond), 'U' (microsecond), and 'N' (nanosecond) -> 'min', 'ms', 'us', and 'ns'. (see:
pandas PR/54061 <https://github.com/pandas-dev/pandas/pull/54061>_).
- 'Y' (year) -> 'YE' (year end). (see:
bump2versionhas been replaced withbump-my-versionto bump the version number using configurations set in thepyproject.tomlfile. (GH/1557, PR/1569).xclim's units registry and units formatting are now extended fromcf-xarray. The exponent sign "^" is now never added in theunitsattribute. For example, square meters are given as "m2" instead of "m^2" byxclim. Both signs are still accepted as inputs. (GH/1010, PR/1590).yamaleis now listed as a core dependency (was previously listed in thedevinstallation recipe). (GH/1595, PR/1596).- Due to a licensing limitation, the calculation of empirical orthogonal function based on
eofs(xclim.sdba.properties.first_eof) has been removed fromxclim. (GH/1620, PR/1621). blackformatting style has been updated to the 2024 stable conventions.isorthas been added to thedevinstallation recipe. (PR/1626).- The indice and indicator for
winter_stormhas been removed (deprecated sincexclim>=0.46.0in favour ofsnd_storm_days). (PR/1565). xclimhas dropped support forscipyversions below v1.9.0 andnumpyversions below v1.20.0. (PR/1565).- For generic function
select_resample_opandcore.units.to_agg_units, operation "sum" will now return the same units as the input, and not implicitly be translated to an "integral". (GH/1645, PR/1649). lmoments3was removed as a dependency ofxclimdue to incompatible licensing (GPLv3 vsxclim's Apache 2.0). Depending on the outcome of efforts to modify the licensing oflmoments3, this change may eventually be reverted. SeeOuranosinc/lmoments3#12 <https://github.com/Ouranosinc/lmoments3/issues/12>_. See also the "frequency analysis" notebook for an example on how to continue using the probability weighted moments method for fitting distributions. (GH/1620, PR/1644).
Bug fixes
- Fixed passing
missing=0toxclim.core.calendar.convert_calendar. (GH/1562, PR/1563). - Fixed wrong
windowattributes inxclim.indices.standardized_precipitation_index,xclim.indices.standardized_precipitation_evapotranspiration_index. (GH/1552 PR/1554). - Fixed the daily case
freq='D'forxclim.stats.preprocess_standardized_index(GH/1602 PR/1607). - Several spelling mistakes have been corrected within the documentation and codebase. (PR/1576).
- Added missing
xclim.ensembles.robustness_fractionsandxclim.ensembles.robustness_categoriesin API doc section. (PR/1630). - Fixed an issue that can occur when fetching the testing data and running tests on Windows systems. Adapted a few existing tests for Windows support. (PR/1648).
Internal changes
- The
flake8configuration has been migrated fromsetup.cfgto.flake8;setup.cfghas been removed. (PR/1569) - The
bump-version.ymlworkflow has been adjusted to bump thepatchversion when the last version is determined to have been areleaseversion; otherwise, thebuildversion is bumped. (GH/1557, PR/1569). - The GitHub Workflows now use the
step-security/harden-runneraction to monitor source code, actions, and dependency safety. All workflows now employ more constrained permissions rule sets to prevent security issues. (PR/1577, PR/1578, PR/1597). - Updated the
CONTRIBUTING.rstdirections to showcase the new versioning system. (GH/1557, PR/1573). - The
codespelllibrary is now a development dependency for thedevinstallation recipe with configurations found withinpyproject.toml. This is also now a linting step and integrated as apre-commithook. For more information, see the codespell documentation (PR/1576). - Climate indicators search page now prioritizes the "official" indicators (atmos, land, seaIce and generic), virtual submodules can be added to search through checkbox option. (GH/1559, PR/1593).
- The OpenSSF StepSecurity bot has contributed some changes to the workflows and pre-commit. (GH/1181, PR/1606):
- Dependabot has been configured to monitor the
xclimrepository for dependency updates. Theactions-version-updater.ymlworkflow has been deprecated. - GitHub Actions are now pinned to their commit hashes to prevent unexpected changes in the future.
- A new GitHub Workflow (
workflow-warning.yml) has been added to warn maintainers when a forked repository has been used to open a Pull Request that modifies GitHub Workflows. pylinthas been configured to provide some overhead checks of thexclimcodebase as well as run as part ofxclim'spre-commithooks.- Some small adjustments to code organization to address
pylinterrors.
- Dependabot has been configured to monitor the
devformatting tools (black,blackdoc,isort) are now pinned to theirpre-commithook version equivalents in bothpyproject.tomlandtox.ini. (PR/1626).black,isort, andpyupgradecode formatters no longer target Python3.8 coding style conventions. (PR/1565).- The GitHub Workflows now include builds to run tests against both Windows and MacOS. (PR/1648).
prefetchis now available as atoxenvironment modifier in order to download the testing data before launchingpytest(e.g.py3x-prefetch). This is required for running tests the first time on Windows if the testing data has not already been installed. (PR/1648).- Removed
step-security/harden-runnerfrom thefinishjob as it does not work on container images lackingsudoaccess. (PR/1655).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre almost 2 years ago
xclim - v0.47.0
Contributors to this version: Juliette Lavoie (@juliettelavoie), Pascal Bourgault (@aulemahal), Trevor James Smith (@Zeitsperre), David Huard (@huard), Éric Dupuis (@coxipi).
Announcements
- To circumvent issues stemming from changes to the frequency code convention in
pandasv2.2, we have pinnedxarray(< 2023.11.0) andpandas(< 2.2) for this release. This change will be reverted inxclimv0.48.0 to support the newer versions. (xarray>= 2023.11.0andpandas>= 2.2). xclimv0.47.0 will be the last release supporting Python3.8.
New features and enhancements
- New functions
xclim.ensembles.robustness_fractionsandxclim.ensembles.robustness_categories. The former will replacexclim.ensembles.change_significancewhich is now deprecated and will be removed inxclimv0.49.0. (PR/1514). - Added indicator ID to searched terms in the indicator search documentation page. (GH/1525, PR/1528).
Bug fixes
- Fixed a bug with
n_escore=-1inxclim.sdba.adjustment.NpdfTransform. (GH/1515, PR/1516). - In the documentation, fixed the tooltips in the indicator search results. (GH/1524, PR/1527).
- If chunked inputs are passed to indicators
mean_radiant_temperatureandpotential_evapotranspiration, sub-calculations of the solar angle will also use the same chunks, instead of a single one of the same size as the data. (GH/1536, PR/1542). - Fix wrong attributes in
xclim.indices.standardized_precipitation_index,xclim.indices.standardized_precipitation_evapotranspiration_index. (GH/1537, PR/1538).
Internal changes
- Pinned
cf-xarraybelow v0.8.5 in Python3.8 installation to further extend legacy support. (PR/1519). pip checkin conda builds in GitHub workflows have been temporarily set to always pass. (PR/1531).- Configure RtD search rankings to emphasize notebooks and indicators over indices and raw source code. (PR/1526).
- Addressed around 100 very basic
mypytyping errors and call signature errors. (PR/1532). - Use the intermediate step
_cumsum_reset_on_zeroinstead ofrlewhich is sufficient in_boundary_run. (GH/1405, PR/1530).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre about 2 years ago
xclim - v0.46.0
Contributors to this version: David Huard (@huard), Trevor James Smith (@Zeitsperre), Pascal Bourgault (@aulemahal), Éric Dupuis (@coxipi).
Announcements
- The default mechanism for computing the Mean Radiant Temperature, a part of the Universal Thermal Climate Index (UTCI) was broken in xclim v0.44.0 and v0.45.0. This has now been fixed by changing the default settings.
New indicators
xclim.indices.snw_storm_dayscomputes the number of days with snowfall amount accumulation above a given threshold (default:10 Kg m-2). (PR/1505).- Added
xclim.indices.wind_power_potentialto estimate the potential for wind power production given wind speed at the turbine hub height and turbine specifications, along withxclim.indices.wind_profileto estimate the wind speed at different heights based on wind speed at a reference height. (GH/1458, PR/1471).
New features and enhancements
xclimnow has a dedicated console command for prefetching testing data fromxclim-testdatawith branch options (e.g.:$ xclim prefetch_testing_data --branch some_development_branch). This command can be used to download the testing data to a local cache, which can then be used to run the testing suite without internet access or in "offline" mode. For more information, see the contributing documentation section forUpdating Testing Data. (GH/1468, PR/1473).- The testing suite now offers a means of running tests in "offline" mode (using
pytest-socket <https://github.com/miketheman/pytest-socket>_ to block external connections). This requires a local copy ofxclim-testdatato be present in the user's home cache directory and for certainpytestoptions and markers to be set when invoked. For more information, see the contributing documentation section forRunning Tests in Offline Mode. (GH/1468, PR/1473). - The
SKIP_NOTEBOOKSflag to speed up docs builds is now documented. See the contributing documentation sectionGet Started!for details. (GH/1470, PR/1476). - Refactored the indicators page with the addition of a search bar (GH/1433, PR/1454).
- Indicator
xclim.indices.generic.statsnow accepts any frequency (previously onlydaily). (PR/1498). - Added argument
"out_units"toselect_resample_opto bypass limitations ofto_agg_unitsin custom indicators. Also, addedvarto supported operations into_agg_units. (PR/1498). adapt_freq_threshargument was addedtosdba`` training functions, to facilitate performing frequency adaptation appropriately in each map block. (PR/1407).- Standardized indices (
xclim.indices.standardized_precipitation_indexandxclim.indices.standardized_precipitation_evapotranspiration_index) (GH/1270, GH/1416, GH/1474, PR/1311) were changed:- Optimized and noticeably faster calculation.
- Can be computed in two steps: first compute fit parameters with
xclim.indices.stats.standardized_index_fit_params, then use the output in the standardized indices functions. - The standardized index values are now clipped to ±8.21. This reflects the
float64precision of the computation when cumulative distributed function values are inverted to a normal distribution and avoids returning infinite values. - An offset parameter is now available to account for negative water balance values
xclim.indices.standardized_precipitation_evapotranspiration_index.
Bug fixes
- Fixed an error in the
pytestconfiguration that prevented copying of testing data to thread-safe caches of workers under certain conditions (this should always occur). (PR/1473).- Coincidentally, this also fixes an error that caused
pytestto error-out when invoked without an active internet connection. Runningpytestwithout network access is now supported (requires cached testing data). (GH/1468).
- Coincidentally, this also fixes an error that caused
- Calling a
sdba.map_blocks-wrapped function with data chunked along the reduced dimensions will raise an error. This forbids chunking the trained dataset along the distribution dimensions, for example. (GH/1481, PR/1482). - Optimization of indicators
huglin_indexandbiologically_effective_degree_dayswhen used withdaskandflox. As a side effect, the indice functions (i.e. underxclim.indices) no longer mask incomplete periods. The indicators' output is unchanged under the default"check_missing"setting (GH/1494, PR/1495). - Fixed
xclim.indices.run_length.lazy_indexingwhich would sometimes trigger the loading of auxiliary coordinates. (GH/1483, PR/1484). - Indicators
snd_season_lengthandsnw_season_lengthwill return0instead ofNaNif all inputs have a (non-NaN) zero snow depth (or water-equivalent thickness). (PR/1492, GH/1491) - Fixed a bug in the
pytestconfiguration that could prevent testing data caching from occurring in systems where the platform-dependent cache directory is not found in the user's home. (GH/1468, PR/1473). - Fix
xclim.core.dataflags.data_flagsvariable name generation (PR/1507). - Remove nonsensical
stat='average'option formean_radiant_temperature. (GH/1496, PR/1501).
Breaking changes
pytest-socketis now a required development dependency for running"offline"tests or the"offline"configuration of thetoxtesting suite. This has been added to thedevinstallation recipe. (GH/1468, PR/1473).- For better transparency and control in development, the
toxconfiguration has been adapted to allow passing of markers directly to thepytestcall. Positional arguments must be passed to tox after the--separator to select/deselect tests (e.g.'tox -e py38 -- -m "not slow"'). (PR/1473). - For better accuracy, the
tox -e blackrecipe has been renamed totox -e lint, as this configuration already included several other linting checks. (PR/1473). xclim.indices.winter_stormrenamed toxclim.indices.snd_storm_days. (PR/1505).- Default threshold in
xclim.indices.snw_season_{start|length|end}changed form20 kg m-2to4 kg m-2. (PR/1505). xclimdevelopment dependencies now includeruff.pycodestyleandpydocstylehave been replaced byruffand removed from thedevinstallation recipe. (PR/1504).- The
mf_filecall signature found inxclim.ensembles.create_ensemble(andxclim.ensembles._ens_align_dataset) has been removed (deprecated sincexclimv0.43.0). (PR/1506). xclim.indices.standardized_precipitation_indexandxclim.indices.standardized_precipitation_evapotranspiration_indexwill no longer accept two datasets (data and calibration data). Instead, a single dataset covering both the calibration and evaluation periods is expected. (GH/1270, PR/1311).
Internal changes
- Changed "degK" to "K" (used to designate Kelvin units). (PR/1475).
- Added a
pytestmarker (pytest.mark.requires_internet) to allow for skipping of tests that depend on remote network calls to function properly. (PR/1473). - Added handling for
pytest-socket'sSocketBlockedErrorinxclim.testing.open_datasetwhen attempting to fetch md5 validation files for cached testing data while explicitly disabling internet sockets. (GH/1468, PR/1473). - Updated the testing data used in the
analogs.ipynbnotebook to use the testing data now found inOuranosinc/xclim-testdata's main branch. (xclim-testdata PR/26 <https://github.com/Ouranosinc/xclim-testdata/pull/26>_, PR/1473). - Fixed an issue with automatic labelling that occurs when a Pull Request is made from a forked repository. (PR/1479).
- Changes to the
.zenodo.jsonfile no longer are marked as CI-related changes. (PR/1479). - GitHub deployment workflows now employs use of deployment environments for workflow security and uses the Trusted Publisher feature to sign and publish the
xclimwheel and source distributions. (PR/1469). - Mastodon publishing now uses
chuhlomin/render-template <https://github.com/chuhlomin/render-template>_ and a standard formatting markdown document to format Mastodon toots. (PR/1469). - GitHub testing workflows now use
Concurrencyinstead of the styfle/cancel-workflow-action to cancel redundant workflows. (PR/1487). - The
pkg_resourceslibrary has been replaced for thepackaginglibrary when version comparisons have been performed, and a few warning messages have been silenced in the testing suite. (GH/1489, PR/1490). - New
xclim.testing.helpers.assert_lazycontext manager to assert the laziness of code blocks. (PR/1484). - Added a fix for the deprecation warnings that
importlib.resourcesthrows, made backwards-compatible for Python3.8 withimportlib_resourcesbackport. (PR/1485). - Added basic keywords on most indicators for easier searching in the docs. Extracted climate indicators API to its own page for faster loading. (PR/1502, GH/1433).
nbstripoutnow removes 'metadata.kernelspec' in notebook cells. (PR/1407).- Deprecation wrapper
xclim.core.utils.deprecatedare added to help with deprecation warnings. (PR/1505). xclimnow usesruffto format the codebase withmake lintandpre-commit.flake8is still used for the time being, solely to enforce docstring linting (withflake8-rst-docstrings) and alphabetical__all__entries (withflake8-alphabetize). (PR/1504).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre about 2 years ago
xclim - v0.45.0
Contributors to this version: David Huard (@huard), Trevor James Smith (@Zeitsperre), Pascal Bourgault (@aulemahal), Juliette Lavoie (@juliettelavoie), Gabriel Rondeau-Genesse (@RondeauG), Marco Braun (@vindelico), Éric Dupuis (@coxipi).
Announcements
xclimnow usesplatformdirsto writexclim-testdatato the user's cache directory. Dynamic paths are now used to cache data dependent on the user's operating system. Developers can now safely delete the.xclim-testdatafolder in their home directory without affecting the functionality ofxclim. (PR/1460).
New indicators
- Variations of already existing indices:
xclim.indices.snd_maxandxclim.indices.frost_free_spell_max_length. (PR/1443, GH/1386).
New features and enhancements
- Added
ensembles.hawkins_suttonmethod to partition the uncertainty sources in a climate projection ensemble. (GH/771, PR/1262), along with a notebook example. (PR/1466). - New function
xclim.core.calendar.convert_doyto transform day-of-year data between calendars. Also accessible fromconvert_calendarwithdoy=True. (GH/1283, PR/1406). - New
xclim.units.declare_relative_unitsto enable relative unit checks. This was applied to most "generic" indices. (PR/1414). - Added new function
xclim.sdba.properties.stdto calculate the standard deviation of a variable over all years at a given time resolution. (PR/1445). - Amended the documentation of
xclim.sdba.properties.trendto document already existing functionality of calculating the return values ofscipy.stats.linregress. (PR/1445). - Add support for setting optional variables through the
dsargument. (GH/1432, PR/1435). - New
xclim.core.calendar.is_offset_divisorto test if a given freq divides another one evenly (PR/1446). - Missing value objects now support input timeseries of quarterly and yearly frequencies (PR/1446).
- Missing value checks enabled for all "generic" indicators (
return_level,fitandstats) (PR/1446).
Bug fixes
- Fix
kldivdocstring so the math formula renders to HTML. (GH/1408, PR/1409). - Fix the registry entries of "generic" indicators. (GH/1423, PR/1424).
- Fix
jetstream_metric_woollingsso it uses theverticalcoordinate identified bycf-xarray, instead ofpressure(GH/1421, PR/1422). - Fix virtual indicator attribute assignment, causing individual indicator's realm to be ignored. (GH/1425, PR/1426).
- Fixes the
raise_flagsargument ofxclim.core.dataflags.data_flagsso that anExceptionis only raised when some checkups fail. (GH/1456, PR/1457). - Fix
xclim.indices.generic.get_zonesso thatbinscan be given as input without error. (PR/1455).
Internal changes
- Tolerance thresholds for error in
test_stats::test_fithave been relaxed to allow for more variation in the results. Previously untested*_moving_yearly_windowfunctions are now tested. (GH/1400, PR/1402). - Increased the guess of number of quantiles needed in
ExtremeValues. (PR/1413). - Tolerance thresholds for error in
test_processing::test_adapt_freqhave been relaxed to allow for more variation in the results. (GH/1417, PR/1418). - Added
"streamflow"to the list of known variables. (PR/1431). - Refactoring of index backend calculations. (PR/1443, GH/1386):
- Use
xclim.indices.generic.select_resample_opfor{tg|tn|tx}_{max|mean|min},max_1day_precipitation_amount,{snw|snd}_max - Directly use
{cold|hot}_spell_max_lengthinmaximum_consecutive_{frost|tx}_days xclim.indices.generic.select_resample_opnow gives an output with the correct units (xclim.core.units.to_agg_unitsis used internally).
- Use
- Shuffle autogenerated documentation files into distinct folders that can be easily cleaned using Makefile. (PR/1449).
- Some docstring adjustments to existing classes. (PR/1449).
- The
pre-commitdependencyidentifynow associates Jupyter Notebooks as JSON files.pre-commitis now set to ignore JSON-formatting of notebooks. (PR/1449). - Added a helper module
_finderin thenotebooksfolder so that the working directory can always be found, with redundancies in place to prevent scripts from failing if the helper file is not found. (PR/1449). - Added a manual cache-cleaning workflow (based on GitHub cache-cleaning example), triggered when a branch has been merged. (PR/1462).
- Added a workflow for posting updates to the xclim Mastodon account (using cbrgm/mastodon-github-action), triggered when a new version is published. (PR/1462).
- Refactor base indicator classes and fix misleading inheritance of
return_level. (GH/1263, PR/1446).
Breaking changes
- Fix and adapt
percentile_doyfor an error raised by xarray > 2023.7.0. (GH/1417, PR/1450). integralreplacesprodanddelta_prodas possible input inxclim.core.units.to_agg_units(PR/1443, GH/1386).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 2 years ago
xclim - v0.44.0
Contributors to this version: Éric Dupuis (@coxipi), Trevor James Smith (@Zeitsperre), Pascal Bourgault (@aulemahal), Ludwig Lierhammer (@ludwiglierhammer), David Huard (@huard).
Announcements
xclim: xarray-based climate data analyticshas been published in the Journal of Open Source Software (DOI:10.21105/joss.05415). Users can now make use of theCite this repositorybutton in the sidebar for academic purposes. Many thanks to our core developers and user base for their fine contributions over the years! (GH/95, PR/250).xclimnow officially supports Python3.11. (PR/1388).
New indicators
- Several new indices and indicators:
snowfall_{frequency | intensity}for calculating the {percentage of | mean snowfall intensity on} days with snowfall above a threshold. (GH/1352, PR/1358){sfcWind | sfcWindmax}_{max | mean | min}for calculating the {max | mean | min} daily {mean | max} wind speed. (GH/1352, PR/1358){precip | liquid_precip | solid_precip}_average}for calculating the mean daily {total precipitation | liquid precipitation | solid precipitation } amount. (GH/1352, PR/1358){cold | dry}_spell_max_lengthfor calculating maximum length of {cold | dry} spell events. (GH/1352, PR/1359).dry_spell_frequencyfor calculating total number of dry spells. (GH/1352, PR/1359).hardiness_zoneswith supported methods"usda"(USA) and"anbg"(Australia) for calculating hardiness classifications from climatologies. (GH/1290, PR/1396).
- New indicator
late_frost_daysfor calculating the number of days where the daily minimum temperature is below a threshold over a given time period. (GH/1352, PR/1361).
New features and enhancements
xclim.sdba.processing.escoreperformance was improved with a faster runtime (PR/1360).- New generic function (
flux_and_rate_converter) converting flux to a rate (and vice-versa) using a density.snw_to_sndandsnd_to_snwwere refactored using this function. (GH/1352, PR/1358) - New function (
prsn_to_prsnd) to convert snowfall flux ([mass] / [area] / [time]) to snowfall rate ([length] / [time]) using snow density ([mass] / [volume]). (GH/1352, PR/1358) - New variables: Snowfall rate
prsndand surface maximum wind speedsfcWindmax. (GH/1352, PR/1358). - Docstring for
freqlinks to pandas offset aliases documentation. (GH/1310, PR/1392). - New function
xclim.indces.run_length.extract_eventsfor determining runs whose starting and stopping points are defined through run length conditions. (PR/1256). - Stats functions
frequency_analysisnow takesmethodparameter to select other fitting methods such as PWM or MOM. (GH/1168, PR/1398). xclim.indices.frost_daysnow accepts an**indexerparameter for calculating frost days over a temporal subset of the given dataset. (GH/1352, PR/1361).- New function
xclim.indices.generic.get_zonesattributing a histogram bin index (a zone) to each value in an input array. (GH/1290, PR/1396).
Bug fixes
- Fixed a bug in
xclim.core.calendar.time_bndswhen usingDataArrayResampleobjects, caused by an upstream change in xarray 2023.5.0. (GH/1368, PR/1377). ensembles.change_significancewill returns NaNs when the input values are all NaNs, instead of failing. (GH/1379, PR/1380).- Accelerated import of xclim by caching the compilation of
guvectorizefunctions. (PR/1378). - Fixed many issues with
xclim.indices.helpers.cosine_of_solar_zenith_angle, the signature changed. (GH/1110, PR/1399).
Internal changes
- In order to ensure documentation can be rebuilt at a later time, errors raised by
sphinxlinkcheck are now set to be ignored when building the documentation. (PR/1375). - With the publication of
xclim, the code repository now offers aCITATION.cffconfiguration for users to properly cite the software (APA formatted and raw BibTeX) for academic purposes. (GH/95, PR/250). - Logging messages emitted when redefining units via
pint(caused bylogginginteractions with dependencies) have been silenced. (GH/1373, PR/1384). - Fixed some annotations and
devrecipe dependencies issues to allow for the development of xclim inside a python3.11 environment. (GH/1376, PR/1381). - The deprecated
mamba-org/provision-with-micromambaGitHub Action has been replaced withmamba-org/setup-micromamba. (PR/1388). xclimGitHub CI workflows now run builds against Python3.11. (PR/1388).- In indices, verify that all parameters of type
Quantifiedthat have a default value have their dimension declared. (GH/1293, PR/1393). - Updated
roy_extremeprecip_2021to the newly published paper. (PR/1394). - Two new GitHub CI Actions have been added to the existing Workflows (PR/1390):
actions/add-to-project: Automatically adds issues to thexclimproject.saadmk11/github-actions-version-updater: Updates GitHub Action versions in all Workflows (triggered monthly).
- Added
methodparameter tofrequency_analysisandfa. (GH/1168, PR/1398).
Breaking changes
- Signature of
hot_spell_{frequency | max_length | total_length}:thresh_tasmaxmodified tothresh. (GH/1352, PR/1359).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 2 years ago
xclim - v0.43.0
Contributors to this version: Trevor James Smith (@Zeitsperre), Ludwig Lierhammer (@ludwiglierhammer), Pascal Bourgault (@aulemahal), Juliette Lavoie (@juliettelavoie), Alexis Beaupré (@Beauprel), Éric Dupuis (@coxipi).
Announcements
xclimhas passed the peer-review process and been officially accepted as a project associated with both pyOpenSci and PANGEO. Additionally,xclimhas been accepted to be published in the Journal of Open Source Software. Our review process can be consulted here: PyOpenSci Software Review. (PR/1350).
New features and enhancements
- New
xclim.sdbameasurexclim.sdba.measures.taylordiagram. (PR/1360).
New indicators
ensembles.change_significancenow supports the Brown-Forsythe test. (PR/1292).
Bug fixes
- Fixed a bug in the
pyproject.tomlconfiguration that excluded the changelog (CHANGES.rst) from the packaged source distribution. (PR/1349). - When summing an all-
NaNperiod withresample,xarrayv2023.04.0 now returnsNaN, whereas earlier versions returned0. This brokefraction_over_precip_thresh, but is now fixed. (PR/1354, GH/1337). - In
xclim.sdba's Quantile Delta Mapping algorithm, the quantiles of the simulation to adjust were computed slightly differently than when creating the adjustment factor. Thexclim.sdba.utils.rankfunction has been fixed to return "percentage-ranks" (quantiles) in the proper range. (GH/1334, PR/1355). - The radiation converters (
longwave_upwelling_radiation_from_net_downwellingandshortwave_upwelling_radiation_from_net_downwelling) were hard-coded to redefine output units asW m-2, regardless of input units, so long as unit dimensions checks cleared. Units are now set directly from inputs. (GH/1365, PR/1366).
Breaking changes
- Many previously deprecated indices and indicators have been removed from
xclim(PR/1318), with replacement indicators suggested as follows:xclim.indicators.atmos.first_day_above->xclim.indicators.atmos.first_day_{tn | tg | tx}_abovexclim.indicators.atmos.first_day_below->xclim.indicators.atmos.first_day_{tn | tg | tx}_belowxclim.indicators.land.continuous_snow_cover_end->xclim.indicators.land.snd_season_endxclim.indicators.land.continuous_snow_cover_start->xclim.indicators.land.snd_season_startxclim.indicators.land.fit->xclim.indicators.generic.fitxclim.indicators.land.frequency_analysis->xclim.indicators.generic.return_levelxclim.indicators.land.snow_cover_duration->xclim.indicators.land.snd_season_lengthxclim.indicators.land.stats->xclim.indicators.generic.statsxclim.indices.continuous_snow_cover_end->xclim.indices.snd_season_endxclim.indices.continuous_snow_cover_start->xclim.indices.snd_season_startxclim.indices.snow_cover_duration->xclim.indices.snd_season_length
- Several
_privatefunctions withinxclim.indices.fire._cffwisthat had been exposed publicly have now been rendered as hidden functions. Affected functions are:_day_length,_day_length_factor,_drought_code,_duff_moisture_code,_fine_fuel_moisture_code,_overwintering_drought_code. (PR/1159, PR/1369).
Internal changes
- The testing suite has been adjusted to ensure calls are made to existing functions using non-deprecated syntax. The volume of warnings emitted during testing has been significantly reduced. (PR/1318).
- In order to follow best practices and reduce the installed size of the
xclimwheel, thetestsfolder containing the testing suite has been split from the package and placed in the top-level of the code repository. (GH/1348, PR/1349, suggested from PyOpenSci Software Review). Submodules that were previously called withinxclim.testing.testshave been refactored as follows:xclim.testing.tests.data→xclim.testing.helpersxclim.testing.tests.test_sdba.utils→xclim.testing.sdba_utils
- Added a "Conventions" section to the README. (GH/1342, PR/1351).
- New helper function
xclim.testing.helpers.test_timeseriesfor generating timeseries objects with specified variable names and units. (PR/1356). toxrecipes and documentation now refer to the official build ofSBCK, available on PyPI. (GH/1362, PR/1364).- Excluded some URLs from
sphinx linkcheckthat were causing issues on ReadTheDocs. (PR/1364). - Tagged versions of
xclim-testdatanow follow a calendar-based versioning scheme for easier determination of compatibility betweenxclimand testing data. (PR/1367, xclim-testdata discussion). flake8,pycodestyle, andpydocstylechecks have been significantly changed in order to clean up the code base of redundant# noqamarkers. Linting checks for Makefile andtoxrecipes have been synchronized as well. (PR/1369).flake8pluginflake8-alphabetizehas been added to development recipes in order to check order of__all__entries and Exceptions. (PR/1369).- Corrected translations of
cold_spell_{frequency | days}(PR/1372).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 2 years ago
xclim - v0.42.0
Contributors to this version: Trevor James Smith (@Zeitsperre), Juliette Lavoie (@juliettelavoie), Éric Dupuis (@coxipi), Pascal Bourgault (@aulemahal).
Announcements
xclimnow supports testing against tagged versions ofOuranosinc/xclim-testdata <https://github.com/Ouranosinc/xclim-testdata>_ in order to support older versions ofxclim. For more information, see the Contributing Guide for more details. (PR/1339).xclim v0.42.0will be the last version to explicitly support Python3.8. (GH/1268, PR/1344).
New features and enhancements
- Two previously private functions for selecting a day of year in a time series when performing calendar conversions are now exposed. (GH/1305, PR/1317). New functions are:
xclim.core.calendar.yearly_interpolated_doyxclim.core.calendar.yearly_random_doy
scipyis no longer pinned below v1.9 andlmoments3>=1.0.5is now a core dependency and installed by default withpip. (GH/1142, PR/1171).- Fix bug on number of bins in
xclim.sdba.propeties.spatial_correlogram. (PR/1336) - Add
resample_before_rlargument to control when resampling happens inmaximum_consecutive_{frost|frost_free|dry|tx}_daysand in heat indices (in_threshold) (GH/1329, PR/1331) - Add
xclim.ensembles.make_criteriato help create inputs for the ensemble-reduction methods. (GH/1338, PR/1341).
Bug fixes
- Warnings emitted from regular usage of some indices (
snowfall_approximationwithmethod="brown",effective_growing_degree_days) due to successiveconvert_units_tocalls within their logic have been silenced. (PR/1319). - Fixed a bug that prevented the use of the
sdba_encode_cfoption with xarray 2023.3.0 (PR/1333). - Fixed bugs in
xclim.core.missingandxclim.sdba.base.Grouperwhen using pandas 2.0. (PR/1344).
Breaking changes
- The call signatures for
xclim.ensembles.create_ensembleandxclim.ensembles._base._ens_align_datasethave been deprecated. Calls to these functions made with the original signature will emit warnings. Changes will become breaking inxclim>=0.43.0.(GH/1305, PR/1317). Affected variable:mf_flag(bool) ->multifile(bool)
- The indice and indicator for
last_spring_frosthas been modified to usetasminby default, reflecting its docstring and literature definition (GH/1324, PR/1325). - following indices now accept the
opargument for modifying the threshold comparison operator (PR/1325):snw_season_length,snd_season_length,growing_season_length,frost_season_length,frost_free_season_length,rprcptot,daily_pr_intensity
- In order to support older environments,
pandasis now conditionally pinned below v2.0 when installingxclimon systems running Python3.8. (PR/1344).
Bug fixes
Internal changes
- Added
xclimto the ouranos Zenodo community . (PR/1313). - Significant documentation adjustments. (GH/1305, PR/1308):
- The CONTRIBUTING page has been moved to the top level of the repository.
- Information concerning the licensing of xclim is clearly indicated in README.
sphinx-autodoc-typehintsis now used to simplify call signatures generated in documentation.- The SDBA module API is now found with the rest of the User API documentation.
HISTORY.rsthas been renamedCHANGES.rst, to followdask-like conventions.- Hyperlink targets for individual
indicesandindicatorsnow point to their entries underAPIorIndices. - Module-level docstrings have migrated from the library scripts directly into the documentation RestructuredText files.
- The documentation now includes a page explaining the reasons for developing
xclimand a section briefly detailing similar and related projects. - Markdown explanations in some Jupyter Notebooks have been edited for clarity
- Removed
Mappingabstract base class types in call signatures (dictvariables were always expected). (PR/1308). - Changes in testing setup now prevent
test_mean_radiant_temperaturefrom sometimes causing a segmentation fault. (GH/1303, PR/1315). - Addressed a formatting bug that caused
Indicatorswith multiple variables returned to not be properly formatted in the documentation. (GH/1305, PR/1317). toxnow includesbckandeofsflags for easier testing of dependencies. CI builds now test againstsbck-python@ master. (PR/1328).upstreamCI tests are now run on push to master, at midnight, and can also be triggered viaworkflow_dispatch. Failures from upstream build will open issues usingxarray-contrib/issue-from-pytest-log. (PR/1327).- Warnings from set
_version_deprecatedwithin Indicators now emitFutureWarninginstead ofDeprecationWarningfor greater visibility. (PR/1319). - The
Graphicssection of theUsagenotebook has been expanded upon while grammar and spelling mistakes within the notebook-generated documentation have been reduced. (GH/1335, PR/1338, suggested from PyOpenSci Software Review). - The Contributing guide now lists three separate subsections to help users understand the gains from optional dependencies. (GH/1335, PR/1338, suggested from PyOpenSci Software Review).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 2 years ago
xclim - v0.41.0
Contributors to this version: Trevor James Smith (@Zeitsperre), Pascal Bourgault (@aulemahal), Ludwig Lierhammer (@ludwiglierhammer), Éric Dupuis (@coxipi).
New features and enhancements
- New properties
xclim.sdba.properties.decorrelation_lengthandxclim.sdba.properties.transition_probability. (PR/1252)
New indicators
ensembles.change_significancenow supports Mann-whitney U-test and flexiblerealization. (PR/1285).- New indices and indicators for converting from snow water equivalent to snow depth (
snw_to_snd) and snow depth to snow water equivalent (snd_to_snw) using snow density[kg / m^3]. (PR/1271). - New indices and indicators for determining upwelling radiation (
shortwave_upwelling_radiation_from_net_downwellingandlongwave_upwelling_radiation_from_net_downwelling; CF variablesrsusandrlus) from net and downwelling radiation (shortwave:rssandrsds; longwave:rlsandrlds). (PR/1271). - New indice and indicator
{snd | snw}_season_{length | start | end}which generalizesnow_cover_durationandcontinuous_snow_cover_{start | end}to allow using these functions with variablesnw(PR/1275). - New indice and indicator (
dryness_index) for estimating soil humidity classifications for winegrowing regions (based on Riou et al. (1994)). (GH/355, PR/1235).
Breaking changes
xclimtesting default behaviours have been changed (GH/1295, PR/1297):- Running
$ pytestwill no longer usepytest-xdistdistributed testing be default (can be set with-n auto|logical|#. Coverage is also no longer gathered/reported by default. - Running
$ toxwill now setpytest-xdistto use-n logicalprocesses (with a max of 10). - Default behaviour for testing is to no longer always fetch
xclim-testdata. If testdata is found in$HOME/.xclim_testing_data, files will be copied to individual processes, otherwise, will be fetched as needed.
- Running
- Environment variables evaluated when running pytest have been changed (GH/1295, PR/1297):
- For testing against specific branches of
xclim-testdata:MAIN_TESTDATA_BRANCH->XCLIM_TESTDATA_BRANCH - The option to skip fetching of testdata (
SKIP_TEST_DATA) has been removed - A new environment variable (
XCLIM_PREFETCH_TESTING_DATA) is now available to gatherxclim-testdatabefore running test ensemble (default:False). - Environment variables are now passed to
toxon execution.
- For testing against specific branches of
Bug fixes
build_indicator_module_from_yamlnow accepts areloadargument. When re-building a module that already exists,reload=Trueremoves all previous indicator before creating the new ones. (GH/1192, PR/1284).- The test for French translations of official indicators was fixed and translations for CFFWIS indices, FFDI, KDBI, DF and Jetstream metric woollings have been added or fixed. (PR/1271).
use_ufuncinwindowed_run_countis now supplied with argumentfreqto warn users that the 1d method does not support resampling after run length operations (GH/1279, PR/1291).{snd | snw}_max_doynow avoids an error due toxr.argmaxwhen there are all-NaN slices. (PR/1277).
Internal changes
xclimhas adopted PEP 517 and PEP 621 (pyproject.tomlusing the flit backend) to replace the legacysetup.pyused to manage package organisation and building. Many tooling configurations that already supported thepyproject.tomlstandard have been migrated to this file. CI and development tooling documentation has been updated to reflect these changes. (PR/1278, suggested from PyOpenSci Software Review).- Documentation source files have been moved around to remove some duplicated image files. (PR/1278).
- Coveralls GitHub Action removed as it did not support
pyproject.toml-based configurations. (PR/1278). - Add a remark about how
xclim's CFFWIS is different from the original 1982 implementation. (GH/1104, PR/1284). - Update CI runs to use Python3.9 when examining upstream dependencies. Replace
setup-condaaction withprovision-with-micromambaaction. (PR/1286). - Update CI runs to always use
tox~=4.0and thelatestvirtual machine images (nowubuntu-22.04). (PR/1288, PR/1297). SBCKinstallation command now points to the official development repository. (PR/1288).- Some references in the BibTeX were updated to point to better resources. (PR/1288).
- Add a GitHub CI workflow for performing dependency security review scanning. (PR/1287).
- Grammar and spelling corrections were applied to some docstrings. (PR/1271).
- Added
[radiation]([power] / [area]) to list of defined acceptable units. (PR/1271). - Updated testing data used to generate the
atmosdsdataset to use more reproducibly-converted ERA5 data, generated with themirandaPython package. (PR/1269). - Updated testing dependencies to use
pytest-xdist>=3.2, allowing for the new--dist=workstealscheduler for distributing the pool of remaining tests across workers after individual workers have exhausted their own queues. (PR/1235). - Adding infer context to the unit conversion in of the training of ExtremeValues. (PR/1299).
- Added
sphinxcontrib-svg2pdfconverterfor converting SVG graphics within documentation to PDF-compatible images. (PR/1296). - README badges for supported Python versions and repository health have been added. (GH/1304, PR/1307).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre almost 3 years ago
xclim - v0.40.0
History
0.40.0 (2023-01-13)
Contributors to this version: Trevor James Smith (@Zeitsperre), Pascal Bourgault (@aulemahal), David Huard (@huard), Juliette Lavoie (@juliettelavoie).
New features and enhancements
- Virtual modules can add variables to
xclim.core.utils.VARIABLESthrough the newvariablessection of the yaml files. (GH/1129, PR/1231). xclim.core.units.convert_units_tocan now perform automatic conversions based on the standard name of the input when needed. (GH/1205, PR/1206).- Conversion from amount (thickness) to flux (rate), using
amount2rateandrate2amount. - Conversion from amount to thickness for liquid water quantities, using the new
amount2lwethicknessandlwethickness2amount. This is similar to the implicit transformations enabled by the "hydro" unit context. - Passing
context='infer'will activate the "hydro" context if the source or the target are DataArrays with a standard name that is compatible, as decided by the newxclim.core.units.infer_contextfunction.
- Conversion from amount (thickness) to flux (rate), using
- New
genericindicator realm. Now holds indicators previously meant for streamflow analysis in thelandrealm:fit,return_level(previouslyfreq_analysis) andstats. (GH/1130, PR/1225). - Thresholds and other quantities passed as parameters of indicators can now be multi-dimensional
DataArrays.xarraybroadcasting mechanisms will apply. These parameters are now annotated as "Quantity" in the signatures (xclim.core.utils.Quantity), instead of "str" as before. Attributes where such thresholds where included will now read "" (french: " ") for these new cases. Multi-dimensional quantities are still largely unsupported, except where documented in the docstring. (GH/1093, PR/1236).
Breaking changes
- Rewrite of
xclim.core.calendar.time_bnds. It should now be more resilient and versatile, but allcftime_*andcfindex_*functions were removed. (GH/74, PR/1207). hydrocontext is not always enabled, as it led to unwanted unit conversions. Unit conversion operations now need to explicitly declare thehydrocontext to support conversions fromkg / m2 /stomm/day. (GH/1208, PR/1227).- Many previously deprecated indices and indicators have been removed from
xclim(PR/1228), with replacement indices/indicators suggested as follows:xclim.indicators.atmos.fire_weather_indexes→xclim.indicators.atmos.cffwis_indicesxclim.indices.freshet_start→xclim.indices.first_day_temperature_abovexclim.indices.first_day_above→xclim.indices.first_day_temperature_abovexclim.indices.first_day_below→xclim.indices.first_day_temperature_belowxclim.indices.tropical_nights→xclim.indices.tn_days_abovexclim.indices.generic.degree_days→xclim.indices.generic.cumulative_difference
- The following modules have been removed (PR/1228):
xclim.indices.fwi→ functions migrated toxclim.indices.firexclim.subset(mock submodule) → functions migrated toclisops.core.subset
- Indicators
standardized_precipitation_indexandstandardized_precipitation_evapotranspiration_indexwill now requirepr_calandwb_calas keyword arguments only. (PR/1236). - The internal object
PercentileDataArrayhas been removed. (PR/1236). - The
xclim.testing.utils.get_all_CMIP6_variablesandxclim.testing.utils.update_variable_yamlfunction were removed as the former was extremely slow and unusable. (PR/1258). - The wind speed input of
atmos.potential_evapotranspirationandatmos.water_budgetwas renamed tosfcWind(capital W) as this is the correct CMIP6 name. (PR/1258). - Indicator
land.stats,land.fitandland.freq_analysisare now deprecated and will be removed in version 0.43. They are being phased out in favor of generic indicatorsgeneric.stats,generic.fitandgeneric.return_levelrespectively. (GH/1130, PR/1225).
Bug fixes
- The weighted ensemble statistics are now performed within a context in order to preserve data attributes. (GH/1232, PR/1234).
- The
make docsMakefile recipe was failing with an esoteric error. This has been resolved by splitting thelinkcheckanddocssteps into separate actions. (GH/1248. PR/1251). - The setup step for
pytestneeded to be addressed due to the fact that files were being accessed/modified by multiple tests at a time, causing segmentation faults in some tests. This has been resolved by splitting functions into those that fetch or generate test data (underxclim.testing.tests.data) and the fixtures that supply accessors to them (underxclim.testing.tests.conftest). (GH/1238, PR/1254). - Relaxed the expected output for
test_spatial_analogs[friedman_rafsky]to support expected results fromscikit-learn1.2.0. - The MBCn example in documentation has been fixed to properly imitate the source. (GH/1249, PR/1250).
- Streamflow indicators relying on indices defined in
xclim.indices.statswere not checking input variable units. These indicators will now raise an error if input data units are not m^3/s. (GH/1130, PR/1225). - Adjusted some documentation examples were not being rendered properly. (GH/1264, PR/1266).
Internal changes
- Minor adjustments to GitHub Actions workflows (newest Ubuntu images, updated actions version, better CI triggering). (PR/1221).
- Pint units
contextadded to various operations, tests andIndicatorattributes. (GH/1208, PR/1227). - Updated article from Alavoine & Grenier (2022) within documentation. Many article reference URLs have been updated to use HTTPS where possible. (GH/1246, PR/1247).
- Added relevant variable dataflag checks for potential evaporation, convective precipitation, and air pressure at sea level. (PR/1241).
- Documentation restructured to include
ReadMepage (asAbout) with some minor changes to documentation titles. (PR/1233). xclimdevelopment build now usesnbqato effectively run black checks over notebook cells. (PR/1233).- Some
toxrecipes (opt-slow,conda) are temporarily deactivated until atox>=4.0-compatibletox-condaplugin is released. (PR/1258). - A notebook (
extendingxclim.ipynb) has been updated to remove mentions of obsoletexclim.subsetmodule. (PR/1258). - Merge of sdba documentation from the module and the rst files, some cleanup and addition of a section refering to github issues. (PR/1230).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre almost 3 years ago
xclim - v0.39.0
Contributors to this version: Trevor James Smith (@Zeitsperre), Abel Aoun (@bzah), Éric Dupuis (@coxipi), Travis Logan (@tlogan2000), Pascal Bourgault (@aulemahal).
New features and enhancements
- The general
xclimdescription and ReadMe have been updated to reflect recent enhancements. (GH/1185, PR/1209). - Documentation now supports intersphinx mapping references within code examples via
sphinx-codeautolinkand copying of code blocks viasphinx-copybutton. (PR/1182). - Log-logistic distribution added to
stats.pyfor use withstandardized_precipitation_indexandstandardized_precipitation_evapotranspiration_index. (GH/1141, PR/1183). - New option in many indices allowing for resampling in given periods after
run_lengthoperations. (GH/505, GH/916, GH/917, PR/1161). - New base indicator class for sdba:
StatisticalPropertyMeasure, those measures that also reduce the time (as a property does). (PR/1198). xclim.core.calendar.common_calendarto find the best calendar to use when uniformizing an heterogeneous collection of data. (PR/1217).xclim.ensembles.create_ensemblenow acceptscalendar=None, and uses the above function to guess the best one. It also now acceptscal_kwargsto fine tune the calendar conversion. (GH/1190, PR/1217).- New data check :
xclim.core.datachecks.check_common_timethat ensures all inputs of multivariate indicators have the same frequency (and the same time anchoring for daily and hourly data). (GH/1111, PR/1217).
New indicators
- New indices
first_day_temperature_{above | below}and indicatorsxclim.indices.first_day_{tn | tg | tx}_{above | below}. These indices/indicators accept operator (op) keyword for finer threshold comparison controls. (GH/1175, PR/1186). - New generic indice
cumulative_differencefor calculating difference between values and thresholds across time (e.g. temperature: degree-days, precipitation: moisture deficit), with or without resampling/accumulating by frequency. (PR/1202). - New spatial sdba properties and measures :
spatial_correlogram,scorrandfirst_eof. The later needs the optional dependency eofs. (PR/1198).
Breaking changes
- Indices that accept
latorloncoordinates in their call signatures will now usecf-xarrayaccessors to gather these variables in the event that they are not explicitly supplied. (PR/1180). This affects the following:huglin_index,biologically_effective_degree_days,cool_night_index,latitude_temperature_index,water_budget,potential_evapotranspiration
cool_night_indexnow optionally acceptslat: str = "north" | "south"for calculating CNI over DataArrays lacking a latitude coordinate. (PR/1180).- The offset value in
standardized_precipitation_evapotranspiration_indexis changed to better reproduce results in the reference librarymonocongo/climate_indices. (GH/1141, PR/1183). - The
first_day_belowandfirst_day_aboveindices are now deprecated in order to clearly communicate the variables they act upon (GH/1175, PR/1186). The suggested migrations are as follows:xclim.indices.first_day_above->xclim.indices.first_day_temperature_abovexclim.indices.first_day_below->xclim.indices.first_day_temperature_below
- The
first_day_belowandfirst_day_aboveatmos indicators are now deprecated in order to clearly communicate the variables they act upon (GH/1175, PR/1186). The suggested migrations are as follows:xclim.atmos.first_day_above->xclim.indices.first_day_{tn | tg | tx}_abovexclim.atmos.first_day_below->xclim.indices.first_day_{tn | tg | tx}_below
- The
degree_daysgeneric indice has been deprecated in favour ofcumulative_differencethat is not limited only to temperature variables (GH/1200, PR/1202). The indices foratmos.{heating | cooling | growing}_degree_daysare now built fromgeneric.cumulative_difference. - Running
pytestnow requires thepytest-xdistdistributed testing dependency. This library has been added to thedevrequirements and conda environment configuration. (PR/1203). - Parameters
reducerandwindowinxclim.indices.rle_statisticsare now positional. (PR/1161). - The
relative_annual_cycle_amplitudeandannual_cycle_amplitudehave been rewritten to match the version defined in the VALUE project, outputs will change drastically (for the better) (PR/1198). - English indicator metadata has been adjusted to remove frequencies from fields in the
long_nameof indicators. English indicators now have an explicittitleandabstract. (GH/936, PR/1123). - French indicator metadata translations are now more uniform and more closely follow agreed-upon grammar conventions, while also removing frequency fields in
long_name_fr. (GH/936, PR/1123). - The
freshet_startindice is now deprecated in favour offirst_day_temperature_abovewiththresh='0 degC', window=5. Thefreshet_startindicator is now based onfirst_day_temperature_above, but is otherwise unaffected. (GH/1195, PR/1196). - Call signatures for several indices/indicators have been modified to optionally accept
opfor manually setting threshold comparison operators (GH/1194, PR/1197). The affected indices and indicators as follows:hot_spell_max_length,hot_spell_frequency,cold_spell_days,cold_spell_frequency,heat_wave_index,warm_day_frequency(indice only),warm_night_frequency(indice only),dry_days,wetdays,wetdays_prop.
- Cleaner
xclim.core.calendar.parse_offset: fails on invalid frequencies, return implicit anchors (YS -> JAN, Y -> DEC) and implicitis_start_anchored(D -> True). (GH/1213, , PR/1217).
Bug fixes
- The docstring of
cool_night_indexsuggested thatlatwas an optional parameter. This has been corrected. (GH/1179, PR/1180). - The
mean_radiant_temperatureindice was accessing hardcodedlatandloncoordinates from passed DataArrays. This now usescf-xarrayaccessors. (PR/1180). - Adopt (and adapt) unit registry declaration and preprocessors from
cf-xarrayto circumvent bugs caused by a refactor inpint0.20. It also cleans the code a little bit. (GH/1211, PR/1212).
Internal changes
- The documentation build now relies on
sphinx-codeautolinkandsphinx-copybutton. (PR/1182). - Many docstrings did not fully adhere to the numpy docstring format. Fields and entries for many classes and functions have been adjusted to adhere better. (PR/1182).
- The xdoctest namespace now provides access to session-scoped
{variable}_datasetaccessors, as well as apath_to_atmos_fileobject. These can be used for running doctests on all variables made in the pytestatmosds()fixture. (PR/1882). - Upgrade CodeQL GitHub Action to v2. (GH/1188, PR/1189).
- New generic index
first_day_threshold_reachedis now used to compose allfirst_day_XYZindices. (GH/1175, PR/1186). - In order to reduce computation footprint, the GitHub CI full testing suite and doctests are now only run once a pull request has been reviewed and approved. The number of simultaneously triggered builds has also been reduced. (GH/1155, PR/1203).
- ReadTheDocs now only builds full documentation (including running notebooks) when pull requests are merged to the main branch. (GH/1155, PR/1203).
xclimnow leveragespytest-xdistto distribute tests among Python workers and significantly speed up the testing suite. (PR/1203).show_versionscan now accept a list of dependencies so that other libraries can make use of this utility. (PR/1215).- Pull Requests now are automatically tagged (
CI,docs,indicators, and/orsdba) according to files modified using the GitHub Labeler Action. (PR/1214).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre about 3 years ago
xclim - v0.38.0
Contributors to this version: Pascal Bourgault (@aulemahal), Éric Dupuis (@coxipi), Trevor James Smith (@Zeitsperre), Abel Aoun (@bzah), Gabriel Rondeau-Genesse (@RondeauG), Dougie Squire (@dougiesquire).
New features and enhancements
- Adjustment methods of SBCK are wrapped into xclim when that package is installed. (GH/1109, PR/1115).
- Wrapped SBCK tests are also properly run in the tox testing ensemble. (PR/1119).
- Method
FAO_PM98(based on Penman-Monteith formula) to compute potential evapotranspiration. (PR/1122). - New indices for droughts: SPI (standardized precipitations) and SPEI (standardized water budgets). (GH/131, PR/1096).
- Most numba functions of
sdba.nbutilsnow use the "lazy" compilation mode. This significantly accelerates the import time of xclim. (GH/1135, PR/1167). - Statistical properties and measures from
xclim.sdbaare nowIndicatorsubclasses (PR/1149).
New indicators
xclimnow has the McArthur Forest Fire Danger Index and related indices under a newxclim.indices.firemodule. These indices are also available as indicators. (GH/1152, PR/1159)- Drought-related indicators: SPI (standardized precipitations) and SPEI (standardized water budgets). (GH/131, PR/1096).
ensembles.create_ensemblesnow accepts arealizationsargument to assign a coordinate to the "realization" axis. It also accepts a dictionary as input so that keys are used as that coordinate. (PR/1153).ensembles.ensemble_percentiles,ensembles.ensemble_mean_std_max_minandensembles.change_significancenow support weights (PR/1151).- Many generic indicators that compare arrays or against thresholds or now accept an
opkeyword for specifying the logical comparison operation to use in their calculations (i.e.{">", ">=", "<", "<=, "!=", "=="}). (GH/389, PR/1157).- In order to prevent user error, many of these generic indices now have a
constrainvariable that prevents calling an indice with an inappropriate comparison operator. (e.g. The following will raise an error:op=">", constrain=("<", "<=")). This behaviour has been added to indices acceptingopwhere appropriate.
- In order to prevent user error, many of these generic indices now have a
Breaking changes
scipyhas been pinned below version 1.9 untillmoments3can be adapted to the new API. (GH/1142, PR/1143).xclimnow requiresxarray>=2022.06.0. (PR/1151).- Documentation CI (ReadTheDocs) builds will now fail if there are any misconfigured pages, internal link/reference warnings, or broken external hyperlinks. (GH/1094, PR/1131, GH/1139, PR/1140, PR/1160).
- Call signatures for generic indices have been reordered and/or modified to accept
op, and optionallyconstrain, in many cases, andcondition/conditional/operationhas been renamed toopfor consistency. (GH/389, PR/1157). The affected indices are as follows:get_op,compare,threshold_count,get_daily_events,count_level_crossings,count_occurrences,first_occurrence,last_occurrence,spell_length,thresholded_statistics,temperature_sum,degree_days.
- All indices in
xclim.indices.genericnow usethresholdin lieu ofthreshfor consistency. (PR/1157). - Existing function
xclim.indices.generic.comparecan now be used to construct operations withopandconstrainvariables to allow for dynamic comparisons with user input handling. (GH/389, PR/1157). - Two deprecated indices have been removed from
xclim. (PR/1157):xclim.indices._multivariate.daily_freezethaw_cycles-> Replaceable with the genericmultiday_temperature_swingwiththresh_tasmax='0 degC',thresh_tasmin='0 degC',window=1, andop='sum'. The indicator version (xclim.atmos.daily_freezethaw_cycles) is unaffected.xclim.indices.generic.select_time-> Was previously moved toxclim.core.calendar.
- The
clix-metaindicator table parsing function (xclim.core.utils.adapt_clix_meta_yaml) has been adapted to support the new "op" operator handler. (PR/1157). - Because they have been re-implemented as
Indicatorsubclasses, statistical properties and measures ofxclim.sdbano longer preserve attributes of their inputs by default. Usexclim.set_options(keep_attrs=True)to get the previous behaviour. (PR/1149). - The
xclim.indices.generic.extreme_temperature_rangefunction has been fixed so it now does what its definition says. Results fromxclim.indicators.cf.etrwill change. (GH/1172, PR/1173). xclimnow has a dedicatedindices.firesubmodule that houses all fire-related indices. The previousxclim.indices.fwisubmodule is deprecated and will be removed in a future version. (GH/1152, PR/1159).- The indicator
xclim.indicators.atmos.fire_weather_indexesand indicexclim.indices.fire_weather_indexeshave both been deprecated and renamed tocffwis_indices. Calls using the previous naming will be removed in a future version. (PR/1159). xclimnow explicitly requirespybtexin order to generate documentation. (PR/1176).
Bug fixes
- Fixed
saturation_vapor_pressurefor temperatures in other units than Kelvins (also fixesrelative_humidity_from_dewpoint). (GH/1125, PR/1127). - Indicators that do not care about the input frequency of the data will not check the cell methods of their inputs. (PR/1128).
- Fixed the signature and docstring of
heat_indexby changingtasmaxtotas. (GH/1126, PR/1128). - Fixed a formatting issue with virtual indicator modules (
_gen_returns_section) that was creating malformedReturnssections insphinx-generated documentation. (PR/1131). - Fix
biological_effective_degree_daysfor non-scalar latitudes, when using method "gladstones". (GH/1136, PR/1137). - Fixed some
extlinkwarnings found insphinxand configured ReadTheDocs to usemambaas the dependency solver. (GH/1139, PR/1140). - Fixed some broken hyperlinks to articles, users, and external documentation throughout the code base and jupyter notebooks. (PR/1160).
- Removed some artefact reference roles introduced in PR/1131 that were causing LaTeX builds of the documentation to fail. (GH/1154, PR/1156).
- Fix
biological_effective_degree_daysfor non-scalar latitudes, when using method "gladstones". (GH/1136, PR/1137). - Fixed some
extlinkwarnings found insphinxand configured ReadTheDocs to usemambaas the dependency solver. (GH/1139, PR/1140). - Fixed some broken hyperlinks to articles, users, and external documentation throughout the code base and jupyter notebooks. (PR/1160).
- Addressed a bug that was causing
pylintto stackoverflow by removing it from the tox configuration.pylintshould only be called from an active environment. (PR/1163) - Fixed kmeansreduceensemble breaking when using dask arrays (PR/1170)
- Addressed a bug that was causing
pylintto stackoverflow by removing it from the tox configuration.pylintshould only be called from an active environment. (PR/1163)
Internal changes
- Marked a test (
test_release_notes_file_not_implemented) that can only pass when source files are available so that it can easily be skipped on conda-forge build tests. (GH/1116, PR/1117). - Split a few YAML strings found in the virtual modules that regularly issued warnings on the code checking CI steps. (PR/1118).
- Function
xclim.core.calendar.build_climatology_boundsnow exposed via__all__. (PR/1146). - Clarifications added to docstring of
xclim.core.bootstrapping.bootstrap_func. (PR/1146). - Bibliographic references for supporting scientific articles are now found in a bibtex file (
docs/references.bib). These are now made available within the generated documentation usingsphinxcontrib-bibtex. (GH/1094, PR/1131). - Added information URLs to
setup.pyin order to showcase issue tracker and other sites on PyPI page (PR/1156). - Configured the LaTeX build of the documentation to ignore the custom bibliographies, as they were redundant in the generated PDF. (PR/1158).
- Run length encoding (
xclim.indices.run_length.rle) has been optimized. (GH/956, PR/1122). - Added a
sphinx-build -b linkcheckstep to thetox-based"docs"build as well as to the ReadTheDocs configuration. (PR/1160). pylintis now setup to use apylintrcfile, allowing for more granular control of warnings and exceptions. Many errors are still present, so addressing them will need to occur gradually. (PR/1163).- The generic indices
count_level_crossings,count_occurrences,first_occurrence, andlast_occurrenceare now fully tested. (PR/1157). - Adjusted the ANUCLIM indices by removing "ANUCLIM" from their titles, modifying their docstrings, and handling
"op"input in a more user-friendly way. (GH/1055, PR/1169). - Documentation for fire-based indices/indicators has been reorganized to reflect the new submodule structure. (PR/1159).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 3 years ago
xclim - v0.37.0
Contributors to this version: Abel Aoun (@bzah), Pascal Bourgault (@aulemahal), Trevor James Smith (@Zeitsperre), Gabriel Rondeau-Genesse (@RondeauG), Juliette Lavoie (@juliettelavoie), Ludwig Lierhammer (@ludwiglierhammer).
Announcements
xclimis now compliant with PEP 563. Python3.10-style annotations are now permitted. (GH/1065, PR/1071).xclimis now fully compatible withxarray'sflox-enabledGroupByandresampleoperations. (PR/1081).xclimnow (properly) enforces docstring compliance checks usingpydocstylewith modifiednumpy-style docstrings. Docstring errors will now cause build failures. See the pydocstyle documentation for more information. (PR/1074).xclimnow uses GitHub Actions to manage patch version bumping. Merged Pull Requests that modifyxclimcode now trigger version-bumping automatically when pushed to the main development branch. Running$ bump2version patchwithin development branches is no longer necessary. (PR/1102).
New features and enhancements
- Add "Celsius" to aliases of "celsius" unit. (GH/1067, PR/1068).
- All indicators now have indexing enabled, except those computing statistics on spells. (GH/1069, PR/1070).
- A convenience function for returning the version numbers for relevant xclim dependencies (
xclim.testing.show_versions) is now offered. (PR/1073).- A CLI version of this function is also available from the command line (
$ xclim show_version_info). (PR/1073).
- A CLI version of this function is also available from the command line (
- New "keep_attrs" option to control the handling of the attributes within the indicators. (GH/1026, PR/1076).
- Added a notebook showcasing some simple examples of Spatial Analogues. (GH/585, PR/1075).
create_ensemblesnow accepts a glob string to find datasets. (PR/1081).- Improved percentile based indicators metadata with the window, threshold and climatology period used to compute percentiles. (GH/1047, PR/1050).
- New
xclim.core.calendar.construct_offset, the inverse operation ofparse_offset. (PR/1090). - Rechunking operations in
xclim.indices.run_length.rleare now synchronized with dask's options. (PR/1090). - A mention of the "missing" checks and options is added to the history attribute of indicators, where appropriate. (GH/1100, PR/1103).
Breaking changes
xclim.atmos.water_budgethas been separated intowater_budget(calculated directly with 'evspsblpot') andwater_budget_from_tas(original function). (PR/1086).- Injected parameters in indicators are now left out of a function's signature and will not be included in the history attribute. (PR/1086).
- The signature for the following Indicators have been modified (PR/1050):
- coldspelldurationindex, tg90p, tg10p, tx90p, tx10p, tn90p, tn10p, warmspelldurationindex, daysoverprecipdoythresh, daysoverprecipthresh, fractionoverprecipdoythresh, fractionoverprecipthresh, coldanddrydays, warmanddrydays, warmandwetdays, coldandwetdays
- The parameter for percentile values is now named after the variable it is supposed to be computed upon. (PR/1050).
pytest-runnerhas been removed as a dependency (it was never needed forxclimdevelopment). (PR/1074).xclim.testing._utils.pyhas been renamed toxclim.testing.utils.pyfor added documentation visibility. (PR/1074).- Some unused functions and classes (
as_tuple,TestFile,TestDataSet) have been removed. (PR/1107).
- Some unused functions and classes (
New indicators
universal_thermal_climate_indexandmean_radiant_temperaturefor computing the universal thermal climate index from the near-surface temperature, relative humidity, near-surface windspeed and radiation. (GH/1060, PR/1062).
Internal changes
- Typing syntax has been updated within pre-commit via
isort. Pre-commit hooks now appendfrom __future__ import annotationsto all python module imports for backwards compatibility. (GH/1065, PR/1071) isortproject configurations are now set insetup.cfg. (PR/1071).- Many function docstrings, external target links, and internal section references have been adjusted to reduce warnings when building the docs. (PR/1074).
- Code snippets within documentation are now checked and reformatted to
blackconventions withblackdoc. Apre-commithook is now in place to run these checks. (PR/1098). - Test coverage statistic no longer includes coverage of the test files themselves. Coverage now reflects lines of usable code covered. (PR/1101).
- Reordered listed authors alphabetically. Promoted @bzah to core contributor. (PR/1105).
- Tests have been added for some functions in
xclim.testing.utils.py; some previously uncaught bugs inlist_input_variables,publish_release_notes, andshow_versionshave been patched. (GH/1078, PR/1107). - A convenience command for installing xclim with key development branches of some dependencies has been added (
$ make upstream). (GH/1088, PR/1092; amended in GH/1113, PR/1114).- This build configuration is also available in
toxfor local development purposes ($ tox -e pyXX-upstream).
- This build configuration is also available in
Bug fixes
- Clean the
bias_adjustementandhistoryattributes created byxclim.sdba.adjust(e.g. when an argument is anxr.DataArray, only print the name instead of the whole array). (GH/1083, PR/1087). pydocstylechecks were silently failing in thepre-commitconfiguration due to a badly-formed regex. This has been adjusted. (PR/1074).adjust_doy_calendarwas broken when the source or the target were seasonal. (GH/1097, GH/1091, PR/1099)
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 3 years ago
xclim - v0.36.0
Contributors to this version: Pascal Bourgault (@aulemahal), Juliette Lavoie (@juliettelavoie), David Huard (@huard).
Bug fixes
- Invoking
lazy_indexingtwice in row (or more) using the same indexes (using dask) is now fixed. (GH/1048, PR/1049). - Filtering out the nans before choosing the first and last values as
fill_valuein_interp_on_quantiles_1D. (GH/1056, PR/1057). - Translations from virtual indicator modules do not override those of the base indicators anymore. (GH/1053, PR/1058).
- Fix mmday unit definition (factor 1000 error). (GH/1061, PR/1063).
New features and enhancements
xclim.sdba.measures.rmseandxclim.sdba.measures.maenow usenumpyinstead ofsklearn. This improves their performances when usingdask. (PR/1051).- Argument
append_endsadded tosdba.unpack_moving_yearly_window(PR/1059).
Internal changes
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 3 years ago
xclim - v0.35.0
Contributors to this version: David Huard (@huard), Trevor James Smith (@Zeitsperre) and Pascal Bourgault (@aulemahal).
New indicators
- New indicator
specific_humidity_from_dewpoint, computing specific humidity from the dewpoint temperature and air pressure. (GH/864, PR/1027)
New features and enhancements
- New spatial analogues method "szekely_rizzo" (PR/1033).
- Loess smoothing (and detrending) now skip NaN values, instead of propagating them. This can be controlled through the
skipnaargument. (PR/1030).
Bug fixes
xclim.analog.spatial_analogsis now compatible with dask-backed DataArrays. (PR/1033).- Parameter
dminadded to spatial analog method "zech_aslan", to avoid singularities on identical points. (PR/1033). xclimis now compatible with changes inxarraythat enabled explicit indexing operations. (PR/1038, xarray PR).
Internal changes
xclimnow uses thecheck-jsonandpretty-format-jsonpre-commit checks to validate and format JSON files. (PR/1032).- The few
loggingartifacts in thexclim.ensemblesmodule have been replaced withwarnings.warncalls or removed. (GH/1039, PR/1044).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 3 years ago
xclim - v0.34.0
Contributors to this version: Pascal Bourgault (@aulemahal), Trevor James Smith (@Zeitsperre), David Huard (@huard), Aoun Abel (@bzah).
Announcements
xclimnow officially supports Python3.10. (PR/1013).
Breaking changes
- The version pin for
bottleneck(<1.4) has been lifted. (PR/1013). packaginghas been removed from thexclimrun dependencies. (PR/1013).Quantile mapping adjustment objects (EQM, DQM and QDM) and
sdba.utils.equally_spaced_nodeswill not add additional endpoints to the quantile range. With those endpoints, variables are capped to the reference's range in the historical period, which can be dangerous with high variability in the extremes (ex: pr), especially if the reference doesn't reproduce those extremes credibly. (GH/1015, PR/1016). To retrieve the same functionality as before use: ``` from xclim import sdbaNQ is the the number of equally spaced nodes, the argument previously given to nquantiles directly.
EQM = sdba.EmpiricalQuantileMapping.train(ref, hist, nquantiles=sdba.equallyspacednodes(NQ, eps=1e-6), ...) ```
The "history" string attribute added by xclim has been modified for readability: (GH/963, PR/1018).
- The trailing dot (
.) was dropped. Noneinputs are now printed as "None" (and not ""). - Arguments are now always shown as keyword-arguments. This mostly impacts
sdbafunctions, as it was already the case forIndicators.
- The trailing dot (
The
cell_methodsstring attribute appends only the operation from the indicator itself. In previous version, some indicators also appended the input data's owncell_method. The clix-meta importer has been modified to follow the same convention. (GH/983, PR/1022)
New features and enhancements
publish_release_notesnow leverages much more regular expression logic for link translations to markdown. (PR/1023).- Improve performances of percentile bootstrap algorithm by using
xarray.map_block(GH/932, PR/1017).
Bug fixes
- Loading virtual python modules with
build_indicator_module_from_yamlis now fixed on some systems where the current directory was not part of python's path. Furthermore, paths of the python and json files can now be passed directly to theindicesandtranslationsarguments, respectively. (GH/1020, PR/1021).
Internal changes
- Due to an upstream bug in
bottleneck's support of virtualenv,toxbuilds for Python3.10 now depend on a patched fork ofbottleneck. This workaround will be removed once the fix is merged upstream. (PR/1013, see: bottleneck PR/397).- This has been removed with the release of bottleneck version 1.3.4. (PR/1025).
- GitHub CI actions now use the deadsnakes python PPA Action for gathering the Python3.10 development headers. (PR/1013).
- The "is_dayofyear" attribute added by several indices is now a
numpy.int32instance, instead of python'sint. This ensures a THREDDS server can read it when the variable is saved to a netCDF file withxarray/netCDF4-python. (GH/980, PR/1019).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre almost 4 years ago
xclim - v0.33.2
Contributors to this version: Pascal Bourgault (@aulemahal), Juliette Lavoie (@juliettelavoie), Trevor James Smith (@Zeitsperre).
Announcements
xclimno longer supports Python3.7. Code conventions and new features for Python3.8 (PEP 569) are now accepted. (GH/966, PR/1000).
Breaking changes
- Python3.7 (PEP 537)support has been officially deprecated. Continuous integration testing is no longer run against this version of Python. (GH/966, PR/1000).
Bug fixes
- Adjusted behaviour in
dataflags.ecad_compliantto removedata_varsof invalids checks that returnNone, causing issues withdask. (PR/1002). - Temporarily pinned
ipythonbelow version 8.0 due to behaviour causing hangs in GitHub Actions and ReadTheDocs. (GH/1005, PR/1006). indices.statsmethods where adapted to handle dask-backed arrays. (GH/1007, PR/1011).sdba.utils.interp_on_quantiles, withextrapolation='constant', now interpolates the limits of the interpolation along the time grouping index, fixing an issue with "time.month" grouping. (GH/1008, PR/1009).
Internal changes
pre-commitnow uses Black 22.1.0 with Python3.8 style conventions. Existing code has been adjusted. (PR/1000).toxbuilds for Python3.7 have been deprecated. (PR/1000).- Docstrings and documentation has been adjusted for grammar and typos. (PR/1000).
sdba.utils.extrapolate_qmhas been removed, as announced for xclim 0.33. (PR/1009).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre almost 4 years ago
xclim - v0.33.0
Contributors to this version: Trevor James Smith (@Zeitsperre), Pascal Bourgault (@aulemahal), Tom Keel (@Thomasjkeel), Jeremy Fyke (@JeremyFyke), David Huard (@huard), Abel Aoun (@bzah), Juliette Lavoie (@juliettelavoie), Yannick Rousseau (@yrouranos).
Announcements
- Deprecation: Release 0.33.0 of
xclimwill be the last version to explicitly support Python3.7 andxarray<0.21.0. xclimnow requires yaml files to passyamllintchecks on Pull Requests. (PR/981).xclimnow requires docstrings have valid ReStructuredText formatting to pass basic linting checks. (PR/993). Checks generally require:- Working hyperlinks and reference tags.
- Valid content references (e.g.
:py:func:). - Valid NumPy-formatted docstrings.
- The
xclimdeveloper community has now adopted the 'Contributor Covenant' Code of Conduct v2.1 (text <https://www.contributor-covenant.org/version/2/1/code_of_conduct/>_). (GH/948, PR/996).
New indicators
jetstream_metric_woollingsindicator returns latitude and strength of jet-stream in u-wind field. (GH/923, PR/924).
New features and enhancements
- Features added and modified to allow proper multivariate adjustments. (PR/964).
- Added
xclim.sdba.processing.to_additive_spaceandxclim.sdba.processing.from_additive_spaceto transform "multiplicative" variables to the additive space. An example of multivariate adjustment using this technique was added to the "Advanced" sdba notebook. xclim.sdba.processing.normalizenow also returns the norm.xclim.sdba.processing.jitterwas created by combining the "under" and "over" methods.xclim.sdba.adjustment.PrincipalComponentwas modified to have a simpler signature. The "full" method for finding the best PC orientation was added. (GH/697).
- Added
- New
xclim.indices.stats.parametric_cdffunction to facilitate the computation of return periods over DataArrays of statistical distribution parameters (GH/876, PR/984). - Add
copyparameter topercentile_doyto control if the array input can be dumped after computing percentiles (GH/932, PR/985). - New improved algorithm for
dry_spell_total_length, performing the temporal indexing at the right moment and with control on the aggregation operator (op) for determining the dry spells. - Added
properties.pyandmeasures.pyin order to perform diagnostic tests of sdba (GH/424, PR/967). - Update how
percentile_doyrechunk the input data to preserve the initial chunk size. This should make the computation memory footprint more predictable (GH/932, PR/987).
Breaking changes
- To reduce import complexity,
select_timehas been refactored/moved fromxclim.indices.generictoxclim.core.calendar. (GH/949, PR/969). - The stacking dimension of
xclim.sdba.stack_variableshas been renamed to "multivar" to avoid name conflicts with the "variables" property of xarray Datasets. (PR/964). xclimnow requirescf-xarray>=0.6.1. (GH/923, PR/924).xclimnow requiresstatsmodels. (GH/424, PR/967).
Internal changes
- Added a CI hook in
.pre-commit-config.yamlto perform automatedpre-commitcorrections with GitHub CI. (PR/965). - Adjusted CI hooks to fail earlier if
lintchecks fail. (PR/972). TrainAdjustandAdjustobject have a newskip_input_checkskeyword arg to theirtrainandadjustmethods. WhenTrue, all unit-, calendar- and coordinate-related input checks are skipped. This is an ugly solution to disappearing attributes when usingxr.map_blockswith dask. (PR/964).- Some slow tests were marked
slowto help speed up the standard test ensemble. (PR/969).- Tox testing ensemble now also reports slowest tests using the
--durationsflag.
- Tox testing ensemble now also reports slowest tests using the
pintno longer emits warnings about redefined units when theloggingmodule is loaded. (GH/990, PR/991).- Added a CI step for cancelling running workflows in pull requests that receive multiple pushes. (PR/988).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre almost 4 years ago
xclim - v0.32.0
Contributors to this version: Pascal Bourgault (@aulemahal), Travis Logan (@tlogan2000), Trevor James Smith (@Zeitsperre), Abel Aoun (@bzah), David Huard (@huard), Clair Barnes (@clairbarnes), Raquel Alegre (@raquel-ucl), Jamie Quinn (@JamieJQuinn), Maliko Tanguy (@malngu), Aaron Spring (@aaronspring).
Announcements
- Code coverage (
coverage/coveralls) is now a required CI check for merging Pull Requests. Requirements are now:- No individual run may report <80% code coverage.
- Some drop in coverage is now tolerable, but runs cannot dip below -0.25% relative to the main branch.
New features and enhancements
- Added an optimized pathway for
xclim.indices.run_lengthfunctions whenwindow=1. (PR/911, GH/910). - The data input frequency expected by
Indicatoris now in thesrc_freqattribute and is thus controllable by subclassing existing indicators. (GH/898, PR/927). - New
**indexerkeyword args added to many indicators, it accepts the same arguments asxclim.indices.generic.select_time, which has been improved. Unless otherwise specified, the time selection is done before any computation. (PR/934, GH/899). - Rewrite of
xclim.sdba.ExtremeValues, now fixed with a correct algorithm. It has not been tested extensively and should be considered experimental. (PR/914, GH/789, GH/790). - Added
days_over_precip_doy_threshandfraction_over_precip_doy_threshindicators to distinguish between WMO and ECAD definition of the Rxxp and RxxpTot indices. (GH/931, PR/940). - Update
xclim.core.utils.nan_calc_percentilesto improve maintainability. (PR/942). - Added
heat_indexindicator. Addedheat_indexindicator. This is similar tohumidexbut uses a different dew point as well as heat balance equations which account for variables other than vapor pressure. (GH/807) and (PR/915). - Added alternative method for
xclim.indices.potential_evapotranspirationbased onmcguinnessbordne05(from Tanguay et al. 2018). (PR/926, GH/925). - Added
snw_maxandsnw_max_doyindicators to compute the maximum snow amount and the day of year of the maximum snow amount respectively. (GH/776, PR/950). - Added index for calculating ratio of convective to total precipitation. (GH/920, PR/921).
- Added
wetdays_propindicator to calculate the proportion of days in a period where the precipitation is greater than a threshold. (PR/919, GH/918).
Breaking changes
- Following version 1.9 of the CF Conventions, published in September 2021, the calendar name "gregorian" is deprecated.
core.calendar.get_calendarwill return "standard", even if the underlying cftime objects still use "gregorian" (cftime <= 1.5.1). (PR/935). xclim.sdba.utils.extrapolate_qmis now deprecated and will be removed in version 0.33. ([PR/941](https://github.com/Ourano- Dependency
pintminimum necessary version is now 0.10. (PR/959). sinc/xclim/pull/941)).
Internal changes
- Removed some logging configurations in
xclim.core.dataflagsthat were polluting python's main logging configuration. (PR/909). - Synchronized logging formatters in
xclim.ensemblesandxclim.core.utils. (PR/909). - Added a helper function for generating the release notes with dynamically-generated ReStructuredText or Markdown-formatted hyperlinks (PR/922, GH/907).
- Split of resampling-related functionality of
Indicatorinto newResamplingIndicatorandResamplingIndicatorWithIndexingsubclasses. The use of new (private) methods makes it easier to inject functionality in indicator subclasses. (GH/867, PR/927, PR/934). - French translation metadata fields are now cleaner and much more internally consistent, and many empty metadata fields (e.g.
comment_fr) have been removed. (PR/930, GH/929). - Adjustments to the
toxbuilds so that slow tests are now run alongside standard tests (for more accurate coverage reporting). (PR/938). - Use
xarray.apply_ufuncto vectorize statistical functions. (PR/943). - Refactor of
xclim.sdba.utils.interp_on_quantilesso that it now handles the extrapolation directly and to better handle missing values. (PR/941). - Updated
heating_degree_daysandfraction_over_precip_threshdocumentations. (GH/952, PR/953). - Added an intersphinx mapping to xarray. (PR/955).
- Added a CodeQL security analysis GitHub CI hook on push to master and on Friday nights. (PR/960).
Bug fixes
- Fix bugs in the
cf_attrsand/orabstractofcontinuous_snow_cover_endandcontinuous_snow_cover_start. (PR/908). - Remove unnecessary
keep_attrsfromresamplecall which would raise an error in futur Xarray version. (PR/937). - Fixed a bug in the regex that parses usernames in the history. (PR/945).
- Fixed a bug in
xclim.indices.generic.doymaxandxclim.indices.generic.doyminthat prevented the use of the functions on multidimensional data. (PR/950, GH/951). - Skip all missing values in
xclim.sdba.utils.interp_on_quantiles, drop them from both the old and new coordinates, as well as from the old values. (PR/941). - "degreesnorth" and "degreeseast" (and their variants) are now considered independent units, so that
pintandxclim.core.units.ensure_cf_unitsdon't convert them to "deg". (PR/959). - Fixed a bug in
xclim.core.dataflagsthat would misidentify the "extra" variable to be called when running multivariate checks. (PR/957, GH/861).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre about 4 years ago
xclim - v0.31.0
Contributors to this version: Abel Aoun (@bzah), Pascal Bourgault (@aulemahal), David Huard (@huard), Juliette Lavoie (@juliettelavoie), Travis Logan (@tlogan2000), Trevor James Smith (@Zeitsperre).
New indicators
thawing_degree_daysindicator returns degree-days above a default ofthresh="0 degC". (PR/895, GH/887).freezing_degree_daysindicator returns degree-days below a default ofthresh="0 degC". (PR/895, GH/887).- Several frost-free season calculations are now available as both indices and indicators. (PR/895, GH/887):
frost_free_season_startfrost_free_season_endfrost_free_season_length
growing_season_startis now offered as an indice and as an indicator to complement other growing season-based indicators (threshold calculation withop=">="). (PR/895, GH/887).
New features and enhancements
- Improve cell_methods checking to search the wanted method within the whole string. (PR/866, GH/863).
- New
align_on='randomoption forxclim.core.calendar.convert_calendar, for conversions involving '360_day' calendars. (PR/875, GH/841). dry_spell_frequencynow has a parameterop: {"sum", "max"}to choose if the threshold is compared against the accumulated or maximal precipitation, over the given window. (PR/879).maximum_consecutive_frost_free_daysis now checking that the minimum temperature is above or equal to the threshold ( instead of only above). (PR/883, GH/881).- The ANUCLIM virtual module has been updated to accept weekly and monthly inputs and with improved metadata. (PR/885, GH/538)
- The
sdba.loessalgorithm has been optimized to run faster in all cases, with an even faster special case (equal_spacing=True) when the x coordinate is equally spaced. When activated, this special case might return results different from without, up to around 0.1%. (PR/865). - Add support for group's window and additional dimensions in
LoessDetrend. Add newRollingMeanDetrendobject. (PR/865). - Missing value algorithms now try to infer the source timestep of the input data when it is not given. (PR/885).
- On indices,
bootstrapparameter documentation has been updated to explain when and why it should be used. (PR/893, GH/846).
Breaking changes
- Major changes in the YAML schema for virtual submodules, now closer to how indicators are declared dynamically, see the doc for details. (PR/849, GH/848).
- Removed
xclim.generic.daily_downsampler, as it served no purpose now that xarray's resampling works with cftime (PR/888, GH/889). - Refactor of
xclim.core.calendar.parse_offset, output types were changed to useful ones (PR/885). - Major changes on how parameters are passed to indicators. (PR/873):
- Their signature is now consistent : input variables (DataArrays, optional or not) are positional or keyword arguments and all other parameters are keyword only. (GH/855, GH/857)
- Some indicators have modified signatures because we now rename variables when wrapping generic indices. This is the case for the whole cf module, for example.
Indicator.parametersis now a property generated fromIndicator._all_parameters, as the latter includes the injected parameters. The keys of the former are instances of newxclim.core.indicator.Parameter, and not dictionaries as before.- New
Indicator.injected_parametersto see which compute function arguments will be injected at call time. - See the pull request (PR/873) for all information.
- The call signature for
huglin_indexhas been modified to reflect the correct variables used in its formula (tasmin->tas;thresh_tasmin->thresh). (PR/903, GH/902).
Internal changes
- Pull Request contributions now require hyperlinks to the issue and pull request pages on GitHub listed alongside changess in HISTORY.rst. (PR/860,GH/854).
- Updated the contribution guidelines to better give credit to contributors and more easily track changes. (PR/869, GH/868).
- Enabled coveralls code coverage reporting for GitHub CI. (PR/870).
- Added automated TestPyPI and PyPI-publishing workflows for GitHub CI. (PR/872).
- Changes on how indicators are constructed. (PR/873).
- Added missing algorithms tests for conversion from hourly to daily. (PR/888).
- Updated pre-commit hooks to use black v21.10.b0. (PR/896).
- Moved
stack_variables,unstack_variables,construct_moving_yearly_windowandunpack_moving_yearly_windowfromxclim.sdba.basetoxclim.sdba.processing. They still are imported inxclim.sdbaas before. (PR/892). - Many improvements to the documentation. (PR/892, GH/880).
- Added regex replacement handling in setup.py to facilitate publishing contributor/contribution links on PyPI. (PR/906).
Bug fixes
- Fix a bug in bootstrapping where computation would fail when the dataset time coordinate is encoded using
cftime.datetime. (PR/859). - Fix a bug in
build_indicator_module_from_yamlwhere bases classes (Daily, Hourly, etc) were not usable with thebasefield. (PR/885). percentile_doyalpha and beta parameters are now properly transmitted to bootstrap calls of this function. (PR/893, GH/846).- When called with a 1D da and ND index,
xclim.indices.run_length.lazy_indexingnow drops the auxiliary coordinate corresponding to da's index. This fixes a bug with ND data inxclim.indices.run_length.season. (PR/900). - Fix name of heating degree days in French (
"chauffe"-> "chauffage"). (PR/895). - Corrected several French indicator translation description strings (bad usages of
"."indescriptionandlong_namefields). (PR/895). - Fixed an error with the formula for
huglin_indexwheretasminwas being used in the calculation instead oftas. (PR/903, GH/902).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre about 4 years ago
xclim - v0.30.0
New indicators
climatological_mean_doyindice returns the mean and standard deviation across a climatology according to day-of-year (xarray.DataArray.groupby("time.dayofyear")). A moving window averaging of days can also be supplied (default:window=1).within_bnds_doyindice returns a boolean array indicating whether or not array's values are within bounds for each day of the year.- Added
atmos.wet_precip_accumulation, an indicator accumulating precipitation over wet days. - Module ICCLIM now includes
PRCPTOT, which accumulates precipitation for days with precipitation above 1 mm/day.
New features and enhancements
xclim.core.utils.nan_calc_percentilesnow uses a custom algorithm instead ofnumpy.nanpercentilesto have more flexibility on the interpolation method. The performance is also improved.xclim.core.calendar.percentile_doynow uses the 8th method of Hyndman & Fan for linear interpolation (alpha = beta = 1/3). Previously, the function used Numpy's percentile, which corresponds to the 7th method. This change is motivated by the fact that the 8th is recommended by Hyndman & Fay, and it ensures consistency with other climate indices packages (climdex,icclim). Usingalpha = beta = 1restores the previous behaviour.xclim.core.utils._cal_percis now only a proxy forxc.core.utils.nan_calc_percentileswith some axis moves.xclimnow implements many data quality assurance flags (xclim.core.dataflags) for temperature and precipitation based onICCLIM documentation guidelines <https://eca.knmi.nl/documents/atbd.pdf>_. These checks include the following:- Temperature (variables:
tas,tasmin,tasmax):tasmax_below_tasmin,tas_exceeds_tasmax,tas_below_tasmin,temperature_extremely_low(thresh="-90 degC"),temperature_extremely_high(thresh="60 degC"). - Precipitation-specific (variables:
pr,prsn, ):negative_accumulation_values,very_large_precipitation_events(thresh="300 mm d-1"). - Wind-specific (variables:
sfcWind,wsgsmax/sfcWindMax):wind_values_outside_of_bounds - Generic:
outside_n_standard_deviations_of_climatology,values_repeating_for_n_or_more_days,values_op_thresh_repeating_for_n_or_more_days,percentage_values_outside_of_bounds.
These quality-assurance checks are selected according to CF-standard variable names, and can be triggered via
xclim.core.dataflags.data_flags(xarray.DataArray, xarray.Dataset). These checks are separate from the Indicator-defineddatachecksand must be launched manually. They'll return an array of dataflags as boolean variables. If called with `raiseflags=True`, will raise an Exception with comments for each quality control check raised.- Temperature (variables:
A convenience function (
xclim.core.dataflags.ecad_compliant) is also offered as a method for asserting that data adheres to all relevant ECAD/ICCLIM checks. For more information on usage, consult the docstring/documentation.A new utility "
dataflags" is also available for performing fast quality control checks from the command-line (xclim dataflags --help). See the CLI documentation page for usage examples.Added missing typed call signatures, expected returns and docstrings for many
xclim.core.calendarfunctions.
Breaking changes
- All "ANUCLIM" indices and indicators have lost their
src_timestepargument. Most of them were not using it and now every function infers the frequency from the data directly. This may add stricter constraints on the time coordinate, the same as forxarray.infer_freq. - Many functions found within
xclim.core.cfchecks(generate_cfcheckandcheck_valid_*) have been removed as existing indicator CF-standard checks and data checks rendered them redundant/obsolete.
Bug fixes
- Fixes in
sdbafor (1) inputs with dimensions without coordinates, for (2)sdba.detrending.MeanDetrendand for (3)DetrendedQuantileMappingwhen used with dask's distributed scheduler. - Replaced instances of
'◦'("White bullet") with'°'("Degree Sign") inicclim.yamlas it was causing issues for non-UTF8 environments. - Addressed an edge case where
test_sdba::test_standardizerandomness could generate values that surpass the test error tolerance. - Added a missing
.txtfile to the MANIFEST of the source distributable in order to be able to run all tests. xc.core.units.rate2amountis now exact when the sampling frequency is monthly, seasonal or yearly. Earlier, monthly and yearly data were computed using constant month and year length. End-of-period frequencies are also correctly understood (ex: "M" vs "MS").- In the
potential_evapotranspirationindice, add abbreviatedmethodnames to docstring. - Fixed an issue that prevented using the default
grouparg in adjustment objects. - Fix bug in
missing_wmo, where a period would be considered valid if all months met WMO criteria, but complete months in a year were missing. Now, if any month does not meet criteria or is absent, the period will be considered missing. - Fix bootstrapping with dask arrays. Dask does not support using
locwith multiple indexes to set new values, so a workaround was necessary. - Fix bootstrapping when the bootstrapped year must be converted to a 366_day calendar.
- Virtual modules and translations now use 'UTF-8' by default when reading yaml or json file, instead of a machine-dependent encoding.
Internal Changes
xclimcode quality checks now use the newestblack(v21.8-beta). Checks launched viatoxandpre-commitnow run formatting modifications over Jupyter notebooks found underdocs.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre about 4 years ago
xclim - v0.29.0
Announcements
- It was found that the
ExtremeValuesadjustment algorithm was not as accurate and stable as first thought. It is now hidden fromxclim.sdbabut can still be accessed viaxclim.sdba.adjustment, with a warning. Work on improving the algorithm is ongoing, and a better implementation will be in a future version. - It was found that the
add_dimsargument ofsdba.Grouperhad some caveats throughoutsdba. This argument is to be used with care before a careful analysis and more testing is done withinxclim.
Breaking changes
xclimhas switched back to updating thehistoryattribute (instead ofxclim_history). This impacts all indicators, most ensemble functions,percentile_doyandsdba.processing(see below).- Refactor of
sdba.processing. Now all functions take one or more dataarrays as input, plus some parameters. And output one or more dataarrays (not Datasets). Units and metadata is handled. This impactssdba.processing.adapt_freqespecially. - Add unit handling in
sdba. Most parameters involving quantities are now expecting strings (and not numbers). Adjustment objects will ensure ref, hist and sim all have the same units (taking ref as reference). - The Adjustment
classes ofxclim.sdba` have been refactored into 2 categories:TrainAdjustobjects (most of the algorithms), which are created and trained in the same call:obj = Adj.train(ref, hist, **kwargs). The.adjuststep stays the same.Adjustobjects (onlyNpdfTransform), which are never initialized. Theiradjustclass method performs all the work in one call.
snowfall_approximationused a"<"condition instead of"<="to determine the snow fraction based on the freezing point temperature. The new version sticks to the convention used in the Canadian Land Surface Scheme (CLASS).- Removed the
"gis","docs","test"and"setup"extra dependencies fromsetup.py. Thedevrecipe now includes all tools needed for xclim's development.
New features and enhancements
snowfall_approximationhas gained support for new estimation methods used in CLASS: 'brown' and 'auer'.- A
ValidationErrorwill be raised if temperature units are given as 'deg C', which is misinterpreted by pint. - Functions computing run lengths (sequences of consecutive
"True"values) now take theindexargument. Possible values arefirstandlast, indicating which item in the run should be used to index the run length. The default is set to"first", preserving the current behavior. - New
sdba_encode_cfoption to workaround a cftime/xarray performance issue when using dask.
New indicators
effective_growing_degree_daysindice returns growing degree days using dynamic start and end dates for the growing season (based on Bootsma et al. (2005)). This has also been wrapped as an indicator.qian_weighted_mean_average(based on Qian et al. (2010)) is offered as an alternate method for determining the start date using a weighted 5-day average (method="qian"). Can also be used directly as an indice.cold_and_dry_daysindicator returns the number of days where the mean daily temperature is below the 25th percentile and the mean daily precipitation is below the 25th percentile over period. Added asCDindicator to ICCLIM module.warm_and_dry_daysindicator returns the number of days where the mean daily temperature is above the 75th percentile and the mean daily precipitation is below the 25th percentile over period. Added asWDindicator to ICCLIM module.warm_and_wet_daysindicator returns the number of days where the mean daily temperature is above the 75th percentile and the mean daily precipitation is above the 75th percentile over period. Added asWWindicator to ICCLIM module.cold_and_wet_daysindicator returns the number of days where the mean daily temperature is below the 25th percentile and the mean daily precipitation is above the 75th percentile over period. Added asCWindicator to ICCLIM module.calm_daysindicator returns the number of days where surface wind speed is below threshold.windy_daysindicator returns the number of days where surface wind speed is above threshold.
Bug fixes
- Various bug fixes in bootstrapping:
- in
percentile_bootstrapdecorator, fix the popping of bootstrap argument to propagate in to the function call. - in
bootstrap_func, fix some issues with the resampling frequency which was not working when anchored.
- in
- Made argument
threshofsdba.LOCIrequired, as not giving it raised an error. Made defaults explicit in the adjustments docstrings. - Fixes in
sdba.processing.adapt_freqandsdba.nbutils.vecquantileswhen handling all-nan slices. - Dimensions in a grouper's
add_dimsare now taken into consideration in function wrapped withmap_blocks/groups. This feature is still not fully tested throughoutsdbathough, so use with caution. - Better dtype preservation throughout
sdba. - "constant" extrapolation in the quantile mappings' adjustment is now padding values just above and under the target's max and min, instead of
±np.inf. - Fixes in
sdba.LOCIfor the case where a grouping with additionnal dimensions is used.
Internal Changes
- The behaviour of
xclim.testing._utils.getfilewas adjusted to launch file download requests for web-hosted md5 files for every call to compare against local test data. This was done to validate that locally-stored test data is identical to test data available online, without resorting to git-based actions. This approach may eventually be revised/optimized in the future.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 4 years ago
xclim - v0.28.1
Announcements
- The
xclimbinary package available on conda-forge will no longer supplyclisopsby default. Installation ofclisopsmust be performed explicitly to preserve subsetting capabilities.
New indicators
snow_depthindicator returns the mean snow depth over period. Added asSDto ICCLIM module.
Internal Changes
- Minor modifications to many function call signatures (type hinting) and docstrings (numpy docstring compliance).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 4 years ago
xclim - v0.28.0
New features and enhancements
- Automatic load of translations on import and possibility to pass translations for virtual modules.
- New
xclim.testing.list_datasetsfunction listing all available test datasets in repoxclim-testdata. spatial_analogsaccepts multi-indexes as thedist_dimparameter and will work with candidates and target arrays of different lengths.humidexcan be computed using relative humidity instead of dewpoint temperature.- New
sdba.construct_moving_yearly_windowandsdba.unpack_moving_yearly_windowfor moving window adjustments. - New
sdba.adjustment.NpdfTransformwhich is an adaptation of Alex Cannon's version of Pitié's N-dimensional probability density function transform. Uses newsdba.utils.rand_rot_matrix. Experimental, subject to changes. - New
sdba.processing.standardize,.unstandardizeand.reordering. All of them, tools needed to replicate Cannon's MBCn algorithm. - New
sdba.processing.escore, backed bysdba.nbutils._escoreto evaluate the performance of the N pdf transform. - New function
xclim.indices.clausius_clapeyron_scaled_precipitationcan be used to scale precipitation according to changes in mean temperature. - Percentile based indices gained a
bootstrapargument that applies a bootstrapping algorithm to reduce biases on exceedance frequencies computed over in base and out of base periods. Experimental, subject to changes. - Added a
.zenodo.jsonfile for collecting and maintaining author order and tracking ORCIDs.
Bug fixes
Various bug fixes in sdba :
- in
QDM.adjust, fix bug occuring with coords of 'object' dtype andinterp='nearest'. - in
nbutils.quantiles, fix dtype bug when usingfloat32data. - raise a proper error when
refandhisthave a different calendar for map_blocks-backed adjustments.
- in
Breaking changes
spatial_analogsdoes not support sequence ofdist_dimanymore. Users are responsible for stacking dimensions prior to callingspatial_analogs.
New indicators
biologically_effective_degree_days(withmethod="gladstones") indice computes degree-days between two specific dates, with a capped daily max value as well as latitude and temperature range swing as modifying coefficients (based on Gladstones, J. (1992)). This has also been wrapped as an indicator.- An alternative implementation of
biologically_effective_degree_days(withmethod="icclim", based on ICCLIM formula) ignores latitude and temperature range swing modifiers and uses an alternateend_date. Wrapped and available as an ICCLIM indicator. cool_night_indexindice returns the mean minimum temperature in September (lat >= 0deg N) or March (lat < 0deg N), based on Tonietto & Carbonneau, 2004 (10.1016/j.agrformet.2003.06.001). Also available as an indicator (see indicesNotessection on indicator usage recommendations).latitude_temperature_indexindice computes LTI values based on mean temperature of warmest month and a parameterizable latitude coefficient (default:lat_factor=75) based on Jackson & Cherry, 1988, and Kenny & Shao, 1992 (10.1080/00221589.1992.11516243). This has also been wrapped as an indicator.huglin_indexindice computes Huglin Heliothermal Index (HI) values based on growing degrees and a latitude-influenced coefficient for day-length (based on Huglin. (1978)). The indice supports several methods of estimating the latitude coefficient:method="smoothed": Marks latitudes between -40 N and 40 N withk=1, and linearly increases tok=1.06at|lat|==50.method="icclim": Uses a stepwise function based on the the original method as presented by Huglin (1978). Identical to the ICCLIM implementation.method="jones": Uses a more robust calculation for calculating day-lengths, based on Hall & Jones (2010). This method is now also available forbiologically_effective_degree_days.
The generic indice
day_length, used for calculating approximate daily day-length in hours per day or, givenstart_dateandend_date, the total aggregated day-hours over period. Uses axial tilt, start and end dates, calendar, and approximate date of northern hemisphere summer solstice, based on Hall & Jones (2010).
Internal Changes
aggregate_between_dates(introduced in v0.27.0) now acceptsDayOfYear-like strings for supplying start and end dates (e.g.start="02-01", end="10-31").- The indicator call sequence now considers "variable" the inputs annoted so. Dropped the
nvarattribute. - Default cfcheck is now to check metadata according to the variable name, using CMIP6 names in xclim/data/variable.yml.
Indicator.missingdefaults to "skip" iffreqis absent from the list of parameters.- Minor modifications to the GitHub Pull Requests template.
- Simplification of some yaml elements for virtual modules.
- Allow injecting
freqwithout the missing checks failing.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 4 years ago
xclim - v0.27.0
New features and enhancements
- Rewrite of nearly all adjustment methods in
sdba, with use ofxr.map_blocksto improve scalability with dask. Rewrite of some parts of the algorithms with numba-accelerated code. - "GFWED" specifics for fire weather computation implemented back into the FWI module. Outputs are within 3% of GFWED data.
- Addition of the
run_length_ufuncoption to control which run length algorithm gets run. Defaults stay the same (automatic switch dependent of the input array : the 1D version is used with non-dask arrays with less than 9000 points per slice). - Indicator modules built from YAML can now use custom indices. A mapping or module of them can be given to
build_indicator_module_from_yamlwith theindiceskeyword. - Virtual submodules now include an
iter_indicatorsfunction to iterate over the pairs of names and indicator objects in that module. - The indicator string formatter now accepts a "r" modifier which passes the raw strings instead of the adjective version.
- Addition of the
sdba_extra_outputoption to adds extra diagnostic variables to the outputs of Adjustment objects. Implementation ofsim_qin QuantileDeltaMapping andnclustersin ExtremeValues.
Breaking changes
- The
tropical_nightsindice is being deprecated in favour oftn_days_abovewiththresh="20 degC". The indicator remains valid, now wrapping this new indice. - Results of
sdba.Grouper.applyforGroupers without a group (ex:Grouper('time')) will contain agroupsingleton dimension. - The
daily_freezethaw_cyclesindice is being deprecated in favour ofmultiday_temperature_swingwith temp thresholds at 0 degC andwindow=1, op="sum"`. The indicator remains valid, now wrapping this new indice. CMIP6 variable names have been adopted whenever possible in xclim. Changes are:
sweis nowsnw(snwis the snow amount [kg / m²] andswethe liquid water equivalent thickness [m])rhis nowhursdtasis nowtdpsws(in FWI) is nowsfcWindsicis nowsiconcarea(of sea ice indicators) is nowareacello- Indicators
RHandRH_FROMDEWPOINThave be renamed toHURSandHURS_FROMDEWPOINT. These are changes in the identifiers, the python names (relative_humidity[...]) are unchanged.
New indicators
atmos.corn_heat_unitscomputes the daily temperature-based index for corn growth.- New indices and indicators for
tx_days_below,tg_days_above,tg_days_below, andtn_days_above. atmos.humidexreturns the Canadian humidex, an indicator of perceived temperature account for relative humidity.multiday_temperature_swingindice for returning general statistics based on spells of doubly-thresholded temperatures (Tmin < T1, Tmax > T2).- New indicators
atmos.freezethaw_frequency,atmos.freezethaw_spell_mean_length,atmos.freezethaw_spell_max_lengthfor statistics of Tmin < 0 degC and Tmax > 0 deg C days now available (wrapped frommultiday_temperature_swing). atmos.wind_chill_indexcomputes the daily wind chill index. The default is similar to what Environment and Climate Change Canada does, options are tunable to get the version of the National Weather Service.
Internal Changes
run_length.rle_statisticsnow accepts awindowargument.- Common arguments to the
opparameter now have better adjective and noun formattings. - Added and adjusted typing in call signatures and docstrings, with grammar fixes, for many
xclim.indicesoperations.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 4 years ago
xclim - v0.26.1 (May the fourth be with you)
Bug fixes
- Bug fix release adding
ExtremeValuesto publicly exposed bias-adjustment methods.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 4 years ago
xclim - v0.26.0
Announcements
xclimno longer supports Python3.6. Code conventions and new features from Python3.7 (PEP 537) are now accepted.
New features and enhancements
core.calendar.doy_to_days_sinceanddays_since_to_doyto allow meaningful statistics on doy data.- New bias second-order adjustment method "ExtremeValues", intended for re-adjusting extreme precipitation values.
- Virtual indicators modules can now be built from YAML files.
- Indicators can now be built from dictionaries.
- New generic indices, implementation of
clix-meta's index functions. - On-the-fly generation of climate and forecasting convention (CF) checks with
xc.core.cfchecks.generate_cfcheck, for a few known variables only. - New
xc.indices.run_length.rle_statisticsfor min, max, mean, std (etc) statistics on run lengths. - New virtual submodule
cf, with CF standard indices defined in clix-meta. - Indices returning day-of-year data add two new attributes to the output:
is_dayofyear(=1) andcalendar.
Breaking changes
xclimnow requiresxarray>=0.17.- Virtual submodules
icclimandanuclimare not available at the top level anymore (only throughxclim.indicators). - Virtual submodules
icclimandanuclimnow provide Indicators and not indices. - Spatial analog methods "KLDIV" and "Nearest Neighbor" now require
scipy>=1.6.0.
Bug fixes
from_stringobject creation in sdba has been removed. Now replaced with use of a new dependency,jsonpickle.
Internal Changes
pre-commitlinting checks now run formatting hookblack==21.4b2.- Code cleaning (more accurate call signatures, more use of https links, docstring updates, and typo fixes).
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 4 years ago
xclim - v0.25.0
Announcements
- Deprecation: Release 0.25.0 of
xclimwill be the last version to explicitly support Python3.6 andxarray<0.17.0.
New indicators
land.winter_stormcomputes days with snow accumulation over threshold.land.blowing_snowcomputes days with both snow accumulation over last days and high wind speeds.land.snow_melt_we_maxcomputes the maximum snow melt over n days, andland.melt_and_precip_maxthe maximum combined snow melt and precipitation.snd_max_doyreturns the day of the year where snow depth reaches its maximum value.atmos.high_precip_low_tempreturns days with freezing rain conditions (low temperature and precipitations).land.snow_cover_durationcomputes the number of days snow depth exceeds some minimal threshold.land.continuous_snow_cover_startandland.continuous_snow_cover_endidentify the day of the year when snow depth crosses a threshold for a given period of time.days_with_snow, counts days with snow between low and high thresholds, e.g. days with high amount of snow (indiceandindicatoravailable).fire_season, creates a fire season mask from temperature and, optionally, snow depth time-series.
New features and enhancements
generic.count_domaincounts values within low and high thresholds.run_length.seasonreturns a dataset storing the start, end and length of a season.- Fire Weather indices now support dask-backed data.
- Objects from the
xclim.sdbasubmodule can be created from their string repr or from the dataset they created. - Fire Weather Index submodule replicates the R code of
cffdrs, including fire season determination and overwintering of the drought_code. - New
run_boundsandkeep_longest_runutilities inxclim.indices.run_length. - New bias-adjustment method:
PrincipalComponent(based on Hnilica et al. 2017 https://doi.org/10.1002/joc.4890).
Internal changes
- Small changes in the output of
indices.run_length.rle.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 4 years ago
xclim - v0.24.0
New indicators
days_over_precip_thresh,fraction_over_precip_thresh,liquid_precip_ratio,warm_spell_duration_index, all from eponymous indices.maximum_consecutive_warm_daysfrom indicemaximum_consecutive_tx_days.
Breaking changes
Numerous changes to
xclim.core.calendar.percentile_doy:pernow accepts a sequence as well as a scalar and as such the output has a percentiles axis.perargument is now expected to between 0-100 (not 0-1).- input data must have a daily (or coarser) time frequency.
Change in unit handling paradigm for indices, which as a result will lead to some indices returning values with different units. Note that related
Indicatorobjects remain unchanged and will return units consistent with CF Convention. If you are concerned with code stability, please useIndicatorobjects. The change was necessary to resolve inconsistencies with xarray'skeep_attrs=Truecontext.- Indice functions now return output units that preserve consistency with input units. That is, feeding inputs in Celsius will yield outputs in Celsius instead of casting to Kelvin. In all cases the dimensionality is preserved.
- Indice functions now accept non-daily data, but daily frequency is assumed by default if the frequency cannot be inferred.
Removed the explicitly-installed
netCDF4python library from the base installation, as this is never explicitly used (now only installed in thedocsrecipe for sdba documented example).Removed
xclim.core.checks, which was deprecated since v0.18.
New features and enhancements
- Indicator now have docstrings generated from their metadata.
- Units and fixed choices set are parsed from indice docstrings into
Indicator.parameters. - Units of indices using the
declare_unitsdecorator are stored inindice.in_unitsandindice.out_units. - Changes to
Indicator.formatandIndicator.jsonto ensure the resulting json really is serializable.
Internal changes
- Leave
missing_optionsundefined inland.fitindicator to allow control viaset_options. - Modified
xclim.core.calendar.percentile_doyto improve performance. - New
xclim.core.calendar.compare_offsetsfor comparing offset strings. - New
xclim.indices.generic.get_opto retrieve a function from a string representation of that operator. - The CI pipeline has been migrated from Travis CI to GitHub Actions. All stages are still built using
tox. - Indice functions must always set the units (the
declare_unitsdecorator does no check anymore). - New
xclim.core.units.rate2amoutto convert rates like precipitation to amounts. xclim.core.units.pint2cfunitsnow removes ' * ' symbols and changesΔ°todelta_deg.- New
xclim.core.units.to_agg_unitsandxclim.core.units.infer_sampling_unitsfor unit handling involving aggregation operations along the time dimension. - Added an indicators API page to the docs and links to there from the
Climate Indicatorspage.
Bug fixes
- The unit handling change resolved a bug that prevented the use of
xr.set_options(keep_attrs=True)with indices.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre almost 5 years ago
xclim - v0.23.0
Breaking changes
- Renamed indicator
atmos.degree_days_depassment_datetoatmos.degree_days_exceedance_date. - In
degree_days_exceedance_date: renamed argumentstart_datetoafter_date. - Added cfchecks for Pr+Tas-based indicators.
- Refactored test suite to now be available as part of the standard library installation (
xclim.testing.tests). - Running
pytestwithxdoctestnow requires therootdirto point attestslocation (pytest --rootdir xclim/testing/tests/ --xdoctest xclim). - Development checks now require working jupyter notebooks (assessed via the
pytest --nbvalcommand).
New indicators
rain_approximationandsnowfall_approximationfor computingprlpandprsnfromprandtas(ortasminortasmax) according to some threshold and method.solid_precip_accumulationandliquid_precip_accumulationnow accept athreshparameter to control the binary snow/rain temperature threshold.first_snowfallandlast_snowfallto compute the date of first/last snowfall exceeding a threshold in a period.
New features and enhancements
- New
kindentry in theparametersproperty of indicators, differentiating between [optional] variables and parameters. - The git pre-commit hooks (
pre-commit run --all) now clean the jupyter notebooks withnbstripoutcall.
Bug fixes
- Fixed a bug in
indices.run_length.lazy_indexingthat occurred with 1D coords and 0D indexes when using the dask backend. - Fixed a bug with default frequency handling affecting
fitindicator. - Set missing method to 'skip' for
freq_analysisindicator. - Fixed a bug in
ensembles._ens_align_datasetsthat occurred when inputs are.ncfilepaths but files lack a time dimension.
Internal changes
core.cfchecks.check_validnow accepts a sequence of strings as itsexpectedargument.- Clean up in the tests to speed up testing. Addition of a marker to include "slow" tests when desired (
-m slow). - Fixes in the tests to support
sklearn>=0.24,clisops>=0.5and build xarray@master against python 3.7. - Moved the testing suite to within xclim and simplified
toxto manage its own tempdir. - Indicator class now has a
default_freqmethod.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre almost 5 years ago
xclim - v0.22.0
Breaking changes
- Statistical functions (
frequency_analysis,fa,fit,parametric_quantile) are now solely accessible viaindices.stats.
New indicators
atmos.degree_days_depassment_date, the day of year when the degree days sum exceeds a threshold.
New features and enhancements
- Added unique titles to
atmoscalculations employing wrapped_partials. xclim.core.calendar.convert_calendarnow accepts amissingargument.- Added
xclim.core.calendar.date_rangeandxclim.core.calendar.date_range_likewrapping pandas'date_rangeand xarray'scftime_range. xclim.core.calendar.get_calendarnow accepts many different types of data, including datetime object directly.- New module
xclim.analogand methodxclim.analog.spatial_analogsto compute spatial analogs. - Indicators can now accept dataset in their new
dscall argument. Variable arguments (that use theDataArrayannotation) can now be given with strings that correspond to variable names in the dataset, and default to their own name. - Clarification to
frequency_analysisnotebook. - Now officially supporting PEP596 (Python3.9).
- New methods
xclim.ensembles.change_significanceandxclim.ensembles.knutti_sedlacekto qualify climate change agreement among members of an ensemble.
Bug fixes
- Fixed bug that prevented the use of
xclim.core.missing.MissingBaseand subclasses with an indexer and a cftime datetime coordinate. - Fixed issues with metadata handling in statistical indices.
- Various small fixes to the documentation (re-establishment of some internally and externally linked documents).
Internal changes
- Passing
align_ontoxclim.core.calendar.convert_calendarwithout using '360_day' calendars will not raise a warning anymore. - Added formatting utilities for metadata attributes (
update_cell_methods,prefix_attrsandunprefix_attrs). xclim/ensembles.pymoved toxclim/ensembles/*.py, splitting stats/creation, reduction and robustness methods.- With the help of the
mypylibrary, added several typing fixes to better identify inputs/outputs, and reduce object type mutations. - Fixed some doctests in
ensemblesandset_options. clisopsv0.4.0+ is now an optional requirements for non-Windows builds.- New
xclim.core.units.str2pintmethod to convert quantity strings to quantity objects. Main improvement is to make "3 degC days" a valid string that converts to "3 K days".
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre about 5 years ago
xclim - v0.21.0
Breaking changes
- Statistical functions (
frequency_analysis,fa,fit,parametric_quantile) moved fromindices.generictoindices.statsto make them more visible.
New features and enhancements
- New xclim.testing.open_dataset method to read data from the remote testdata repo.
- Added a notebook,
ensembles-advanced.ipynb, to the documentation detailing ensemble reduction techniques and showing how to make use of built-in figure-generating commands. - Added a notebook,
frequency_analysis.ipynb, with examples showcasing frequency analysis capabilities.
Bug fixes
- Fixed a bug in the attributes of
frost_season_length. indices.run_lengthmethods using dates now respect the array's calendar.- Worked around an xarray bug in sdba.QuantileDeltaMapping when multidimensional arrays are used with linear or cubic interpolation.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre about 5 years ago
xclim - v0.20.0
Breaking changes
xclim.subsethas been deprecated and now relies onclisopsto perform specialized spatio-temporal subsetting. Install withpip install xclim[gis]in order to retain the same functionality.- The python library
pandocis no longer listed as a docs build requirement. Documentation still requires a current version ofpandocbinaries installed at system-level. - ANUCLIM indices have seen their
input_freqparameter renamed tosrc_timestepfor clarity. - A clean-up and harmonization of the indicators metadata has changed some of the indicator identifiers, longnames, abstracts and titles. `xclim.atmos.droughtcode
andfireweatherindexes` now have indentifiers "dc" and "fwi" (lowercase version of the previous identifiers). xc.indices.run_length.run_length_with_datesbecomesxc.indices.run_length.season_length. Its argumentdateis now optional and the default changes from "07-01" toNone.xc.indices.consecutive_frost_daysbecomesxc.indices.maximum_consecutive_frost_days.- Changed the
historyindicator output attribute toxclim_historyin order to respect CF conventions.
New indicators
atmos.max_pr_intensityacting on hourly data.atmos.wind_vector_from_speed, also thewind_speed_from_vectornow also returns the "wind from direction".- Richards-Baker flow flashiness indicator (
xclim.land.rb_flashiness_index). atmos.max_daily_temperature_range.atmos.cold_spell_frequency.atmos.tg_minandatmos.tg_max.atmos.frost_season_length,atmos.first_day_above. Also,atmos.consecutive_frost_daysnow takes athreshargument (default : 0 degC).
New features and enhancements
sdba.loesssubmodule implementing LOESS smoothing tools used insdba.detrending.LoessDetrend.- xclim now depends on clisops for subsetting, offloading several heavy GIS dependencies. This improves maintainability and reduces the size of a "vanilla" xclim installation considerably.
- New
generic.parametric_quantilefunction taking parameters estimated bygeneric.fitas an input. - Add support for using probability weighted moments method in
generic.fitfunction. Requires thelmoments3package, which is not included in dependencies because it is unmaintained. Install manually if needed. - Implemented
_fit_startutility function providing initial conditions for statistical distribution parameters estimation, reducing the likelihood of poor fits. - Added support for indicators based on hourly (1H) inputs, and a first hourly indicator called
max_pr_intensityreturning hourly precipitation intensity. - Indicator instances can be retrieved through their class with the
get_instance()class method. This allows the use ofxclim.core.indicator.registryas an instance registry. - Indicators now have a
realmattribute. It must be given when creating indicators outside xclim. - Better docstring parsing for indicators: parameters description, annotation and default value are accessible in the json output and
Indicator.parameters. - New command line interface
xclimfor simple indicator computing tasks. - New
sdba.processing.jitter_over_threshfor variables with a upper bound. - Added
opparameter toxclim.indices.daily_temperature_rangeto allow resample reduce operations other than mean core.formatting.AttrFormatter(and thus, locale dictionaries) can now use glob-like pattern for matching values to translate.
Bug fixes
- The ICCLIM module was identified as
icclimin the documentation but the module available underICCLIM. Nowicclim == ICCLIMandICCLIM will be deprecated in a future release.
Internal changes
xclim.subsetnow attempts to load and expose the functions ofclisops.core.subset. This is an API workaround preserving backwards compatibility.- Code styling now conforms to the latest release of black (v0.20.8).
- New
IndicatorRegistrarclass that takes care of adding indicator classes and instances to the appropriate registries.Indicatornow inherits from it.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 5 years ago
xclim - v0.19.0
Breaking changes
- Refactoring of the
Indicatorclass. Thecfprobemethod has been renamed tocfcheckand thevalidatemethod has been renamed todatacheck. More importantly, instantiatingIndicatorcreates a new subclass on the fly and stores it in a registry, allowing users to subclass existing indicators easily. The algorithm for missing values is identified by its registered name, e.g. "any", "pct", etc, along with itsmissing_options. - xclim now requires xarray >= 0.16, ensuring that xclim.sdba is fully functional.
- The dev requirements now include
xdoctest-- a rewrite of the standard library module,doctest. xclim.core.locales.get_local_attrsnow uses the indicator's class name instead of the indicator itself and no longer accepts thefill_missingkeyword. Behaviour is now the same as passingFalse.Indicator.cf_attrsis now a list of dictionaries.Indicator.jsonputs all the metadata attributes in the key "outputs" (a list of dicts). All variable metadata (names inIndicator._cf_names) might be strings or lists of strings when accessed as object attributes.- Passing doctests are now strictly enforced as a build requirement in the Travis CI testing ensemble.
New features and enhancements
- New
ensembles.kkz_reduce_ensemblemethod to select subsets of an ensemble based on the KKZ algorithm. - Create new Indicator
Daily,Daily2Dsubclasses for indicators using daily input data. - The
Indicatorclass now supports outputing multiple indices for the same inputs. xclim.core.units.declare_unitsnow works with indices outputting multiple DataArrays.- Doctests now make use of the
xdoctest_namespacein order to more easily access mdoules and tesdata.
Bug fixes
- Fix
generic.fitdimension ordering. This caused errors when "time" was not the first dimension in a DataArray.
Internal changes
datachecks.check_dailynow usesxr.infer_freq.- Indicator subclasses
Tas,Tasmin,Tasmax,PrandStreamflownow inherit fromDaily. - Indicator subclasses
TasminTasmaxandPrTasnow inherit fromDaily2D. - Docstring style now enforced using the
pydocstylewithnumpydoctsring conventions. - Doctests are now performed for all docstring
Examplesusingxdoctest. Failing examples must be explicitly skipped otherwise build will now fail. - Indicator methods
update_attrsandformatare now classmethods, attrs to update must be passed. - Indicators definitions without an accompanying translation (presently French) will cause build failures.
- Major refactoring of the internal marchinery of
Indicatorto support multiple outputs.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 5 years ago
xclim - v0.18.0
0.18.x (2020-06-26)
- Optimization options for
xclim.sdba: different grouping for the normalization steps of DQM and save training or fitting datasets to temporary files. xclim.sdba.detrendingobjects can now act on groups.- Replaced
dask[complete]withdask[array]in basic installation and addeddistributedtodocsbuild dependencies. xclim.core.localesnow supported in Windows build environments.ensembles.ensemble_percentilesmodified to compute along apercentilesdimension by default, instead of creating different variables.- Added indicator
first_day_belowand run length helperfirst_run_after_date. - Added ANUCLIM model climate indices mappings.
- Renamed
areacellatoareacelloin sea ice tests. - Sea ice extent and area outputs now have units of m2 to comply with CF-Convention.
- Split
checks.pyintocfchecks.py,datachecks.pyandmissing.py. This change will only affect users creating custom indices using utilities previously located inchecks.py. - Changed signature of
daily_freeze_thaw_cycles,daily_temperature_range,daily_temperature_range_variabilityandextreme_temperature_rangeto take (tasmin, tasmax) instead of (tasmax, tasmin) and match signature of other similar multivariate indices. - Added
FromContextsubclass ofMissingBaseto have a uniform API for missing value operations. - Remove logging commands that captured all xclim warnings. Remove deprecated xr.set_options calls.
Scientific Software - Peer-reviewed
- Python
Published by aulemahal over 5 years ago
xclim - v0.17.0
0.17.x (2020-05-15)
- Added support for operations on dimensionless variables (
units = '1') - Moved
xclim.localestoxclim.core.localesin a batch of internal changes aimed to removed most potential cyclic imports cases. - Missing checks and input validation refactored with addition of custom missing class registration (
xclim.core.checks.register_missing_method) and simple validation method decorator (xclim.core.checks.check). - New
xclim.set_optionscontext to control the missing checks, input validation and locales. - New
xclim.sdbamodule for statistical downscaling and bias-adjustment of climate data. - Added
convert_calendarandinterp_calendarto help in the conversion between calendars. - Added
at_least_n_validfunction, indentifying null calculations based on minimum threshold. - Added support for
freq=Nonein missing calculations. - Fixed outdated code examples in the docs and docstrings.
- Doctests are now run as part of the test suite.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 5 years ago
xclim - v0.16.0
0.16.0 (2020-04-23)
- Added
vectorizeflag tosubset_shapeandcreate_mask_vectorizefunction based onshapely.vectorizeas default backend for mask creation. - Removed
start_yrandend_yrflags from subsetting functions. - Add multi gridpoints support in
subset.subset_gridpoint. - Better
wrapped_partialfor more meaningful inspection. - Add indices for relative humidity, specific humidity and saturation vapor pressure with a few choices of method.
- Allow lazy units conversion.
- CRS definitions of projected DataSets are now written to file according to Climate and Forecast-convention standards.
- Add utilities to merge attributes and update history in xclim.core.formatting.
- Ensembles : Allow alignment of datasets with same frequency but different offsets.
- Bug fixes in run_length for run-with-dates methods when the date is not found in the run.
- Remove deepcopy from subset.subset_shape to improve memory usage.
- Add
missing_wmofunction, identifying null calculations based on criteria from WMO. - Add
missing_pctfunction, identifying null calculations based on percentage of missing values.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 5 years ago
xclim - v0.15.0
0.15.x (2020-03-12)
- Improvement in FWI: Vectorization of DC, DMC and FFMC with numba and small code refactoring for better maintainability.
- Added example notebook for creating a catalog of selected indices
- Added
growing_season_end,last_spring_frost,dry_days,hot_spell_frequency,hot_spell_max_length, andmaximum_consecutive_frost_free_daysindices. - Dropped use of
fiona.crsclass in lieu of the newer pyproj CRS handler forsubset_shapeoperations. - Completed first phase of internal reorganization of xclim.
- Internationalization of xclim : add
localessubmodule for localized metadata. - Add feature to retrieve coordinate values instead of index in
run_length.first_run. Addrun_length.last_run. - Fix bug in subset_gridpoint to work on lat/lon coords of any dimension when they are not a dimension of the data.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre almost 6 years ago
xclim - v0.14.0
0.14.x (2020-02-21)
- Refactoring of the documentation.
- Added support for pint 0.10
- Add
atmos.heat_wave_total_length(fixing a namespace issue) - Fixes in
utils.percentile_doyandindices.winter_rain_ratiofor multidimensionnal datasets. - Rewrote the
subset.subset_shapefunction to allow for dask.delayed (lazy) computation. - Added utility functions to compute
time_bndswhen resampling data encoded withCFTimeIndex(non-standard calendars). - Fix in
subset.subset_gridpointfor dask array coordinates. - Modified
subset_shapeto support subsetting with GeoPandas datatypes directly. - Fix in
subset.wrap_lons_and_split_at_greenwichto preserve multi-region dataframes. - Improve the memory use of
indices.growing_season_length. - Better handling of data with atypically named
latandlondimensions. - Added six Fire Weather indices.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre almost 6 years ago
xclim - v0.12.3
This version includes many changes:
- Addition of polygon-based subsetting to the
subsetutilities - More robust methods for calculating frozen and liquid precipitation
This version is also the final release supporting Python3.5.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre about 6 years ago
xclim - v0.11.0-beta
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre about 6 years ago
xclim - v0.10.13-beta
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 6 years ago
xclim - v0.10.12-beta
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 6 years ago
xclim - v0.10.11-beta
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 6 years ago
xclim - v0.10.10-beta
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 6 years ago
xclim - v0.10.9-beta
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 6 years ago
xclim - v0.10.8-beta
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 6 years ago
xclim - v0.10.7-beta
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 6 years ago
xclim - v0.10.6-beta
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 6 years ago
xclim - v0.10.5-beta
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 6 years ago
xclim - v0.10.4-beta
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 6 years ago
xclim - v0.10.3-beta
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 6 years ago
xclim - v0.10.1-beta
- Migrated to a
major.minor.patch-releasesemantic versioning system. - Removed attributes in netCDF output from Indicators that are not in the CF-convention.
- Added
fitindicator to fit the parameters of a distribution to a series.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 6 years ago
xclim - v0.7-beta
- Support for resampling of data structured using non-standard CF-Time calendars.
- Added several ICCLIM and other indicators.
- Dropped support for Python 3.4.
- Now under Apache v2.0 license.
- Stable PyPI-based dependencies.
- Dask optimizations for better memory management.
- Introduced class-based indicator calculations with data integrity verification and CF-Compliant-like metadata writing functionality.
Class-based indicators are new methods that allow index calculation with error-checking and provide on-the-fly metadata checks for CF-Compliant (and CF-compliant-like) data that are passed to them. When written to NetCDF, outputs of these indicators will append appropriate metadata based on the indicator, threshold values, moving window length, and time period / resampling frequency examined.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 6 years ago
xclim - v0.10.2-beta
- Added utilities with ensemble, run length, and subset algorithms to the documentation.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 6 years ago
xclim - v0.10-beta
- Remove support for Python 2 compatibility
- Added support for period of the year subsetting in
checks.missing_any. - Allow passing positive longitude values when subsetting data with negative longitudes
- Improved runlength calculations for small grid size arrays via
ufunc_1dimflag - Indicator class has
var_nameattribute, instead of usingidentifierto name output variables.
Scientific Software - Peer-reviewed
- Python
Published by tlogan2000 over 6 years ago
xclim -
This is a significant jump in the release. Many modifications have been made and will be added to the documentation in the coming days. Among the many changes:
- New indices have been added with documentation and call examples
- Run_length based operations have been optimized
- Support for CF non-standard calendars
- Automated/improved unit conversion and management via pint library
- Added ensemble utilities for creation and analysis of muti-model climate ensembles
- Added subsetting utilities for spatio-temporal subsets of xarray data objects
- Added streamflow indicators
- Refactoring of the code : separation of indices.py into a directory with sub-files (simple, threshold and multivariate); ensembles and subset utilities separated into distinct modules (pulled from utils.py)
- Indicators are now split into packages named by realms. import xclim.atmos to load indicators related to atmospheric variables.
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre over 6 years ago
xclim -
This is a testing release. No significant changes have been made since v0.7-beta
Scientific Software - Peer-reviewed
- Python
Published by Zeitsperre almost 7 years ago