Skip to content
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
11 changes: 0 additions & 11 deletions .github/actions/conda_build_publish_package/Dockerfile

This file was deleted.

63 changes: 0 additions & 63 deletions .github/actions/conda_build_publish_package/README.md

This file was deleted.

21 changes: 0 additions & 21 deletions .github/actions/conda_build_publish_package/action.yml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/actions/conda_build_publish_package/entrypoint.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/deploy_ghpages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install pydata-sphinx-theme==0.7.1
python -m pip install numpydoc
python -m pip install sphinx-gallery
python -m pip install sphinx-gallery==0.9.0
python -m pip install sphinxcontrib-httpdomain
python -m pip install sphinxcontrib-ghcontributors
python -m pip install sphinx-issues
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs_PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install pydata-sphinx-theme==0.7.1
python -m pip install numpydoc
python -m pip install sphinx-gallery
python -m pip install sphinx-gallery==0.9.0
python -m pip install sphinxcontrib-httpdomain
python -m pip install sphinxcontrib-ghcontributors
python -m pip install sphinx-copybutton
Expand Down
27 changes: 1 addition & 26 deletions .github/workflows/package_upload.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build & Upload Python Package
name: Build & Upload DeerLab to PyPI

on:
release:
Expand Down Expand Up @@ -26,28 +26,3 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

conda-build-n-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Get DeerLab version
run: echo "DEERLAB_VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: Update version in Conda metadata
uses: jacobtomlinson/gha-find-replace@master
with:
find: "VERSION"
replace: ${{env.DEERLAB_VERSION}}
include: "conda.recipe/meta.yaml"
- name: Build & Publish to Anaconda
uses: ./.github/actions/conda_build_publish_package
with:
subdir: 'conda.recipe'
anacondatoken: ${{ secrets.ANACONDA_TOKEN }}
platforms: 'osx-64 linux-32 linux-64 win-32 win-64'
python: '3.8 3.9 3.10'
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# DeerLab

[![https://jeschkelab.github.io/DeerLab/](https://img.shields.io/pypi/v/deerlab)](https://pypi.org/project/DeerLab/)
[![https://img.shields.io/conda/v/JeschkeLab/deerlab](https://img.shields.io/conda/v/JeschkeLab/deerlab)](https://anaconda.org/jeschkelab/deerlab)
[![Website](https://img.shields.io/website?down_message=offline&label=Documentation&up_message=online&url=https%3A%2F%2Fjeschkelab.github.io%2FDeerLab%2Findex.html)](https://jeschkelab.github.io/DeerLab/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/deerlab)](https://www.python.org/downloads/)
![PyPI - Downloads](https://img.shields.io/pypi/dm/deerlab?color=brightgreen)
Expand All @@ -23,16 +22,12 @@ All additional dependencies are automatically downloaded and installed during th

## Setup

A pre-built distribution can be installed from the PyPI repository using `pip` or from the Anaconda repository using `conda`.
A pre-built distribution can be installed from the PyPI repository using `pip`.

From a terminal (preferably with admin privileges) use the following command to install from PyPI:

python -m pip install deerlab

or the following command to install from Anaconda:

conda install deerlab -c JeschkeLab

More details on the installation and updating of DeerLab can be found [here](https://jeschkelab.github.io/DeerLab/installation.html).

## Citing DeerLab
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.14.4
v0.14.5
2 changes: 0 additions & 2 deletions conda.recipe/build.bat

This file was deleted.

1 change: 0 additions & 1 deletion conda.recipe/build.sh

This file was deleted.

36 changes: 0 additions & 36 deletions conda.recipe/meta.yaml

This file was deleted.

44 changes: 0 additions & 44 deletions conda.recipe/package_conda.bat

This file was deleted.

2 changes: 1 addition & 1 deletion deerlab/bootstrap_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def sample():

# Assert that all outputs are strictly numerical
for var in varargout:
if not all(isnumeric(x) for x in var):
if not all(isnumeric(x) for x in np.atleast_1d(var)):
raise ValueError('Non-numeric output arguments by the analyzed function are not accepted.')

# Check that the full bootstrap analysis will not exceed the memory limits
Expand Down
14 changes: 10 additions & 4 deletions deerlab/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ def decorator(func):
#==============================================================================================
@insert_snlls_optionals_docstrings()
def fit(model_, y, *constants, par0=None, penalties=None, bootstrap=0, noiselvl=None, mask=None, weights=None,
regparam='aic',reg='auto',regparamrange=None,**kwargs):
regparam='aic',reg='auto',regparamrange=None, bootcores=1,**kwargs):
r"""
Fit the model(s) to the dataset(s)

Expand Down Expand Up @@ -1051,6 +1051,10 @@ def fit(model_, y, *constants, par0=None, penalties=None, bootstrap=0, noiselvl=
bootstrap : scalar, optional,
Bootstrap samples for uncertainty quantification. If ``bootstrap>0``, the uncertainty quantification will be
performed via the boostrapping method with based on the number of samples specified as the argument.

bootcores : scalar, optional
Number of CPU cores/processes for parallelization of the bootstrap uncertainty quantification. If ``cores=1`` no parallel
computing is used. If ``cores=-1`` all available CPUs are used. The default is one core (no parallelization).

reg : boolean or string, optional
Determines the use of regularization on the solution of the linear problem.
Expand Down Expand Up @@ -1127,6 +1131,8 @@ def fit(model_, y, *constants, par0=None, penalties=None, bootstrap=0, noiselvl=
Uncertainty quantification of the fitted model response.
regparam : scalar
Regularization parameter value used for the regularization of the linear parameters.
penweights : scalar or list thereof
Penalty weight value(s) used for the penalties specified through ``penalties``.
plot : callable
Function to display the results. It will display the fitted data.
The function returns the figure object (``matplotlib.figure.Figure``)
Expand All @@ -1143,13 +1149,13 @@ def fit(model_, y, *constants, par0=None, penalties=None, bootstrap=0, noiselvl=
* ``stats['bic']`` - Bayesian information criterion
cost : float
Value of the cost function at the solution.

noiselvl : ndarray
Estimated or user-given noise standard deviations of the individual datasets.
evaluate(model, constants) : callable
Function to evaluate a model at the fitted parameter values. Takes a model object or callable function ``model`` to be evaluated.
All the parameters in the model or in the callable definition must match their corresponding parameter names in the ``FitResult`` object.
Any model constants present required by the model must be specified as a second argument ``constants``.
It returns the model's response at the fitted parameter values as an ndarray.

propagate(model,constants,lb,ub) : callable
Function to propagate the uncertainty in the fit results to a model's response. Takes a model object or callable function ``model`` to be evaluated.
All the parameters in the model or in the callable definition must match their corresponding parameter names in the ``FitResult`` object.
Expand Down Expand Up @@ -1263,7 +1269,7 @@ def bootstrap_fcn(ysim):
if not isinstance(fit.model,list): fit.model = [fit.model]
return (fit.param,*fit.model)
# Bootstrapped uncertainty quantification
param_uq = bootstrap_analysis(bootstrap_fcn,ysplit,fitresults.model,samples=bootstrap,noiselvl=noiselvl)
param_uq = bootstrap_analysis(bootstrap_fcn,ysplit,fitresults.model,samples=bootstrap,noiselvl=noiselvl,cores=bootcores)
# Include information on the boundaries for better uncertainty estimates
paramlb = model._vecsort(model._getvector('lb'))[np.concatenate(param_idx)]
paramub = model._vecsort(model._getvector('ub'))[np.concatenate(param_idx)]
Expand Down
Loading