Skip to content

Commit

Permalink
Merge pull request #28 from derb12/development
Browse files Browse the repository at this point in the history
Merge development for v1.1.0
  • Loading branch information
derb12 authored Feb 18, 2024
2 parents 8a5c5e4 + bc3b8e8 commit a70bedd
Show file tree
Hide file tree
Showing 118 changed files with 16,030 additions and 1,511 deletions.
24 changes: 0 additions & 24 deletions .bumpversion.cfg

This file was deleted.

9 changes: 4 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
are required and/or what problems they fix. Link or add the issue number
for any existing issues that the pull request solves.
Note that unsolicited pull requests will most likely be closed.
Please file an issue first, so that details can be discussed/finalized
before a pull request is created.-->
Note that it is preferred to file an issue first, so that details can be
discussed/finalized before a pull request is created.-->


### Type of Pull Request
Expand All @@ -24,9 +23,9 @@ before a pull request is created.-->
To run tests locally, type the following command within the pybaselines
directory: pytest .
To lint files using flake8 to see if they pass PEP 8 standards and that
To lint files using ruff to see if they pass PEP 8 standards and that
docstrings are okay, run the following command within the pybaselines
directory: flake8 .
directory: ruff check .
To build documentation locally, type the following command within the
docs directory: make html
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/python-test-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# For testing the nightly builds of numpy and scipy so that any new changes will not be
# a surprise.

# Will only trigger if there is a change within pybaselines or tests directories.

name: test-latest-dependencies

on:
# allow manually activating the workflow
workflow_dispatch:

push:
branches: [ main ]
paths:
- 'pybaselines/**'
- 'tests/**'
- '.github/workflows/**'

pull_request:
# always trigger on a pull request, regardless of the branch
paths:
- 'pybaselines/**'
- 'tests/**'
- '.github/workflows/**'

jobs:
test-nightly:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Choose the latest stable python version
python-version: ['3.12']

steps:
- uses: actions/checkout@v4

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

- name: Install required dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
python -m pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
python -m pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple scipy
- name: Test with required dependencies
# use -Werror so that any warnings will show up as errors -> want to be as stringent
# as possible
run: python -Werror -m pytest .
71 changes: 36 additions & 35 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,87 +26,88 @@ on:
jobs:
test:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Use strings since yaml considers 3.10 equal to 3.1
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

- name: Install required dependencies
run: |
python -m pip install --upgrade pip
python -m pip install "numpy>=1.14" "scipy>=1.0" pytest
# Only lint a single version; pick a recent, stable version
- name: Install linting dependencies
id: install-linters
if: matrix.python-version == '3.9'
run: |
python -m pip install flake8 flake8-comprehensions flake8-docstrings
- name: Lint
if: steps.install-linters.outcome == 'success'
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --statistics
python -m pip install "numpy>=1.20" "scipy>=1.5" pytest
- name: Test with required dependencies
run: pytest .

- name: Install optional dependencies
id: install-optional
# uncomment below in case this step ever needs skipped again
#if: matrix.python-version != '3.11'
run: python -m pip install "pentapy>=1.0" "numba>=0.45"
# uncomment below to allow skipping future versions
#if: matrix.python-version != '3.13'
run: python -m pip install "pentapy>=1.1" "numba>=0.49"

- name: Test with optional dependencies
# uncomment below in case this step ever needs skipped again
if: steps.install-optional.outcome == 'success'
run: pytest .


test-min-dependencies:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.6']
python-version: ['3.8']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

- name: Install minimum dependencies
# Use numpy 1.14.5 rather than 1.14.0 since the optional
# dependency pentapy requires numpy>=1.14.5; no relevant difference
# between 1.14.0 and 1.14.5.
run: |
python -m pip install --upgrade pip
python -m pip install numpy==1.14.5 scipy==1.0 pytest
python -m pip install "numpy==1.20" "scipy==1.5" pytest
- name: Test with minimum required dependencies
run: pytest .

- name: Install minimum optional dependencies
# Have to pin llvmlite to 0.30.0 since it otherwise gets a more recent
# version that is imcompatible with numba v0.45
run: python -m pip install pentapy==1.0 numba==0.45 llvmlite==0.30.0
run: python -m pip install "pentapy==1.1" "numba==0.49"

- name: Test with minimum optional dependencies
run: pytest .

lint:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.11']

steps:
- uses: actions/checkout@v4

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

- name: Install linting dependencies
run: python -m pip install ruff

- name: Lint
run: ruff check .
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ docs/_build/

# sphinx-gallery output
docs/examples/
sg_execution_times.rst

# sphinx-autoapi output
docs/api
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.11"

# Path to sphinx's configuration file
sphinx:
Expand Down
56 changes: 56 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,62 @@
Changelog
=========

Version 1.1.0 (2024-02-18)
--------------------------

This is a minor version with new features, deprecations,
and documentation improvements.

New Features
~~~~~~~~~~~~

* Added two dimensional versions of various baseline correction algorithms,
with the focus on Whittaker-smoothing-based, spline, and polynomial methods.
These can be accessed using the new `Baseline2D` class.
* Added the `Baseline2D.individual_axes` method, which allows fitting each row and/or
column in two dimensional data with any one dimensional method in pybaselines.
* Added a version of the rubberband method to pybaselines.misc which allows fitting
individual segments within data to better fit concave-shaped data.
* Added the Customized Baseline Correction (custom_bc) method to
pybaselines.optimizers, which allows fitting baselines with controllable
levels of stiffness in different regions.
* Added a penalized version of mpls (pspline_mpls) to pybaselines.spline.
* Updated spline.mixture_model to use expectation-maximization rather than the previous
nieve approach of fitting the histogram of the residuals with the probability density
function. Should reduce calculation times.
* Added a function for penalized spline (P-spline) smoothing to pybaselines.utils,
`pybaselines.utils.pspline_smooth`, which will return a tuple of the smoothed input and
the knots, spline coefficients, and spline degree for any further use with
SciPy's BSpline.

Other Changes
~~~~~~~~~~~~~

* Officially list Python 3.12 as supported.
* Updated lowest supported Python version to 3.8
* Updated lowest supported dependency versions: NumPy 1.20, SciPy 1.5,
pentapy 1.1, and Numba 0.49
* Use SciPy's sparse arrays when the installed SciPy version is 1.12 or newer. This
only affects user codes if using functions from the pybaselines.utils module.
* Vendor SciPy's cwt and ricker functions, which were deprecated from SciPy in version 1.12.

Deprecations/Breaking Changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Deprecated passing `num_bins` to spline.mixture_model. The keyword argument will
be removed in version 1.3.
* Removed the pybaselines.config module, which was simply used to set the pentapy solver.
The same behavior can be done by setting the `pentapy_solver` attribute of a `Baseline`
object after initialization.

Documentation/Examples
~~~~~~~~~~~~~~~~~~~~~~

* Added a section of the documentation explaining the extension of baseline correction for
two dimensional data.
* Added new examples for 2D baseline correction and for custom_bc.


Version 1.0.0 (2022-10-26)
--------------------------

Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ repository-artifact: https://pypi.org/project/pybaselines
repository-code: https://github.com/derb12/pybaselines
title: "pybaselines: A Python library of algorithms for the baseline correction of experimental data"
type: software
version: 1.0.0
version: 1.1.0
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2021-2023, Donald Erb
Copyright (c) 2021-2024, Donald Erb
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
6 changes: 3 additions & 3 deletions LICENSES_bundled.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.


Source: SciPy (https://github.com/scipy/scipy, last accessed November 6, 2021)
File: pybaselines._spline_utils.py
Source: SciPy (https://github.com/scipy/scipy, last accessed December 28, 2023)
Files: pybaselines._spline_utils.py, pybaselines.classification.py
License: 3-clause BSD

Copyright (c) 2001-2002 Enthought, Inc. 2003-2019, SciPy Developers.
Copyright (c) 2001-2002 Enthought, Inc. 2003-2023, SciPy Developers.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
17 changes: 0 additions & 17 deletions MANIFEST.in

This file was deleted.

Loading

0 comments on commit a70bedd

Please sign in to comment.