Skip to content

Commit

Permalink
Version 1.0.1 (#421)
Browse files Browse the repository at this point in the history
* Update changelog.rst

* Update changelog.rst

* Update VERSION

* Bug fix in setup.py

* Updating patch from main (#420)

* remove hard-wired RNG seeding (#417)

* Fix Examples issue and update CI actions (#416)

* Update ci_scheduled.yml

- Removed MKL Linking tests
- Removed complex cache@v2 that raises warnings and moved to setup-python@v4

* Update ci_PR.yml

- Removed MKL linking
- Updated setup-python version to v4

* Fix Example issues

Fixed an issue with simulation examples

* Removed cvxopt tests and replaced with quadprog

* Updated selregparam tests

- Moved tests to quadprog method
- Introduced tighter bounds on the searchrange
- Tested values are now mostly using grid method, except where this failed where a Brent method is taken. This is not idea but does at least freeze the situation. 
- change P in test_compensate_condition to match alpha tests

* Hard code out 3.11 support

* Rename file to American English

---------

Co-authored-by: Stefan Stoll <stestoll@users.noreply.github.com>

---------

Co-authored-by: Stefan Stoll <stestoll@users.noreply.github.com>
  • Loading branch information
HKaras and stestoll authored Mar 22, 2023
1 parent 0a90800 commit 5496cff
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 89 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/ci_PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,18 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
cache: 'pip'
cache-dependency-path: setup.py
- run: |
python -m pip install --upgrade pip
pip install wheel
pip install .
- name: Windows MKL linking
if: matrix.os == 'windows-latest'
run: |
python upgrade_mkl.py
- name: Test with pytest
run: |
pytest
78 changes: 42 additions & 36 deletions .github/workflows/ci_scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,57 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.8, 3.9, "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: setup.py
- run: |
python -m pip install --upgrade pip
pip install wheel
pip install .
- uses: actions/cache@v2
if: startsWith(runner.os, 'Windows')
with:
path: |
~\AppData\Local\pip\Cache
key: ${{ runner.os }}-${{ hashFiles('**/setup.py') }}
restore-keys: |
{{ runner.os }}-pip-
# - uses: actions/cache@v2
# if: startsWith(runner.os, 'Windows')
# with:
# path: |
# ~\AppData\Local\pip\Cache
# key: ${{ runner.os }}-${{ hashFiles('**/setup.py') }}
# restore-keys: |
# {{ runner.os }}-pip-

- uses: actions/cache@v2
if: startsWith(runner.os, 'macOS')
with:
path: |
~/Library/Caches/pip
key: ${{ runner.os }}-${{ hashFiles('**/setup.py') }}
restore-keys: |
{{ runner.os }}-pip-
# - uses: actions/cache@v2
# if: startsWith(runner.os, 'macOS')
# with:
# path: |
# ~/Library/Caches/pip
# key: ${{ runner.os }}-${{ hashFiles('**/setup.py') }}
# restore-keys: |
# {{ runner.os }}-pip-

- uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
with:
path: |
~/.cache/pip
key: ${{ runner.os }}-${{ hashFiles('**/setup.py') }}
restore-keys: |
{{ runner.os }}-pip-
# - uses: actions/cache@v2
# if: startsWith(runner.os, 'Linux')
# with:
# path: |
# ~/.cache/pip
# key: ${{ runner.os }}-${{ hashFiles('**/setup.py') }}
# restore-keys: |
# {{ runner.os }}-pip-

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'false'
run: |
python -m pip install --upgrade pip
pip install wheel
pip install .
# - name: Install dependencies
# if: steps.cache.outputs.cache-hit != 'false'
# run: |
# python -m pip install --upgrade pip
# pip install wheel
# pip install .

- name: Windows MKL linking
if: matrix.os == 'windows-latest'
run: |
python upgrade_mkl.py
# - name: Windows MKL linking
# if: matrix.os == 'windows-latest'
# run: |
# python upgrade_mkl.py

- name: Test with pytest
run: pytest
1 change: 0 additions & 1 deletion deerlab/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,6 @@ def propagate(self,model,lb=None,ub=None,samples=None):
# Get the parameter uncertainty distribution
values,pdf = self.pardist(n)
# Random sampling form the uncertainty distribution
np.random.seed(0)
sampled_parameters[n] = [np.random.choice(values, p=pdf/sum(pdf)) for _ in range(Nsamples)]
# Convert to matrix
sampled_parameters = np.atleast_2d(sampled_parameters)
Expand Down
2 changes: 1 addition & 1 deletion deerlab/dipolarkernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def dipolarkernel(t, r, *, pathways=None, mod=None, bg=None, method='fresnel', e
The vector ``tinterp`` must cover all possible time shifts of the original ``t`` by the different refocusing times of the dipolar pathways.
Returns
--------
-------
K : ndarray
Dipolar kernel matrix.
Expand Down
2 changes: 0 additions & 2 deletions deerlab/dipolarmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ def dipolarpathways(*param):
#-----------------------------------------------------------------------
def _Pmultivar(param):
rmeans,cholesky_factors = param[:Q], param[Q:]
np.random.seed(seed=1)
Σ = choleskycovmat(Q,cholesky_factors)
Pmultivar = multivariate_normal(rmeans, cov=Σ)
return Pmultivar
Expand Down Expand Up @@ -470,7 +469,6 @@ def Vmultispin_nonlinear_fcn(*nonlin):

# Sample from the multi-variate distance distribution
Nsamples = 1000000
np.random.seed(seed=1)
rsamples = Pmodel.nonlinmodel(nonlin[Psubset]).rvs(Nsamples)
rsamples = np.maximum(rsamples,1e-16) # Avoid values exactly at zero

Expand Down
File renamed without changes.
5 changes: 2 additions & 3 deletions examples/basic_simulations/ex_simulate_4pdeer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@

# Experiment model
experiment = dl.ex_4pdeer(tau1,tau2, pathways=[1,2,3])
reftime1 = experiment.reftimes[0]
reftime2 = experiment.reftimes[1]
reftime3 = experiment.reftimes[2]
reftime1, reftime2, reftime3 = experiment.reftimes(tau1,tau2)


# Construct the dipolar signal model
Vmodel = dl.dipolarmodel(t,r,Pmodel=dl.dd_gauss, experiment=experiment)
Expand Down
3 changes: 1 addition & 2 deletions examples/basic_simulations/ex_simulate_5pdeer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
r = np.arange(rmin,rmax,Δr)

experiment = dl.ex_rev5pdeer(tau1,tau2,tau3, pathways=[1,2])
reftime1 = experiment.reftimes[0]
reftime2 = experiment.reftimes[1]
reftime1, reftime2 = experiment.reftimes(tau1,tau2,tau3)

# Construct the dipolar signal model
Vmodel = dl.dipolarmodel(t,r,Pmodel=dl.dd_gauss, experiment=experiment)
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'Documentation': 'https://jeschkelab.github.io/DeerLab/',
'Source': 'https://github.com/JeschkeLab/DeerLab',
},
python_requires='>=3.8',
python_requires='>=3.8,<3.11',
license='LICENSE.txt',
include_package_data = True,
keywords='data analysis modeling least-squares EPR spectroscopy DEER PELDOR'.split(),
Expand All @@ -22,7 +22,7 @@
'numpy>=1.22.4',
'cvxopt>=1.0.0',
'scipy>=1.6.3',
'joblib>-1.0.0',
'joblib>=1.0.0',
'dill>=0.3.0',
'tqdm>=4.51.0',
'matplotlib>=3.3.4',
Expand All @@ -44,4 +44,4 @@
'Programming Language :: Python :: 3.10',
'Topic :: Scientific/Engineering',
]
)
)
Loading

0 comments on commit 5496cff

Please sign in to comment.