Skip to content

Commit

Permalink
chore: make csaps optional
Browse files Browse the repository at this point in the history
  • Loading branch information
kmnhan committed Apr 3, 2024
1 parent dd2c022 commit db31b06
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 7 deletions.
27 changes: 27 additions & 0 deletions docs/source/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,31 @@ are sufficient for most use cases.
* - `pyqtgraph <https://pyqtgraph.readthedocs.io/en/latest/>`_
- Interactive plotting (i.e., imagetool)

For the full list of dependencies, see the `requirements.txt` file.

See the :doc:`userguide` to start using ERLabPy!


Optional dependencies
---------------------

The following packages are optional dependencies that are not installed by
default. They are used in only specific functions, or is not used at all but is
listed just for convenience.

.. list-table::
:header-rows: 1
:stub-columns: 1
:widths: auto

* - Package
- Description
* - `csaps <https://github.com/espdev/csaps>`_
- Multidimensional smoothing splines
* - `hvplot <https://github.com/holoviz/hvplot>`_ and `bokeh
<https://github.com/bokeh/bokeh>`_
- Interactive plotting
* - `cmasher <https://cmasher.readthedocs.io>`_,
`cmocean <https://matplotlib.org/cmocean/>`_, and
`colorcet <https://colorcet.holoviz.org>`_
- More colormaps!
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,5 @@ dependencies:
- pyperclip
- pip:
- pyqt6>=6.2.2
- csaps
- igor2 @ git+https://github.com/kmnhan/igor2@master
- arpes @ git+https://github.com/kmnhan/arpes@master
1 change: 0 additions & 1 deletion environment_apple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,5 @@ dependencies:
- pyperclip
- pip:
- pyqt6>=6.2.2
- csaps
- igor2 @ git+https://github.com/kmnhan/igor2@master
- arpes @ git+https://github.com/kmnhan/arpes@master
1 change: 0 additions & 1 deletion environment_nogit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@ dependencies:
- pyperclip
- pip:
- pyqt6>=6.2.2
- csaps
1 change: 0 additions & 1 deletion environment_nogit_mkl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@ dependencies:
- pyperclip
- pip:
- pyqt6>=6.2.2
- csaps
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ dependencies = [
"lmfit>=1.2.0",
"uncertainties>=3.0.1",
"iminuit>=2.25.2",
"csaps",
"matplotlib>=3.8.0",
"xarray",
"h5netcdf",
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ scipy>=1.8.0
lmfit>=1.2.0
uncertainties>=3.0.1
iminuit>=2.25.2
csaps
matplotlib>=3.8.0
xarray
h5netcdf
Expand Down
9 changes: 8 additions & 1 deletion src/erlab/analysis/fit/spline.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import csaps
import xarray as xr

try:
import csaps
except ImportError as e:
raise ImportError(
"The `csaps` package is required for this module. "
"Please install it using `pip install csaps`."
) from e


def xcsaps(
arr: xr.DataArray, **kwargs: dict
Expand Down

0 comments on commit db31b06

Please sign in to comment.