Skip to content

Commit a70bedd

Browse files
authored
Merge pull request #28 from derb12/development
Merge development for v1.1.0
2 parents 8a5c5e4 + bc3b8e8 commit a70bedd

File tree

118 files changed

+16030
-1511
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+16030
-1511
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

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

1211

1312
### Type of Pull Request
@@ -24,9 +23,9 @@ before a pull request is created.-->
2423
To run tests locally, type the following command within the pybaselines
2524
directory: pytest .
2625
27-
To lint files using flake8 to see if they pass PEP 8 standards and that
26+
To lint files using ruff to see if they pass PEP 8 standards and that
2827
docstrings are okay, run the following command within the pybaselines
29-
directory: flake8 .
28+
directory: ruff check .
3029
3130
To build documentation locally, type the following command within the
3231
docs directory: make html
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# For testing the nightly builds of numpy and scipy so that any new changes will not be
2+
# a surprise.
3+
4+
# Will only trigger if there is a change within pybaselines or tests directories.
5+
6+
name: test-latest-dependencies
7+
8+
on:
9+
# allow manually activating the workflow
10+
workflow_dispatch:
11+
12+
push:
13+
branches: [ main ]
14+
paths:
15+
- 'pybaselines/**'
16+
- 'tests/**'
17+
- '.github/workflows/**'
18+
19+
pull_request:
20+
# always trigger on a pull request, regardless of the branch
21+
paths:
22+
- 'pybaselines/**'
23+
- 'tests/**'
24+
- '.github/workflows/**'
25+
26+
jobs:
27+
test-nightly:
28+
29+
runs-on: ubuntu-latest
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
# Choose the latest stable python version
34+
python-version: ['3.12']
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Set up Python ${{ matrix.python-version }}
40+
uses: actions/setup-python@v5
41+
with:
42+
python-version: ${{ matrix.python-version }}
43+
44+
- name: Install required dependencies
45+
run: |
46+
python -m pip install --upgrade pip
47+
python -m pip install pytest
48+
python -m pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
49+
python -m pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple scipy
50+
51+
- name: Test with required dependencies
52+
# use -Werror so that any warnings will show up as errors -> want to be as stringent
53+
# as possible
54+
run: python -Werror -m pytest .

.github/workflows/python-test.yml

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,87 +26,88 @@ on:
2626
jobs:
2727
test:
2828

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

3636
steps:
37-
- uses: actions/checkout@v3
37+
- uses: actions/checkout@v4
3838

3939
- name: Set up Python ${{ matrix.python-version }}
40-
uses: actions/setup-python@v4
40+
uses: actions/setup-python@v5
4141
with:
4242
python-version: ${{ matrix.python-version }}
4343

4444
- name: Install required dependencies
4545
run: |
4646
python -m pip install --upgrade pip
47-
python -m pip install "numpy>=1.14" "scipy>=1.0" pytest
48-
49-
# Only lint a single version; pick a recent, stable version
50-
- name: Install linting dependencies
51-
id: install-linters
52-
if: matrix.python-version == '3.9'
53-
run: |
54-
python -m pip install flake8 flake8-comprehensions flake8-docstrings
55-
56-
- name: Lint
57-
if: steps.install-linters.outcome == 'success'
58-
run: |
59-
# stop the build if there are Python syntax errors or undefined names
60-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
61-
# exit-zero treats all errors as warnings.
62-
flake8 . --count --exit-zero --statistics
47+
python -m pip install "numpy>=1.20" "scipy>=1.5" pytest
6348
6449
- name: Test with required dependencies
6550
run: pytest .
6651

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

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

7862

7963
test-min-dependencies:
8064

81-
runs-on: ubuntu-20.04
65+
runs-on: ubuntu-latest
8266
strategy:
8367
fail-fast: false
8468
matrix:
85-
python-version: ['3.6']
69+
python-version: ['3.8']
8670

8771
steps:
88-
- uses: actions/checkout@v3
72+
- uses: actions/checkout@v4
8973

9074
- name: Set up Python ${{ matrix.python-version }}
91-
uses: actions/setup-python@v4
75+
uses: actions/setup-python@v5
9276
with:
9377
python-version: ${{ matrix.python-version }}
9478

9579
- name: Install minimum dependencies
96-
# Use numpy 1.14.5 rather than 1.14.0 since the optional
97-
# dependency pentapy requires numpy>=1.14.5; no relevant difference
98-
# between 1.14.0 and 1.14.5.
9980
run: |
10081
python -m pip install --upgrade pip
101-
python -m pip install numpy==1.14.5 scipy==1.0 pytest
82+
python -m pip install "numpy==1.20" "scipy==1.5" pytest
10283
10384
- name: Test with minimum required dependencies
10485
run: pytest .
10586

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

11190
- name: Test with minimum optional dependencies
11291
run: pytest .
92+
93+
lint:
94+
95+
runs-on: ubuntu-latest
96+
strategy:
97+
fail-fast: false
98+
matrix:
99+
python-version: ['3.11']
100+
101+
steps:
102+
- uses: actions/checkout@v4
103+
104+
- name: Set up Python ${{ matrix.python-version }}
105+
uses: actions/setup-python@v5
106+
with:
107+
python-version: ${{ matrix.python-version }}
108+
109+
- name: Install linting dependencies
110+
run: python -m pip install ruff
111+
112+
- name: Lint
113+
run: ruff check .

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ docs/_build/
5050

5151
# sphinx-gallery output
5252
docs/examples/
53+
sg_execution_times.rst
5354

5455
# sphinx-autoapi output
5556
docs/api

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version: 2
88
build:
99
os: ubuntu-22.04
1010
tools:
11-
python: "3.9"
11+
python: "3.11"
1212

1313
# Path to sphinx's configuration file
1414
sphinx:

CHANGELOG.rst

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,62 @@
22
Changelog
33
=========
44

5+
Version 1.1.0 (2024-02-18)
6+
--------------------------
7+
8+
This is a minor version with new features, deprecations,
9+
and documentation improvements.
10+
11+
New Features
12+
~~~~~~~~~~~~
13+
14+
* Added two dimensional versions of various baseline correction algorithms,
15+
with the focus on Whittaker-smoothing-based, spline, and polynomial methods.
16+
These can be accessed using the new `Baseline2D` class.
17+
* Added the `Baseline2D.individual_axes` method, which allows fitting each row and/or
18+
column in two dimensional data with any one dimensional method in pybaselines.
19+
* Added a version of the rubberband method to pybaselines.misc which allows fitting
20+
individual segments within data to better fit concave-shaped data.
21+
* Added the Customized Baseline Correction (custom_bc) method to
22+
pybaselines.optimizers, which allows fitting baselines with controllable
23+
levels of stiffness in different regions.
24+
* Added a penalized version of mpls (pspline_mpls) to pybaselines.spline.
25+
* Updated spline.mixture_model to use expectation-maximization rather than the previous
26+
nieve approach of fitting the histogram of the residuals with the probability density
27+
function. Should reduce calculation times.
28+
* Added a function for penalized spline (P-spline) smoothing to pybaselines.utils,
29+
`pybaselines.utils.pspline_smooth`, which will return a tuple of the smoothed input and
30+
the knots, spline coefficients, and spline degree for any further use with
31+
SciPy's BSpline.
32+
33+
Other Changes
34+
~~~~~~~~~~~~~
35+
36+
* Officially list Python 3.12 as supported.
37+
* Updated lowest supported Python version to 3.8
38+
* Updated lowest supported dependency versions: NumPy 1.20, SciPy 1.5,
39+
pentapy 1.1, and Numba 0.49
40+
* Use SciPy's sparse arrays when the installed SciPy version is 1.12 or newer. This
41+
only affects user codes if using functions from the pybaselines.utils module.
42+
* Vendor SciPy's cwt and ricker functions, which were deprecated from SciPy in version 1.12.
43+
44+
Deprecations/Breaking Changes
45+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46+
47+
* Deprecated passing `num_bins` to spline.mixture_model. The keyword argument will
48+
be removed in version 1.3.
49+
* Removed the pybaselines.config module, which was simply used to set the pentapy solver.
50+
The same behavior can be done by setting the `pentapy_solver` attribute of a `Baseline`
51+
object after initialization.
52+
53+
Documentation/Examples
54+
~~~~~~~~~~~~~~~~~~~~~~
55+
56+
* Added a section of the documentation explaining the extension of baseline correction for
57+
two dimensional data.
58+
* Added new examples for 2D baseline correction and for custom_bc.
59+
60+
561
Version 1.0.0 (2022-10-26)
662
--------------------------
763

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ repository-artifact: https://pypi.org/project/pybaselines
2626
repository-code: https://github.com/derb12/pybaselines
2727
title: "pybaselines: A Python library of algorithms for the baseline correction of experimental data"
2828
type: software
29-
version: 1.0.0
29+
version: 1.1.0

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2021-2023, Donald Erb
3+
Copyright (c) 2021-2024, Donald Erb
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

LICENSES_bundled.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
162162
OTHER DEALINGS IN THE SOFTWARE.
163163

164164

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

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

172172
Redistribution and use in source and binary forms, with or without

MANIFEST.in

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)