Skip to content

Commit

Permalink
Merge pull request #28 from kmnhan/dev-2.4
Browse files Browse the repository at this point in the history
2.4 Release
  • Loading branch information
kmnhan authored May 2, 2024
2 parents 433ee9e + 37c1b4b commit 5d1f8fc
Show file tree
Hide file tree
Showing 62 changed files with 1,441 additions and 865 deletions.
1 change: 0 additions & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ dependencies:
- nbsphinx
- furo
- sphinx-design
- pyperclip
- ipywidgets
- pip:
- pyqt6>=6.2.2
Expand Down
34 changes: 1 addition & 33 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
dask>=2024.4.1
h5netcdf>=1.2.0
igor2>=0.5.6
iminuit>=2.25.2
joblib>=1.3.2
lmfit>=1.2.0,!=1.3.0
matplotlib>=3.8.0
numba>=0.59.0
numbagg>=0.8.1
numpy>=1.26.0
pyperclip>=1.8.2
pyqt6>=6.2.2
PyQt6-Qt6<6.7.0
pyqtgraph>=0.13.1
qtawesome>=1.3.1
qtpy>=2.4.1
scipy>=1.12.0
tqdm>=4.66.2
uncertainties>=3.1.4
varname>=0.13.0
xarray>=2024.02.0
sphinx
sphinx-autodoc-typehints
setuptools
nbsphinx
furo
sphinx-design
sphinx-qt-documentation
sphinx-copybutton
sphinxcontrib-bibtex
pybtex
hvplot
csaps
ipykernel
ipywidgets
-e .
-e '.[viz,perf,misc,docs]'
63 changes: 34 additions & 29 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@

# based on numpy doc/source/conf.py
def linkcode_resolve(domain, info):
"""
Determine the URL corresponding to Python object
"""
"""Determine the URL corresponding to Python object."""
if domain != "py":
return None

Expand Down Expand Up @@ -123,23 +121,20 @@ def linkcode_resolve(domain, info):
autosummary_generate = True
autosummary_generate_overwrite = True

autodoc_inherit_docstrings = False
autodoc_typehints = "description"
autodoc_typehints_format = "short"
autodoc_class_signature = "mixed"
autodoc_member_order = "bysource"
autodoc_member_order = "groupwise"
autodoc_default_options = {
"members": True,
"undoc-members": True,
# "exclude-members":("sigDataChanged",),
"show-inheritance": False,
}
autodoc_typehints = "description"
autodoc_typehints_description_target = "documented"
# autodoc_type_aliases = {}
autodoc_typehints_format = "short"
autodoc_preserve_defaults = True
autodoc_inherit_docstrings = False

# autodoc_type_aliases = {
# "numpy.float64": "float",
# "float64": "float",
# }

# -- Napoleon settings -------------------------------------------------------

Expand All @@ -149,17 +144,26 @@ def linkcode_resolve(domain, info):
# napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = True
# napoleon_use_admonition_for_examples = False
# napoleon_use_admonition_for_notes = False
napoleon_use_admonition_for_notes = True
# napoleon_use_admonition_for_references = False
# napoleon_use_ivar = False
napoleon_use_ivar = True
napoleon_use_param = True
napoleon_use_keyword = False
# napoleon_use_rtype = True
napoleon_preprocess_types = True
# napoleon_type_aliases = {
# "array-like": "ndarray <numpy.ndarray>",
# "numpy.float64": "float",
# "float64": "float",
# }

napoleon_type_aliases = {
"np.float32": "float32",
"numpy.float32": "float32",
"np.float64": "float64",
"numpy.float64": "float64",
"xr.DataArray": "xarray.DataArray",
"array-like": "`array-like <numpy.typing.ArrayLike>`",
"array_like": "`array-like <numpy.typing.ArrayLike>`",
"ColorType": "`ColorType <matplotlib.typing.ColorType>`",
"RGBColorType": "`RGBColorType <matplotlib.typing.RGBColorType>`",
"RGBAColorType": "`RGBAColorType <matplotlib.typing.RGBAColorType>`",
}
napoleon_attr_annotations = True
napoleon_custom_sections = [("Signals", "params_style")]

Expand Down Expand Up @@ -214,8 +218,9 @@ def top_level(children, data):


class APSStyle(pybtex.style.formatting.unsrt.Style):
"""
APS style for BibTeX formatting, adapted from the conf.py file of the `mitiq
"""APS style for BibTeX formatting.
Adapted from the conf.py file of the `mitiq
library<https://github.com/unitaryfund/mitiq>`_.
"""

Expand Down Expand Up @@ -465,14 +470,14 @@ def get_inproceedings_template(self, e):
"class": "",
},
],
"light_css_variables": {
"color-brand-primary": "#6d50bf",
"color-brand-content": "#6d50bf",
},
"dark_css_variables": {
"color-brand-primary": "#a180ff",
"color-brand-content": "#a180ff",
},
# "light_css_variables": {
# "color-brand-primary": "#6d50bf",
# "color-brand-content": "#6d50bf",
# },
# "dark_css_variables": {
# "color-brand-primary": "#a180ff",
# "color-brand-content": "#a180ff",
# },
}

# -- LaTeX options -----------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ reflected in the package without having to reinstall it. Before installing:

.. code-block:: sh
pip install -e . --config-settings editable_mode=compat
pip install -e ".[dev]" --config-settings editable_mode=compat
Updating the editable installation
Expand Down
56 changes: 37 additions & 19 deletions docs/source/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ conda environment, you can install ERLabPy with the conda command line tool: ::

conda install -c conda-forge erlab

Add any `optional dependencies`_ you want to install to the command above.

.. hint::

If you are using macOS, you might experience degraded performance with the
Expand All @@ -31,7 +33,14 @@ conda environment, you can install ERLabPy with the conda command line tool: ::

If you don’t use conda, you can install ERLabPy with pip: ::

pip install erlab
python -m pip install erlab

Optional dependency groups can be installed with the following commands: ::

python -m pip install erlab[viz] # Install optional dependencies for visualization
python -m pip install erlab[perf] # Install optional dependencies for performance
python -m pip install erlab[misc] # Install miscellaneous optional dependencies
python -m pip install erlab[complete] # Install all optional dependencies

If you wish to install ERLabPy from source, see the :doc:`contributing`.

Expand Down Expand Up @@ -70,26 +79,14 @@ select the appropriate library based on what is installed.

See the :doc:`user-guide/index` to start using ERLabPy!

Notes on compatibility
----------------------

- ERLabPy is tested on Python 3.11 and 3.12. It is not guaranteed to work on older
versions of Python.
- There are some `known compatibility issues
<https://github.com/kmnhan/erlabpy/issues/17>`_ with PyQt5 and PySide2, so it is
recommended to use the newer PyQt6 or PySide6 if possible.
- If you meet any unexpected behaviour while using IPython's `autoreload extension
<https://ipython.readthedocs.io/en/stable/config/extensions/autoreload.html>`_, try
excluding the following modules: ::

%aimport -erlab.io.dataloader -erlab.accessors
.. _optional dependencies:

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.
The following packages are optional dependencies that are not installed by default. They
are only used in specific functions, or is not used at all but is listed just for
convenience.

.. list-table::
:header-rows: 1
Expand All @@ -100,18 +97,39 @@ listed just for convenience.
- Description
* - `csaps <https://github.com/espdev/csaps>`_
- Multidimensional smoothing splines
* - `ipywidgets <https://github.com/jupyter-widgets/ipywidgets>`_
- Interactive widgets
* - `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!
* - `numbagg <https://github.com/numbagg/numbagg>`_ and `bottleneck
<https://github.com/pydata/bottleneck>`_
- Fast multidimensional aggregation, accelerates xarray

For a full list of dependencies and optional dependencies, take a look at the ``[project]`` and ``[project.optional-dependencies]`` section in
`pyproject.toml <https://github.com/kmnhan/erlabpy/blob/main/pyproject.toml>`_:
For a full list of dependencies and optional dependencies, take a look at the
``[project]`` and ``[project.optional-dependencies]`` section in `pyproject.toml
<https://github.com/kmnhan/erlabpy/blob/main/pyproject.toml>`_:

.. literalinclude:: ../../pyproject.toml
:language: toml
:start-at: dependencies = [
:end-before: [project.urls]


Notes on compatibility
----------------------

- ERLabPy is tested on Python 3.11 and 3.12. It is not guaranteed to work on older
versions of Python.
- There are some `known compatibility issues
<https://github.com/kmnhan/erlabpy/issues/17>`_ with PyQt5 and PySide2, so it is
recommended to use the newer PyQt6 or PySide6 if possible.
- If you meet any unexpected behaviour while using IPython's `autoreload extension
<https://ipython.readthedocs.io/en/stable/config/extensions/autoreload.html>`_, try
excluding the following modules: ::

%aimport -erlab.io.dataloader -erlab.accessors
5 changes: 2 additions & 3 deletions docs/source/user-guide/curve-fitting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import xarray as xr\n",
"\n",
"from erlab.io.exampledata import generate_data"
]
},
Expand Down Expand Up @@ -423,7 +422,7 @@
"model = MultiPeakModel(npeaks=4, peak_shapes=[\"lorentzian\"], fd=False, convolve=True)\n",
"\n",
"params = model.make_params(\n",
" p0_center=-0.59,\n",
" p0_center=-0.6,\n",
" p1_center=-0.45,\n",
" p2_center=0.45,\n",
" p3_center=0.6,\n",
Expand Down Expand Up @@ -995,7 +994,7 @@
" model,\n",
" mdc,\n",
" mdc.kx,\n",
" p0_center=-0.59,\n",
" p0_center=-0.6,\n",
" p1_center=-0.45,\n",
" p2_center=0.45,\n",
" p3_center=0.6,\n",
Expand Down
Loading

0 comments on commit 5d1f8fc

Please sign in to comment.