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

Bugfixes 4th sep #460

Merged
merged 7 commits into from
Sep 6, 2023
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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.1.1
v1.1.2
2 changes: 1 addition & 1 deletion deerlab/dd_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def _multirice3dfun(r,nu,sig):
r = r.T
s2 = sig**2
I_scaled = spc.ive(n/2-1, nu*r/s2)
P = nu**(n/2-1)/s2*r**(n/2)*np.exp(-(r**2+nu**2)/(2*s2)+nu*r/s2)*I_scaled
P = nu**(1-n/2)/s2*r**(n/2)*np.exp(-(r**2+nu**2)/(2*s2)+nu*r/s2)*I_scaled
P[P<0] = 0

# Normalization
Expand Down
8 changes: 7 additions & 1 deletion deerlab/solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,11 @@ def snlls(y, Amodel, par0=None, lb=None, ub=None, lbl=None, ubl=None, nnlsSolver
* ``0`` : Work silently (default).
* ``1`` : Display progress including the non-linear least-squares' solver termination report.
* ``2`` : Display progress including the non-linear least-squares' solver iteration details.

.. caution::

The verbose output from the non-linear least-squares solver uses a different definition of the cost function than DeerLab.
DeerLab uses the sum of squares of the residuals divided by the number of data points, whereas the non-linear least-squares solver uses the sum of squares of the residuals divided by 2.

Returns
-------
Expand Down Expand Up @@ -594,7 +599,8 @@ def linear_problem(y,A,optimize_alpha,alpha):


if optimize_alpha:
output = dl.selregparam((y-yfrozen)[mask], Ared[mask,:], linSolver, regparam,
linsolver_result = lambda AtA, Aty: parseResult(linSolver(AtA, Aty))
output = dl.selregparam((y-yfrozen)[mask], Ared[mask,:], linsolver_result, regparam,
weights=weights[mask], regop=L, candidates=regparamrange,
noiselvl=noiselvl,searchrange=regparamrange,full_output=True)
alpha = output[0]
Expand Down
6 changes: 6 additions & 0 deletions docsrc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ Release Notes
- |fix| : Something which was not working as expected or leading to errors has been fixed.
- |api| : This will require changes in your scripts or code.

Release ``v1.1.2`` - September 2023
------------------------------------------
- |fix| : Fixes an error in the normalisation of the rice models (:pr:`459`).
- |fix| : Removes the broken three spin example (:pr:`427`).
- |fix| : Fixes an error in the linear solver for linearly constrained not non-negative problems.

Release ``v1.1.1`` - August 2023
------------------------------------------
- |fix| : Fixes an error in the `FitResult.evaluate` function. (:pr:`454`)
Expand Down
23 changes: 14 additions & 9 deletions docsrc/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ DeerLab installs the following packages:
* `joblib <https://joblib.readthedocs.io/en/latest/>`_ - Library lightweight pipelining and parallelization.
* `tqdm <https://github.com/tqdm/tqdm>`_ - A lightweight package for smart progress meters.
* `dill <https://github.com/uqfoundation/dill>`_ - An extension of Python's pickle module for serializing and de-serializing python objects.
* `quadprog <https://pypi.org/project/quadprog/>`_ - A quadratic programming solver
* `quadprog <https://pypi.org/project/quadprog/>`_ - A quadratic programming solver (Only for Python versions < 3.11)

Importing DeerLab
------------------
Expand Down Expand Up @@ -74,9 +74,6 @@ Any DeerLab version released after v0.10.0 can be installed via ``pip`` using th

python -m pip install deerlab==x.y.z

DeerLab version prior to 0.10 are written in MATLAB and are still available from an `archived repository <https://github.com/JeschkeLab/DeerLab-Matlab>`_.
Download and installation instruction for the MATLAB environment are provided in the released documentation. MATLAB releases have been deprecated and no further support is provided.


Installing from source
*****************************
Expand Down Expand Up @@ -130,10 +127,18 @@ On a **Windows** computer, if you are trying to run a DeerLab function, you migh

ImportError: DLL load failed: The specified module could not be found.

This happens when the MKL libraries have not been properly linked in ``numpy``, ``scipy`` or ``cvxopt``
installations (typically ``numpy``). This can happen due to firewall restrictions,
user rights, or internet connection issues during the DeerLab installation. To solve this, the
best solution is to manually install as follows.
This issue can occur when a specific python package is not installled properly. This typicaly happens when installing the MKL linked libaries but can
occur when installing packages normaly from PyPI. This can happen due to firewall restrictions,
user rights, or internet connection issues during the DeerLab installation.

If your where installing packages from PyPI (i.e. via pip) then please uninstall the package and reinstall it.

.. code-block:: text

python -m pip uninstall <package_name>
python -m pip install <package_name>

If you were trying to install the MKL linked libraries then please follow the instructions below.

1) Go to https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

Expand Down Expand Up @@ -167,7 +172,7 @@ During installation on certain systems (e.g. some computation clusters) using on
the following error might be raised during the installation:

.. code-block:: text

Error while finding module specification for 'setup.py'
(ModuleNotFoundError: __path__ attribute not found on 'setup' while trying to find 'setup.py')

Expand Down
95 changes: 0 additions & 95 deletions examples/advanced/ex_long_threespin_analysis.py

This file was deleted.