From bd011cf4da1ead8c3419a16ba875bd59ff484bf6 Mon Sep 17 00:00:00 2001 From: Mathias Hauser Date: Tue, 4 Feb 2025 10:54:05 +0100 Subject: [PATCH] doc fixes (#615) * doc fixes * more functions --- CHANGELOG.rst | 68 +++++++++++++++++++++++---------------------- docs/source/api.rst | 4 +-- 2 files changed, 37 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2f120d92..9edb3042 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,7 +15,7 @@ New Features Breaking changes ^^^^^^^^^^^^^^^^ -- Switch random number generation for drawing emulations from np.random.seed() to np.random.default_rng() +- Switch random number generation for drawing emulations from :py:func:`np.random.seed()` to :py:func:`np.random.default_rng()` (`#495 `_). By `Victoria Bauer`_. - Using Cholesky decomposition for finding covariance localization radius and drawing from the multivariate normal distribution (`#408 `_) By `Victoria Bauer`_. @@ -78,13 +78,15 @@ Internal Changes Data structure using xarray-datatree ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -This release implements using `DataTree` from `xarray-datatree` to handle multiple scenarios. + +This release implements using :py:class:`DataTree` from `xarray-datatree` to handle multiple scenarios. + - Add `filefisher` as dependency to handle file paths of several scenarios (`#586 `_ and `#592 `_). -- Enable passing a `DataTree` to the auto regression functions (`#570 `_). +- Enable passing a :py:class:`DataTree` to the auto regression functions (`#570 `_). - Add weighting function for several scenarios (`#567 `_). -- Enable passing `DataTree` and `xr.Dataset` to `LinearRegression` (`#566 `_). +- Enable passing :py:class:`DataTree` and :py:class:`xr.Dataset` to :py:class:`LinearRegression` (`#566 `_). - Add upper pin to `xarray` version to support `xarray-datatree`(`#559 `_). -- Add utility functions for `DataTree` (`#556 `_). +- Add utility functions for :py:class:`DataTree` (`#556 `_). - Add `xarray-datatree` as dependency (`#554 `_) - Add calibration integration tests for multiple scenarios and change parameter files to netcdfs with new naming structure (`#537 `_) - Add new integration tests for drawing realisations (`#599 `_) @@ -106,17 +108,17 @@ In the release the MESMER-X functionality is integrated into the MESMER Codebase `#470 `_, `#502 `_) - Add unit tests (`#526 `_, - `#533 `_, - `#534 `_, - `#540 `_, - `#577 `_) + `#533 `_, + `#534 `_, + `#540 `_, + `#577 `_) - Add integration tests (`#524 `_, - `#550 `_ - `#553 `_) + `#550 `_, + `#553 `_) - Enable to pass set values for loc and scale (only integers) and make scale parameter optional (`#597 `_). -- Enable `threshold_min_proba` to be `None` in `distrib_cov` (`#598 `_). -- Also use Nelder-Mead fit in `distrib_cov._minimize` for `option_NelderMead == "best_run"` when Powell fit was not successful (`#600 `_). -- Return `logpmf` for discrete distributions in `distrib_cov._fg_fun_LL_n()` (`#602 `_). +- Enable ``threshold_min_proba`` to be ``None`` in :py:class:`distrib_cov` (`#598 `_). +- Also use Nelder-Mead fit in :py:meth:`distrib_cov._minimize` for ``option_NelderMead == "best_run"`` when Powell fit was not successful (`#600 `_). +- Return `logpmf` for discrete distributions in :py:meth:`distrib_cov._fg_fun_LL_n()` (`#602 `_). - Speed-up MESMER-X - add method to calculate params of a distribution (`#539 `_) @@ -133,10 +135,10 @@ some refactoring, bugfixes and enhancements of the MESMER-M functionality. Note that this led to some numerical changes compared to the MESMER-M publication (Nath et al., `2022 `_). -- move MESMER-M scripts into mesmer ( +- move MESMER-M scripts into mesmer (\ `#419 `_, and `#421 `_). -- move the harmonic model and power transformer functionalities to the stats module ( +- move the harmonic model and power transformer functionalities to the stats module (\ `#484 `_). - add example script for MESMER-M workflow (`#491 `_) - add integration tests for MESMER-M (`#501 `_) @@ -159,24 +161,24 @@ Auto-Regression Yeo-Johnson power transformer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Ensure the power transformer yields the correct normalization for more cases ( +- Ensure the power transformer yields the correct normalization for more cases (\ `#440 `_): - expand the upper bound of the first coefficient from :math:`1` to :math:`\infty`, - i.e. to 1e10 ( + i.e. to 1e10 (\ `#446 `_, `#501 `_) - - remove jacobian ``rosen_der`` from fit ( + - remove jacobian ``rosen_der`` from fit (\ `#447 `_) - - change optimization method from *SLSQP* to *Nelder-Mead* ( + - change optimization method from *SLSQP* to *Nelder-Mead* (\ `#455 `_) -- adjust the first guess to assume the data is normally distributed ( +- adjust the first guess to assume the data is normally distributed (\ `#429 `_) -- make (back-) transformations more stable by using `np.expm1` and `np.log1p` +- make (back-) transformations more stable by using :py:func:`np.expm1` and :py:func:`np.log1p` (`#494 `_) -- rewrite power transformer to work with xarray, and refactor from a class structure to functions ( +- rewrite power transformer to work with xarray, and refactor from a class structure to functions (\ `#442 `_, and `#474 `_) -- fix small code issues and clean the docstrings ( +- fix small code issues and clean the docstrings (\ `#436 `_, `#444 `_, `#439 `_, @@ -193,9 +195,9 @@ Harmonic model - only fit orders up to local minimum and use coeffs from precious order as first guess (`#443 `_) - infer the harmonic model order from the coefficients (`#434 `_) - return residuals instead of the loss for the optimization (`#460 `_) -- remove fitting of linear regression with yearly temperature (`#415 _` and +- remove fitting of linear regression with yearly temperature (`#415 `_ and `#488 `_) in line with (`Nath et al. 2022 `_). -- add helper function to upsample yearly data to monthly resolution ( +- add helper function to upsample yearly data to monthly resolution (\ `#418 `_, and `#435 `_) - de-duplicate the expression of months in their harmonic form (`#415 `_) @@ -207,7 +209,7 @@ Harmonic model `#433 `_, `#512 `_, and `#574 `_). -- add tests ( +- add tests (\ `#431 `_, and `#458 `_) - add function to generate fourier series using xarray (`#478 `_) @@ -234,7 +236,7 @@ By `Mathias Hauser`_. Breaking changes ^^^^^^^^^^^^^^^^ -- Removed support for python 3.7 and python 3.8 ( +- Removed support for python 3.7 and python 3.8 (\ `#163 `_, `#365 `_, `#367 `_, and @@ -288,7 +290,7 @@ New Features etc. methods around linear regression (`#134 `_). By `Mathias Hauser`_. - - Add xarray wrapper for fitting a linear regression ( + - Add xarray wrapper for fitting a linear regression (\ `#123 `_ and `#142 `_). By `Mathias Hauser`_. @@ -301,7 +303,7 @@ New Features - Allow to `exclude` predictor variables in :py:meth:`mesmer.stats.LinearRegression.predict` (`#354 `_). By `Mathias Hauser`_. - - Fixed two bugs related to (non-dimension) coordinates ( + - Fixed two bugs related to (non-dimension) coordinates (\ `#332 `_, `#333 `_ and `#334 `_). @@ -311,11 +313,11 @@ New Features - 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 ( + - 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 ( + (spatially-)correlated and uncorrelated auto regression model (\ `#322 `_, `#161 `_ and `#313 `_). @@ -350,7 +352,7 @@ New Features - Added helper functions to process xarray-based model data: - Added functions to stack regular lat-lon grids to 1D grids and unstack them again (`#217 `_). By `Mathias Hauser`_. - - Added functions to mask the ocean and Antarctica ( + - Added functions to mask the ocean and Antarctica (\ `#219 `_ and `#314 `_). By `Mathias Hauser`_. - Added functions to calculate the weighted global mean diff --git a/docs/source/api.rst b/docs/source/api.rst index 78a970b7..69b7a5a3 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -28,8 +28,8 @@ Auto regression .. autosummary:: :toctree: generated/ - ~stats._select_ar_order_scen_ens - ~stats._fit_auto_regression_scen_ens + ~stats.select_ar_order_scen_ens + ~stats.fit_auto_regression_scen_ens ~stats.select_ar_order ~stats.fit_auto_regression ~stats.fit_auto_regression_monthly