Skip to content

Commit

Permalink
Patch v0.14.1 (#332)
Browse files Browse the repository at this point in the history
* bumb version to v0.15.0-dev (#307)

* examples: fix identifiablity analysis grid values (#314)

* remove line that should be substituted by the subsequent GHA (#313)

* Use Scipy's `eigh` instead of Numpy's to avoid convergence error (#311)

* Use Scipy's eigh instead of Numpy's to avoid convergence error

* fix error

* Enable the pickling of DeerLab's objects  (#312)

* fix pickling of fit result objects

* add save and load utility functions for pickling, add test

* improve test

* fix pickling of model objects

* fix pickling of merged and linearly combined models

* fix pickling of model objects with linked parameters

* fix some tests

* fix pickling of model objects with functionalized parameters

- introduces the dill package as a dependency

* fix error

* improve docstrings and add to API reference

* rename save to store_pickle and load to load_pickle

add safety warning about reading pickles

* rename imports

* remove unused import

* fix another import error

* `docs`: add important note to user guide on experimental deadtime correction  (#320)

* Fix dependency of DeerLab's documentation logo on system fonts (#328)

* add specific web font of DeerLab's title font

* docs: make web logo independent of system fonts

* docs: minor CSS fixes

* fix minor bug when printing fit results with most parameters frozen (#329)

* Fix bug when propagating bootstrapped uncertainty in presence of round-off errors (#325)

* UQresult: expand join() method to work with bootstrapped results

* fix bug when propagating bootstrapped results with round-off errors

* docs: add docstring for evaluate and propagate methods (#321)

* bump version to v0.14.1

* update changelog

* docs: minor edits, CSS fixes, and one 404 fix (#331)

* docs: minor edits, CSS fixes, and one 404 fix

* add missing functions to reference

* minor edit and fix

* update changelog
  • Loading branch information
luisfabib authored Jun 3, 2022
1 parent 2844b54 commit 2767550
Show file tree
Hide file tree
Showing 30 changed files with 10,272 additions and 9,879 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/package_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ jobs:
python -m pip install setuptools --user
python -m pip install build --user
python -m pip install twine --user
- name: PyPI - Build and publish
- name: Build distribution
run: |
python setup.py sdist
python -m twine upload dist/*
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.14.0
v0.14.1
1 change: 1 addition & 0 deletions deerlab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
from .classes import FitResult, UQResult
from .diststats import diststats
from .profile_analysis import profile_analysis
from .utils import store_pickle, read_pickle
36 changes: 24 additions & 12 deletions deerlab/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,25 +209,34 @@ def join(self,*args):
Joined uncertainty quantification object with a total of ``M + N1 + N2 + ... + Nn`` parameters.
The parameter vectors are concatenated on the order they are passed.
"""
# Original metadata
mean = self.mean
covmat = self.covmat
lbm = self.__lb
ubm = self.__ub

newargs = []
if self.type=='covariance':
# Original metadata
newargs.append(self.mean)
newargs.append(self.covmat)
newargs.append(self.__lb)
newargs.append(self.__ub)
elif self.type=='bootstrap':
newargs.append(self.samples)

for uq in args:
if not isinstance(uq, UQResult):
raise TypeError('Only UQResult objects can be joined.')
if uq.type!=self.type:
raise TypeError(f'A UQResult of type ({uq.type}) and another of type ({self.type}) cannot be joined.')
if uq.type=='void':
raise TypeError('Void UQResults cannot be joined.')
# Concatenate metadata of external UQResult objects
mean = np.concatenate([mean, uq.mean])
covmat = block_diag(covmat, uq.covmat)
lbm = np.concatenate([lbm, uq.__lb])
ubm = np.concatenate([ubm, uq.__ub])

if self.type=='covariance':
newargs[0] = np.concatenate([newargs[0], uq.mean])
newargs[1] = block_diag(newargs[1], uq.covmat)
newargs[2] = np.concatenate([newargs[2], uq.__lb])
newargs[3] = np.concatenate([newargs[3], uq.__ub])
elif self.type=='bootstrap':
newargs[0] = np.concatenate([newargs[0],uq.samples],axis=1)

# Return new UQResult object with combined information
return UQResult('covariance',mean,covmat,lbm,ubm)
return UQResult(self.type,*newargs)
#--------------------------------------------------------------------------------


Expand Down Expand Up @@ -264,6 +273,9 @@ def pardist(self,n=0):
# Get bw using silverman's rule (1D only)
samplen = self.samples[:, n].real

# Take limited precision into account to avoid round-off errors
samplen = np.round(samplen,200)

if np.all(samplen == samplen[0]):
# Dirac's delta distribution
x = np.array([0.9*samplen[0],samplen[0],1.1*samplen[0]])
Expand Down
Loading

0 comments on commit 2767550

Please sign in to comment.