Skip to content

Commit 704b8dc

Browse files
authoredAug 9, 2023
various small fixes (#442)
1 parent f092956 commit 704b8dc

File tree

5 files changed

+44
-44
lines changed

5 files changed

+44
-44
lines changed
 

‎deerlab/bg_models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def _hom3d(t,conc,lam):
129129
The expression for this model is
130130
131131
.. math::
132-
B(t) = \mathrm{exp}\left(i \frac{8\pi}{9\sqrt{3}}(\sqrt{3} + \mathrm{ln}(2-\sqrt{3}))\lambda c_s D t\right)
132+
B(t) = \mathrm{exp}\left(\mathrm{i}\frac{8\pi}{9\sqrt{3}}(\sqrt{3} + \mathrm{ln}(2-\sqrt{3}))\lambda c_s D t\right)
133133
134134
where `c_s` is the spin concentration (entered in spins/m\ :sup:`3` into this expression) and D is the dipolar constant
135135

‎deerlab/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def parse_multidatasets(y_, A, weights, noiselvl, precondition=False, masks=None
7878
prescales = np.ones(nDatasets)
7979
for i in range(nDatasets):
8080
if precondition:
81-
prescales[i] = max(V[i])
81+
prescales[i] = max(y[i])
8282
ylist.append(y[i]/prescales[i])
8383
else:
8484
ylist.append(y[i])

‎docsrc/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ In order to compile the documentation the following steps must be followed:
2323
pip install sphinx-design
2424

2525
5) Download and install [dvisvgm](https://dvisvgm.de/Downloads/).
26-
26+
2727
### Runnning the Sphinx builder
2828

2929
To build the documentation from the source, call the `Makefile` or `make.bat` scripts:
3030

3131
# To compile using the cached data
3232
./docsrc/make.bat
3333
# To compile from scratch
34-
./docsrc/make.bat clean
34+
./docsrc/make.bat clean
3535

3636
If the `sphinx-build` command is not found, the documentation can be built with the following command
3737

‎docsrc/source/basics.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ All functions in DeerLab use the same units: all distances are in units of **nan
88
Distance distributions
99
*********************************
1010

11-
A distance distribution `P(r)` between two spins is represented by a pair of vectors: a distance vector ``r`` (in nanometers) and a vector of densities ``P`` (in inverse nanometers). The distance vector ``r`` can have linearly or non-linearly increasing values, but must have positive non-zero values. The elements ``P[i]`` are the distance distribution values at ``r[i]`` and are posiive or zero. Outside of the range defined by ``r``, the distribution ``P`` is assumed to be zero, i.e. the distribution is truncated to the range ``r``. The distance distribution ``P`` is normalized such that the integral over the range of the provided ``r`` equals one:
11+
A distance distribution `P(r)` between two spins is represented by a pair of vectors: a distance vector ``r`` (in nanometers) and a vector of densities ``P`` (in inverse nanometers). The distance vector ``r`` can have linearly or non-linearly increasing values, but must have positive non-zero values. The elements ``P[i]`` are the distance distribution values at ``r[i]`` and are positive or zero. Outside of the range defined by ``r``, the distribution ``P`` is assumed to be zero, i.e. the distribution is truncated to the range ``r``. The distance distribution ``P`` is normalized such that the integral over the range of the provided ``r`` equals one:
1212

1313
.. math:: \int_{r_\mathrm{min}}^{r_\mathrm{max}} P(r) \mathrm{d}r = 1
1414

‎docsrc/source/changelog.rst

+39-39
Original file line numberDiff line numberDiff line change
@@ -108,32 +108,32 @@ Release ``v1.0.0`` - December 2022
108108

109109
.. rubric:: ``fit``
110110

111-
- |enhancement| The function now returns a full uncertainty quantification for the normalization factor of any model parameter with a normalization condition (:pr:`372`).
112-
- |efficiency| |api| Removes the automatic computation of the ``modelUncert`` output containing the propagated uncertainty estimate of the model's response (:pr:`401`). This significantly speeds up the runtime of the function by disabling the automatic propagation of uncertainty to the model's response which could take from several seconds to several minutes in complex models (:issue:`391`).
111+
- |enhancement| The function now returns a full uncertainty quantification for the normalization factor of any model parameter with a normalization condition (:pr:`372`).
112+
- |efficiency| |api| Removes the automatic computation of the ``modelUncert`` output containing the propagated uncertainty estimate of the model's response (:pr:`401`). This significantly speeds up the runtime of the function by disabling the automatic propagation of uncertainty to the model's response which could take from several seconds to several minutes in complex models (:issue:`391`).
113113

114114

115115
.. rubric:: ``dipolarkernel``
116116

117-
- |feature| Implements multi-spin dipolar pathways up to three-spin interactions (:pr:`385`). The function takes now a list of distance vectors ``[r1,r2,...,rQ]`` for multi-spin kernels.
118-
- |feature| Expands the function to be able to account for arbitrary experimental time coordinates (:pr:`385`). Now a list of time vectors ``[t1,t2,...,tD]`` can be specified to construct a D-dimensional dipolar kernel.
119-
- |enhancement| : Refactors most code in the function (:pr:`385`). THe code should now be more logically ordered using mathematical symbols for clearer equations.
120-
- |api| Introduces a new and clearer syntax for defining dipolar pathways (:pr:`385`). Now, instead of specifying a list of pathways, where each pathway is a list of values (being the amplitude, refocusing time, and harmonic in that order), now pathways are specified as a list of dictionaries, e.g. ``pathways = [{'amp':0.5}, 'reftime':0, 'harmonic':1]``.
121-
- |feature| |efficiency| Adds a new optional argument ``tinterp`` to construct a dipolar kernel for a pathway and interpolate other pathways from that one (:pr:`393`).
117+
- |feature| Implements multi-spin dipolar pathways up to three-spin interactions (:pr:`385`). The function takes now a list of distance vectors ``[r1,r2,...,rQ]`` for multi-spin kernels.
118+
- |feature| Expands the function to be able to account for arbitrary experimental time coordinates (:pr:`385`). Now a list of time vectors ``[t1,t2,...,tD]`` can be specified to construct a D-dimensional dipolar kernel.
119+
- |enhancement| : Refactors most code in the function (:pr:`385`). THe code should now be more logically ordered using mathematical symbols for clearer equations.
120+
- |api| Introduces a new and clearer syntax for defining dipolar pathways (:pr:`385`). Now, instead of specifying a list of pathways, where each pathway is a list of values (being the amplitude, refocusing time, and harmonic in that order), now pathways are specified as a list of dictionaries, e.g. ``pathways = [{'amp':0.5}, 'reftime':0, 'harmonic':1]``.
121+
- |feature| |efficiency| Adds a new optional argument ``tinterp`` to construct a dipolar kernel for a pathway and interpolate other pathways from that one (:pr:`393`).
122122

123123
.. rubric:: ``dipolarbackground``
124124

125-
- |feature| Implements multi-spin dipolar pathways up to three-spin interactions (:pr:`385`).
126-
- |feature| Expands the function to be able to account for arbitrary experimental time coordinates (:pr:`385`). Now a list of time vectors ``[t1,t2,...,tD]`` can be specified to construct a D-dimensional dipolar background function.
127-
- |api| Introduces the same new syntax for defining dipolar pathways as in ``dipolarkernel`` (:pr:`385`).
125+
- |feature| Implements multi-spin dipolar pathways up to three-spin interactions (:pr:`385`).
126+
- |feature| Expands the function to be able to account for arbitrary experimental time coordinates (:pr:`385`). Now a list of time vectors ``[t1,t2,...,tD]`` can be specified to construct a D-dimensional dipolar background function.
127+
- |api| Introduces the same new syntax for defining dipolar pathways as in ``dipolarkernel`` (:pr:`385`).
128128

129129

130130
.. rubric:: ``correctphase``
131131

132-
- Adds a new optional argument ``offset`` to enable a numerical optimization of the phase while accounting for a non-zero imaginary component offset (:issue:`392`, :pr:`395`).
132+
- Adds a new optional argument ``offset`` to enable a numerical optimization of the phase while accounting for a non-zero imaginary component offset (:issue:`392`, :pr:`395`).
133133

134134
.. rubric:: ``snlls``
135135

136-
- Adds an optional argument ``modeluq`` to enable /disable the model uncertainty propagation (:pr:`401`).
136+
- Adds an optional argument ``modeluq`` to enable /disable the model uncertainty propagation (:pr:`401`).
137137

138138
Release ``v0.14.5`` - December 2022
139139
------------------------------------------
@@ -143,12 +143,12 @@ Release ``v0.14.5`` - December 2022
143143

144144
.. rubric:: ``fit``
145145

146-
- |fix| Expose the ``cores`` option of ``bootstrap_analysis`` to parallelize bootstrap analysis from the ``fit`` function (:pr:`387`).
147-
- |fix| Correct behavior of masking during fitting (:pr:`394`). When using the ``mask`` option of the ``fit`` function, certain steps such as noise estimation and goodness-of-fit assessment were not taking into account the mask during the analysis.
146+
- |fix| Expose the ``cores`` option of ``bootstrap_analysis`` to parallelize bootstrap analysis from the ``fit`` function (:pr:`387`).
147+
- |fix| Correct behavior of masking during fitting (:pr:`394`). When using the ``mask`` option of the ``fit`` function, certain steps such as noise estimation and goodness-of-fit assessment were not taking into account the mask during the analysis.
148148

149149
.. rubric:: ``bootstrap_analysis``
150150

151-
- |fix| Fix error prompted when analyzing scalar variables (:pr:`402`).
151+
- |fix| Fix error prompted when analyzing scalar variables (:pr:`402`).
152152

153153

154154

@@ -163,11 +163,11 @@ Release ``v0.14.4`` - August 2022
163163

164164
.. rubric:: ``fit``
165165

166-
- |fix| Added multiple missing optional keyword arguments to the documentation of the function (:pr:`367`).
166+
- |fix| Added multiple missing optional keyword arguments to the documentation of the function (:pr:`367`).
167167

168168
.. rubric:: ``dd_randcoil``
169169

170-
- |fix| Fixed the erronously switched descriptions of the model parameters (:pr:`361`).
170+
- |fix| Fixed the erronously switched descriptions of the model parameters (:pr:`361`).
171171

172172

173173

@@ -296,52 +296,52 @@ Release ``v0.14.0`` - April 2022
296296

297297
.. rubric:: ``bootstrap_analysis``
298298

299-
- |efficiency| Added a new keyword argument ``memorylimit`` to specify the maximal memory used by the bootstrap analysis (by default 8GB). If the total analysis is expected to exceed the memory limit, the function will abort the execution (:issue:`200`, :pr:`238`).
299+
- |efficiency| Added a new keyword argument ``memorylimit`` to specify the maximal memory used by the bootstrap analysis (by default 8GB). If the total analysis is expected to exceed the memory limit, the function will abort the execution (:issue:`200`, :pr:`238`).
300300

301301
.. rubric:: ``dipolarkernel``
302302

303-
- |feature| Added a new option `complex` to request the complex-valued dipolar kernel to simulate the out-of-phase contributions to the dipolar signals (:pr:`258`).
304-
- |efficiency| Added a new keyword argument ``memorylimit`` to specify the maximal memory used by the dipolar kernel (by default 8GB). If the dipolar kernel is expected to exceed the memory limit, the function will abort the execution (:issue:`200`, :pr:`238`).
305-
- |fix| Prompts error if wrong method is selected when specifying a limited excitation bandwidth (:issue:`181`, :pr:`183`).
303+
- |feature| Added a new option `complex` to request the complex-valued dipolar kernel to simulate the out-of-phase contributions to the dipolar signals (:pr:`258`).
304+
- |efficiency| Added a new keyword argument ``memorylimit`` to specify the maximal memory used by the dipolar kernel (by default 8GB). If the dipolar kernel is expected to exceed the memory limit, the function will abort the execution (:issue:`200`, :pr:`238`).
305+
- |fix| Prompts error if wrong method is selected when specifying a limited excitation bandwidth (:issue:`181`, :pr:`183`).
306306

307307
.. rubric:: ``bg_models``
308308

309-
- |feature| Implemented the time-dependent phase shifts for all the built-in physical background models, namely ``bg_hon3d_phase``, ``bg_hom3dex_phase``, and ``bg_homfractal_phase`` (:pr:`258`).
310-
- |enhancement| Changed the implementation of ``bg_hom3dex`` (:pr:`258`). This avoids the use of tabulated pre-calculated values. Accordingly the utility functions ``calculate_exvolume_redfactor`` and ``load_exvolume_redfactor`` have been removed.
311-
- |fix| Improved the implementation and behavior of the ``bg_homfractal`` model (:pr:`258`).
309+
- |feature| Implemented the time-dependent phase shifts for all the built-in physical background models, namely ``bg_hon3d_phase``, ``bg_hom3dex_phase``, and ``bg_homfractal_phase`` (:pr:`258`).
310+
- |enhancement| Changed the implementation of ``bg_hom3dex`` (:pr:`258`). This avoids the use of tabulated pre-calculated values. Accordingly the utility functions ``calculate_exvolume_redfactor`` and ``load_exvolume_redfactor`` have been removed.
311+
- |fix| Improved the implementation and behavior of the ``bg_homfractal`` model (:pr:`258`).
312312

313313
.. rubric:: ``diststats``
314314

315-
- |fix| Fixed the behavior when dealing with distributions with arbitrary integral values
315+
- |fix| Fixed the behavior when dealing with distributions with arbitrary integral values
316316

317317
.. rubric:: ``selregparam``
318318

319-
- |enhancement| Implemented a general LSQ solver as backend to adapt to different regularized optimization problem structures.
320-
- |enhancement| Generalized the linear least-squares solver. (:pr:`216`).
321-
- |enhancement| In the ``brent`` mode, the search range is no longer selected from the min/max of ``regparamrange`` output, but from a new keyword argument ``searchrange`` set by default to ``[1e-8,1e2]``. The default values were chosen as the statistical means of Monte-Carlo simulations of the min/max values of ``regparamrange``'s output for typical 4-pulse DEER kernels (:pr:`232`).
322-
- |enhancement| In the ``grid`` mode, the grid-values are passed by the pre-existing keyword argument ``candidates``. By default, if not specified, a grid will be generated from the ``searchrange`` argument (:pr:`232`).
319+
- |enhancement| Implemented a general LSQ solver as backend to adapt to different regularized optimization problem structures.
320+
- |enhancement| Generalized the linear least-squares solver. (:pr:`216`).
321+
- |enhancement| In the ``brent`` mode, the search range is no longer selected from the min/max of ``regparamrange`` output, but from a new keyword argument ``searchrange`` set by default to ``[1e-8,1e2]``. The default values were chosen as the statistical means of Monte-Carlo simulations of the min/max values of ``regparamrange``'s output for typical 4-pulse DEER kernels (:pr:`232`).
322+
- |enhancement| In the ``grid`` mode, the grid-values are passed by the pre-existing keyword argument ``candidates``. By default, if not specified, a grid will be generated from the ``searchrange`` argument (:pr:`232`).
323323

324324
.. rubric:: ``UQResult``
325325

326-
- |fix| Ensures non-negativity of estimated parameter uncertainty probability density functions.
327-
- |enhancement| Improve the behavior of ``UQresult.propagate()`` for bootstrapped uncertainty results. Now, instead of propagating bootstrapped uncertainty via the estimated covariance matrix, the uncertainty is propagated by bootstrapping from the bootstrapped uncertainty distributions (:pr:`218`).
328-
- |fix| Fix behavior of the bootstrap median (:pr:`254`).
329-
- |fix| Suppress multiple ``DeprecationWarning`` warnings during uncertainty calculations (:pr:`255`).
330-
- |fix| Fix error prompt when requesting private methods such as ``__deepcopy__`` (:issue:`301`, :pr:`303`).
326+
- |fix| Ensures non-negativity of estimated parameter uncertainty probability density functions.
327+
- |enhancement| Improve the behavior of ``UQresult.propagate()`` for bootstrapped uncertainty results. Now, instead of propagating bootstrapped uncertainty via the estimated covariance matrix, the uncertainty is propagated by bootstrapping from the bootstrapped uncertainty distributions (:pr:`218`).
328+
- |fix| Fix behavior of the bootstrap median (:pr:`254`).
329+
- |fix| Suppress multiple ``DeprecationWarning`` warnings during uncertainty calculations (:pr:`255`).
330+
- |fix| Fix error prompt when requesting private methods such as ``__deepcopy__`` (:issue:`301`, :pr:`303`).
331331

332332
.. rubric:: ``correctphase``
333333

334-
- |fix| Implement a fully vectorized analytical solution, resulting in a 30-150x speedup (:pr:`256`, :pr:`279`).
335-
- |api| Eliminate the ``phase='posrealint'`` and ``phase='negrealint'`` options (:pr:`279`).
334+
- |fix| Implement a fully vectorized analytical solution, resulting in a 30-150x speedup (:pr:`256`, :pr:`279`).
335+
- |api| Eliminate the ``phase='posrealint'`` and ``phase='negrealint'`` options (:pr:`279`).
336336

337337
.. rubric:: ``deerload``
338338

339-
- |fix| Raise warning instead of exception when parsing lines without key-value pairs (:pr:`256`). This avoid errors when trying to load BES3T files with PulseSPEL scripts edited in different OS systems.
339+
- |fix| Raise warning instead of exception when parsing lines without key-value pairs (:pr:`256`). This avoid errors when trying to load BES3T files with PulseSPEL scripts edited in different OS systems.
340340

341341
.. rubric:: ``whitegaussnoise``
342342

343-
- |api| Renamed the argument ``level`` to ``std`` for clarity (:pr:`276`).
344-
- |api| Make the argument ``std`` a required positional argument and no longer provide a default value (:pr:`276`).
343+
- |api| Renamed the argument ``level`` to ``std`` for clarity (:pr:`276`).
344+
- |api| Make the argument ``std`` a required positional argument and no longer provide a default value (:pr:`276`).
345345

346346
Release ``v0.13.2`` - July 2021
347347
------------------------------------------

0 commit comments

Comments
 (0)
Please sign in to comment.