Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement models metadata as function attributes #143

Merged
merged 3 commits into from
Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@

Release v0.13.0 - March 2021
Release v0.13.0 - April 2021
---------------------------------

#### New features

- DeerLab now supports Python 3.9.
- The function ``fitsignal`` has been re-named to ``fitmodel`` for correctness and consistency with other functions ([#102](https://github.com/JeschkeLab/DeerLab/pull/102)).
- Added new experiment models for RIDME on systems with one to seven harmonic pathways (S=1/2 to S=7/2) to include all higher harmonics (overtones) ([#79](https://github.com/JeschkeLab/DeerLab/pull/79)).
- Bootstrapping is now embedded into ``fitmodel`` to automatically bootstrap all output quantities without the need to write additional script lines ([#55](https://github.com/JeschkeLab/DeerLab/issues/55)). In ``fitmodel`` a new option ``uq`` allows to switch between covariance or bootstrapping uncertainty quantification ([#88](https://github.com/JeschkeLab/DeerLab/pull/88)).
- The function ``fitmodel`` now returns ``Vmod`` and ``Vunmod``, the modulated and unmodulated contributionsto the fitted dipolar signal, respectively, along their uncertainties as additional outputs ([#78](https://github.com/JeschkeLab/DeerLab/pull/78)).
- Implemented several initialization strategies in ``fitmultimodel`` for multi-model components ([#67](https://github.com/JeschkeLab/DeerLab/pull/67)). Three different new strategies ``'spread'``, ``'split'`` and ``'merge'`` will initialize the parameter values of the N-component fit based on the results of the N-1/N+1 component fit to improve quality of results and speed.
- Added contribution guidelines to the documentation and automated list of DeerLab contributors.
- The function ``snlls`` now accepts additional custom penalties to include in the optimization ([#76](https://github.com/JeschkeLab/DeerLab/issues/76), [#108](https://github.com/JeschkeLab/DeerLab/pull/112)).
- All fit functions now return the fit of the data along its uncertainty automatically as part of the ``FitResult`` object ([#130](https://github.com/JeschkeLab/DeerLab/issues/130), [#134](https://github.com/JeschkeLab/DeerLab/pull/134)).

#### Overall changes

- The performance of all fit functions has been considerably accelerated by removing call overheads in built-in DeerLab models ([#100](https://github.com/JeschkeLab/DeerLab/issues/100), [#101](https://github.com/JeschkeLab/DeerLab/pull/101)).
- All fit functions now return the fitted data and its uncertainty quantification as part of the ``FitResult`` object ([#130](https://github.com/JeschkeLab/DeerLab/issues/130), [#134](https://github.com/JeschkeLab/DeerLab/pull/134)).
- The performance of all fit functions has been considerably accelerated by removing call overheads in built-in DeerLab models ([#100](https://github.com/JeschkeLab/DeerLab/issues/100), [#101](https://github.com/JeschkeLab/DeerLab/pull/101), [#143](https://github.com/JeschkeLab/DeerLab/pull/143)).
- Improved robustness of the installer ([#65](https://github.com/JeschkeLab/DeerLab/pull/65)):
- The installer no longer assumes the alias ``pip`` to be setup on the system.
- The installation will now handle cases when system-wide privileges are not available ([#52](https://github.com/JeschkeLab/DeerLab/issues/52)).
- Improved robustness of the installation in Windows systems to avoid missing DLL errors ([#64](https://github.com/JeschkeLab/DeerLab/issues/64)).
- The installer will now get the latest Numpy/Scipy releases in Windows systems.
- Adapted piece of code leading to a ``VisibleDeprecationWarning `` visible during execution of certain DeerLab functions.
- The installer will now get the latest Numpy/Scipy releases in Windows systems available at the [Gohlke repository](https://www.lfd.uci.edu/~gohlke/pythonlibs/).
- Adapted piece of code leading to a ``VisibleDeprecationWarning`` visible during execution of certain DeerLab functions.
- Improved interface of built-in plots in ``FitResult.plot()``. The method now returns a Matplotlib figure object (`matplotlib.figure.Figure`) instead of an axes object (``matplotlib.axes._subplots.AxesSubplot``) which can be modified more freely to adjust graphical elements ([#85](https://github.com/JeschkeLab/DeerLab/issues/85)). The method now takes an optional keyword ``FitResult.plot(show=True\False)`` to enable/disable rendering of the graphics upon calling the method ([#87](https://github.com/JeschkeLab/DeerLab/pull/87)).
- The fit objective values returned in ``FitResult.cost`` are now correct (previous versions had an erroneous 1/2 factor) ([#80](https://github.com/JeschkeLab/DeerLab/issues/80)). The value is now returned as a scalar value instead of a single-element list ([#81](https://github.com/JeschkeLab/DeerLab/issues/81)).
- Removed the re-normalization conventions ``K(t=0,r)=1`` and ``B(t=0)=1`` and associated options ``renormalize`` and ``renormpaths`` in the ``dipolarkernel`` and ``dipolarbackground`` functions ([#99](https://github.com/JeschkeLab/DeerLab/pull/99)) to avoid identifiability issues between dipolar pathway amplitudes and signal scales during fitting ([#76](https://github.com/JeschkeLab/DeerLab/issues/76)).
- The fit convergence criteria ``tol`` (objective function tolerance) and ``maxiter`` (iteration limit) are now exposed as keyword argument in all fit functions ([#111](https://github.com/JeschkeLab/DeerLab/issues/111), [#112](https://github.com/JeschkeLab/DeerLab/pull/112)).
- Improvements and corrections to the documentation ([#95](https://github.com/JeschkeLab/DeerLab/pull/95), [#96](https://github.com/JeschkeLab/DeerLab/pull/96), [#104](https://github.com/JeschkeLab/DeerLab/pull/104), [#106](https://github.com/JeschkeLab/DeerLab/pull/106), [#107](https://github.com/JeschkeLab/DeerLab/pull/107))
- Corrections in the ``info`` dictionary of multiple ``dd_models``. The key ``Parameters`` of some models contained the wrong names.
- The keyword argument to request uncertainty quantification has been unified across all fitting functions. It is now ``uq``.
- Multiple improvements and corrections to the documentation ([#95](https://github.com/JeschkeLab/DeerLab/pull/95), [#96](https://github.com/JeschkeLab/DeerLab/pull/96), [#104](https://github.com/JeschkeLab/DeerLab/pull/104), [#106](https://github.com/JeschkeLab/DeerLab/pull/106), [#107](https://github.com/JeschkeLab/DeerLab/pull/107), [#115](https://github.com/JeschkeLab/DeerLab/pull/115), [#122](https://github.com/JeschkeLab/DeerLab/pull/122))
- Corrections in the metadata of multiple ``dd_models``. The key ``Parameters`` of some models contained the wrong names.
- The metadata of the built-in models is now accessible and manipulable via function attributes (e.g. ``dd_gauss.parameters``) rather than trought a returned dictionary (e.g. ``dd_gauss()['Parameters']``) ([#143](https://github.com/JeschkeLab/DeerLab/pull/143)).
- The keyword argument to request uncertainty quantification has been unified across all fitting functions. It is now ``uq`` ([#120](https://github.com/JeschkeLab/DeerLab/pull/120)).
- The ``UncertQuant`` class has been renamed into ``UQResult`` ([#123](https://github.com/JeschkeLab/DeerLab/pull/123)).
- Uncertainty quantification is now tested numerically against an external package (``lmfit``) to ensue quality and accuracy ([#121](https://github.com/JeschkeLab/DeerLab/pull/121)).

#### Specific changes
- ``deerload``:
Expand All @@ -42,17 +46,27 @@ Release v0.13.0 - March 2021
- Removed the keyword argument ``uqanalysis=True/False``. The uncertainty quantification can now be disabled via the new keyword ``uq=None`` ([#98](https://github.com/JeschkeLab/DeerLab/pull/98)).
- Corrected the behaviour of built-in start values when manually specifying boundaries ([#73](https://github.com/JeschkeLab/DeerLab/pull/73)). If the built-in start values are outside of the user-specified boundaries the program will now automatically set the start values in the middle of the boundaries to avoid errors ([#72](https://github.com/JeschkeLab/DeerLab/issues/72)).
- Implemented the constraint ``Lam0+sum(lam)<=1`` to ensure the structural-identifiability of ``Lam0`` and ``V0`` during SNLLS optimization of experiment models with more than one modulated dipolar pathway (i.e. does not affect ``ex_4pdeer``) ([#76](https://github.com/JeschkeLab/DeerLab/issues/76),[#108](https://github.com/JeschkeLab/DeerLab/pull/108)).
- Removed the optional keyword argument ``regtype`` ([#137](https://github.com/JeschkeLab/DeerLab/pull/137)).
- ``fitregmodel``:
- Corrected the behaviour of the uncertainty quantification when disabling the non-negativity constraint ([#121](https://github.com/JeschkeLab/DeerLab/pull/121)).
- ``fitparamodel``:
- Made ``par0`` a positional argument instead of an optional keyword ([#70](https://github.com/JeschkeLab/DeerLab/issues/70)). to avoid errors when not defined ([#69](https://github.com/JeschkeLab/DeerLab/issues/69)).
- Keyword argument ``rescale`` has been renamed to ``fitscale`` ([#128])https://github.com/JeschkeLab/DeerLab/issues/128)).
- Keyword argument ``rescale`` has been renamed to ``fitscale`` ([#128](https://github.com/JeschkeLab/DeerLab/issues/128),[#129](https://github.com/JeschkeLab/DeerLab/pull/129)).
- ``snlls``:
- Corrected bug that was leading to the smoothness penalty being accounted for twice in the least-squares residual during optimization ([#103](https://github.com/JeschkeLab/DeerLab/issues/103)).
- Now returns the uncertainty quantification of linear and nonlinear parts as separate objects ``nonlinUncert`` and ``linUncert`` ([#108](https://github.com/JeschkeLab/DeerLab/pull/108)).
- Improved the covariance-based uncertainty analysis by including correlations between linear and non-linear parameters ([#108](https://github.com/JeschkeLab/DeerLab/pull/108)).
- Improved the behavior of signal scale determination ([#108](https://github.com/JeschkeLab/DeerLab/pull/108)).
- Enabled prescaling of the data to avoid scaling issues during uncertainty quantification ([#132](https://github.com/JeschkeLab/DeerLab/issue/132), [#133](https://github.com/JeschkeLab/DeerLab/pull/133)).
- Corrected the behaviour of the uncertainty quantification when disabling the regularization penalty ([#121](https://github.com/JeschkeLab/DeerLab/pull/121)).
- ``diststats``:
- Now compatible with non-uniformly defined distance distributions ([#92](https://github.com/JeschkeLab/DeerLab/issues/92), [#94](https://github.com/JeschkeLab/DeerLab/pull/94)).
- Added internal validation step to avoid non-sensical results when confounding the syntax ([#91](https://github.com/JeschkeLab/DeerLab/pull/91)).
- ``dipolarkernel``:
- Now allows defining pathways without unmodulated components.
- All optional keyword arguments can only be passed as named and not positional arguments ([#138](https://github.com/JeschkeLab/DeerLab/pull/138)).
- The keyword ``pathways`` now only takes lists of pathways and not modulation depth parameters. A new separate keyword ``mod`` takes the modulation depth parameter for the simplified 4-pulse DEER kernel ([#118](https://github.com/JeschkeLab/DeerLab/issues/118), [#138](https://github.com/JeschkeLab/DeerLab/pull/138)).
- Renmaed the background argument keyword ``B`` into ``bg`` ([#138](https://github.com/JeschkeLab/DeerLab/pull/138)).
- ``regparamrange``:
- Implemented new CSD algorithm to avoid LAPACK library crashes encountered when using multiple DeerLab functions calling ``regparamrange`` internally ([#68](https://github.com/JeschkeLab/DeerLab/pull/68)).
- ``correctphase``:
Expand Down
Loading