Skip to content

Latest commit

 

History

History
342 lines (277 loc) · 15.7 KB

CHANGELOG.rst

File metadata and controls

342 lines (277 loc) · 15.7 KB

Changelog

v0.9.1 - unreleased

Bug fixes

Ensure de-duplicating the historical ensemble members conserves their order. Previously, the legacy calibration routines used np.unique, which shuffles them. See #338 for details. (#339). By Mathias Hauser.

Breaking changes

  • Removed support for python 3.7 and python 3.8 and updated the code base ( #163, #365, #367, and #371). By Mathias Hauser.
  • The supported versions of some dependencies were changed (#369):

    Package Old New
    pandas <2.0 >=2.0
    xarray not specified >=2023.04

New Features

v0.9.0 - 2023.12.19

version 0.9.0 is a big step towards rewriting mesmer. All statistical functionality was extracted and works for xarray data objects. It also contains data handling functions to prepare climate model data using xarray.

  • The restructered code is fully functional, and can be used to calibrate and emulate temperature. However, it is still missing wrappers to which encapsulates the full chain and helpers to simplify calibrating several scenarios and ensemble members.
  • This version still contains the legacy routines to train and emulate temperature. It should have no numerical changes, only minimal changes in usage and offers speed gains compared to v0.8.3.

Known bugs

For the legacy training, the influence of the global variability is underestimated, because the historical ensemble members are shuffled "randomly". This is kept in v0.9.0 for backward compatibility and will be fixed in a follow-up bug fix release. For details see #338.

New Features

  • Extracted statistical functionality for linear regression:
    • Create :pymesmer.stats.LinearRegression which encapsulates fit, predict, etc. methods around linear regression (#134). By Mathias Hauser.
    • Add xarray wrapper for fitting a linear regression ( #123 and #142). By Mathias Hauser.
    • Add add fit_intercept argument to the linear_regression fitting methods and functions (#144). By Mathias Hauser.
    • Allow to pass 1-dimensional targets to :pymesmer.stats.LinearRegression.fit (#221). By Mathias Hauser.
    • Allow to exclude predictor variables in :pymesmer.stats.LinearRegression.predict (#354). By Mathias Hauser.
    • Fixed two bugs related to (non-dimension) coordinates ( #332, #333 and #334). By Mathias Hauser.
  • Extracted statistical functionality for auto regression:
    • Add mesmer.stats.fit_auto_regression: xarray wrapper to fit an auto regression model (#139). By Mathias Hauser.
    • Have mesmer.stats.fit_auto_regression return the variance instead of the standard deviation ( #306, and #318). By Mathias Hauser.
    • Add draw_auto_regression_correlated and draw_auto_regression_uncorrelated: to draw samples of a (spatially-)correlated and uncorrelated auto regression model ( #322, #161 and #313). By Mathias Hauser.
    • Add mesmer.stats.select_ar_order to select the order of an auto regressive model (#176). By Mathias Hauser.
  • Extracted functions dealing with the spatial covariance and its localization:
    • Add xarray wrappers :pymesmer.stats.adjust_covariance_ar1 and :pymesmer.stats.find_localized_empirical_covariance (#191). By Mathias Hauser.
    • Refactor and extract numpy-based functions dealing with the spatial covariance and its localization (#167 and #184). By Mathias Hauser.
    • Allow to pass 1 x n arrays to :pymesmer.stats.adjust_covariance_ar1 (#224). By Mathias Hauser.
  • Update LOWESS smoothing:
  • Added helper functions to process xarray-based model data:
  • The aerosol data is now automatically downloaded using pooch. (#267). By Mathias Hauser.
  • Added helper functions to estimate and superimpose volcanic influence (#336). By Mathias Hauser.
  • Added additional tests for the calibration step (#209):
    • one scenario (SSP5-8.5) and two ensemble members (#211)
    • two scenarios (SSP1-2.6 and SSP5-8.5) with one and two ensemble members, respectively (#214)
    • different selection of predictor variables (tas**2 and hfds) for different scenarios (#291)

    By Mathias Hauser.

  • Allow passing xr.DataArray to gaspari_cohn (#298). By Mathias Hauser.
  • Allow passing xr.DataArray to geodist_exact (#299). By Zeb Nicholls and Mathias Hauser.
  • Add calc_gaspari_cohn_correlation_matrices a function to calculate Gaspari-Cohn correlation matrices for a range of localisation radii (#300). By Zeb Nicholls and Mathias Hauser.
  • Add a helper function to load tas and (potentially) hfds for several ESMs from cmip-ng archive at ETHZ (#326). By Mathias Hauser.

Breaking changes

  • Localization radii that lead to singular matrices are now skipped (#187). By Mathias Hauser.
  • Refactor and split :pytrain_l_prepare_X_y_wgteq into two functions: :pyget_scenario_weights and :pystack_predictors_and_targets (#143). By Mathias Hauser.
  • Moved gaspari_cohn & calc_geodist_exact from io.load_constant_files to core.computation (#158). By Yann Quilcaille.
  • The function mask_percentage has been renamed to :pycore.regionmaskcompat.mask_3D_frac_approx (#202). By Mathias Hauser.
  • Removed :pymesmer.io.load_constant_files.infer_interval_breaks and the edges from the lat and lon dictionaries i.e., lon["e"] and lat["e"] (#233). By Mathias Hauser.
  • Deprecated the reg_type argument to :pymesmer.io.load_constant_files.load_regs_ls_wgt_lon_lat and the reg_dict argument to :pymesmer.utils.select.extract_land. These arguments no longer have any affect (#235). By Mathias Hauser.
  • Removed ref["type"] == "first", i.e., calculating the anomaly w.r.t. the first ensemble member (#247). By Mathias Hauser.
  • Renamed mesmer.calibrate_mesmer._calibrate_and_draw_realisations to mesmer.calibrate_mesmer._calibrate_tas (#66). By Mathias Hauser.

Deprecations

  • The function mesmer.create_emulations.create_emus_gt has been renamed to :pycreate_emulations.gather_gt_data (#246). By Mathias Hauser.
  • The function mesmer.utils.select.extract_time_period is now deprecated and will be removed in a future version. Please raise an issue if you use this function (#243). By Mathias Hauser.

Bug fixes

  • Fix three issues with :pycore.regionmaskcompat.mask_3D_frac_approx. Note that these issues are only relevant if passing xarray objects and/ or masks close to the poles (#202 and #218). By Mathias Hauser.

Documentation

Internal Changes

  • Refactor the mesmer internals to use the new statistical core, employ helper functions etc.:
    • Use :pymesmer.utils.separate_hist_future in :pymesmer.calibrate_mesmer.train_gt (#281).
    • Use of :pymesmer.stats.LinearRegression in
      • :pymesmer.calibrate_mesmer.train_gt_ic_OLSVOLC (#145).
      • :pymesmer.create_emulations.create_emus_lv_OLS and :pymesmer.create_emulations.create_emus_OLS_each_gp_sep (#240).

    By Mathias Hauser.

  • Restore compatibility with regionmask v0.9.0 (#136). By Mathias Hauser.
  • Renamed the interpolation keyword of np.quantile to method changed in numpy v1.22.0 (#137). By Mathias Hauser.
  • Add python 3.10 and python 3.11 to list of supported versions (#162 and #284). By Mathias Hauser.
  • Move contents of setup.py to setup.cfg (#169). By Mathias Hauser.
  • Use pyproject.toml for the build-system and setuptools_scm for the __version__ (#188). By Mathias Hauser.
  • Moved the climate model data manipulation functions (#237). By Mathias Hauser.

v0.8.3 - 2021-12-23

New Features

  • Add mesmer.stats._linear_regression (renamed to mesmer.stats._fit_linear_regression_np in #142). Starts the process of refactoring the codebase (#116). By Zeb Nicholls.

Bug fixes

  • Initialize llh_max to -inf to ensure the cross validation loop is entered (#110). By Jonas Schwaab.

Documentation

  • Fix copyright notice and release version in documentation (#127). By Zeb Nicholls.

Internal Changes

  • Automatically upload the code coverage to codecov.io after the test suite has run (#99). By Mathias Hauser.
  • Internal refactor: moved a number of inline comments to their own line (especially if this allows to have the code on one line instead of several) and other minor cleanups (#98). By Mathias Hauser.
  • Refactor io.load_cmipng_tas and io.load_cmipng_hfds to de-duplicate their code and add tests for them (#55). By Mathias Hauser.

v0.8.2 - 2021-10-07

Bug fixes

  • Reintroduce ability to read in cmip5 data from the cmip5-ng archive at ETH (#90). By Lea Beusch.

Internal Changes

  • Reproduce the test files because of a change in regionmask which affected the mesmer tests (#95). By Mathias Hauser.
  • Refactor and speed up of the Gaspari-Cohn function and the calculation of the great circle distance (#85, #88). By Mathias Hauser.
  • The geopy package is no longer a dependency of mesmer (#88). By Mathias Hauser.
  • Convert README from Markdown to reStructuredText to fix package build errors. Also allows to include the README in the docs to avoid duplication (#102). By Mathias Hauser.

v0.8.1 - 2021-07-15

  • Update example script (#80).

v0.8.0 - 2021-07-13

  • First release on PyPI and conda (#79).