Skip to content

Commit

Permalink
Merge branch 'master' into array_ufunc_multiplication
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgsavage authored Jun 23, 2023
2 parents 2ab9f0f + e60fe39 commit fdcfbd9
Show file tree
Hide file tree
Showing 119 changed files with 3,684 additions and 1,866 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- [ ] Closes # (insert issue number)
- [ ] Executed ``pre-commit run --all-files`` with no errors
- [ ] Executed `pre-commit run --all-files` with no errors
- [ ] The change is fully covered by automated unit tests
- [ ] Documented in docs/ as appropriate
- [ ] Added an entry to the CHANGES file
108 changes: 49 additions & 59 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
numpy: [null, "numpy>=1.19,<2.0.0"]
python-version: [3.9, "3.10", "3.11"]
numpy: [null, "numpy>=1.21,<2.0.0"]
uncertainties: [null, "uncertainties==3.1.6", "uncertainties>=3.1.6,<4.0.0"]
extras: [null]
include:
- python-version: 3.8 # Minimal versions
numpy: numpy==1.19.5
- python-version: 3.9 # Minimal versions
numpy: "numpy"
extras: matplotlib==2.2.5
- python-version: 3.8
- python-version: 3.9
numpy: "numpy"
uncertainties: "uncertainties"
extras: "sparse xarray netCDF4 dask[complete] graphviz babel==2.8"
extras: "sparse xarray netCDF4 dask[complete]==2023.4.0 graphviz babel==2.8"
runs-on: ubuntu-latest

env:
Expand Down Expand Up @@ -75,25 +75,25 @@ jobs:
run: |
pytest $TEST_OPTS
- name: Coverage report
run: coverage report -m
# - name: Coverage report
# run: coverage report -m

- name: Coveralls Parallel
env:
COVERALLS_FLAG_NAME: ${{ matrix.test-number }}
COVERALLS_PARALLEL: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
pip install coveralls
coveralls
# - name: Coveralls Parallel
# env:
# COVERALLS_FLAG_NAME: ${{ matrix.test-number }}
# COVERALLS_PARALLEL: true
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# COVERALLS_SERVICE_NAME: github
# run: |
# pip install coveralls "requests<2.29"
# coveralls

test-windows:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
numpy: [ "numpy>=1.19,<2.0.0" ]
python-version: [3.9, "3.10", "3.11"]
numpy: [ "numpy>=1.21,<2.0.0" ]
runs-on: windows-latest

env:
Expand Down Expand Up @@ -153,8 +153,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
numpy: [null, "numpy>=1.19,<2.0.0" ]
python-version: [3.9, "3.10", "3.11"]
numpy: [null, "numpy>=1.21,<2.0.0" ]
runs-on: macos-latest

env:
Expand Down Expand Up @@ -198,41 +198,31 @@ jobs:
run: |
pytest $TEST_OPTS
- name: Coverage report
run: coverage report -m

- name: Coveralls Parallel
env:
COVERALLS_FLAG_NAME: ${{ matrix.test-number }}
COVERALLS_PARALLEL: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
pip install coveralls
coveralls
coveralls:
needs: test-linux
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Coveralls Finished
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
pip install coveralls
coveralls --finish
# Dummy task to summarize all. See https://github.com/bors-ng/bors-ng/issues/1300
ci-success:
name: ci
if: ${{ success() }}
needs: test-linux
runs-on: ubuntu-latest
steps:
- name: CI succeeded
run: exit 0
# - name: Coverage report
# run: coverage report -m

# - name: Coveralls Parallel
# env:
# COVERALLS_FLAG_NAME: ${{ matrix.test-number }}
# COVERALLS_PARALLEL: true
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# COVERALLS_SERVICE_NAME: github
# run: |
# pip install coveralls "requests<2.29"
# coveralls

# coveralls:
# needs: test-linux
# runs-on: ubuntu-latest
# steps:
# - uses: actions/setup-python@v2
# with:
# python-version: 3.x
# - name: Coveralls Finished
# continue-on-error: true
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# COVERALLS_SERVICE_NAME: github
# run: |
# pip install coveralls "requests<2.29"
# coveralls --finish
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Set up Python 3.8
- name: Set up minimal Python version
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9

- name: Get pip cache dir
id: pip-cache
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build and publish to PyPI

on:
push:
tags:
- '*'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: python -m pip install build

- name: Build package
run: python -m build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
30 changes: 20 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,28 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.10.1
- id: black-jupyter
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.240'
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
- id: ruff
args: ["--fix"]
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
hooks:
- id: flake8
- id: mdformat
additional_dependencies:
- mdformat-gfm # GitHub-flavored Markdown
- mdformat-black
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout
args: [--extra-keys=metadata.kernelspec metadata.language_info.version]
5 changes: 3 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
version: 2
build:
image: latest
os: ubuntu-22.04
tools:
python: "3.9"
sphinx:
configuration: docs/conf.py
fail_on_warning: false
python:
version: 3.8
install:
- requirements: requirements_docs.txt
- method: pip
Expand Down
69 changes: 65 additions & 4 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,25 +1,82 @@
Pint Changelog
==============

0.21 (unreleased)
0.23 (unreleased)
-----------------

- Documented to_preferred and created added an autoautoconvert_to_preferred registry option.
(PR #1803)
- Fixed bug causing operations between arrays of quantity scalars and quantity holding
array resulting in incorrect units.
(PR #1677)


0.22 (2023-05-25)
-----------------

- Drop Python 3.8 compatability following NEP-29.
- Drop NumPy < 1.21 following NEP-29.
- Improved typing experience.
- Migrated fully to pyproject.toml.
- Migrated to ruff.
- In order to make static typing possible as required by mypy
and similar tools, the way to subclass the registry has been
changed.
- Allow non-quantity atol parameters for isclose and allclose.
(PR #1783)


0.21 (2023-05-01)
-----------------

- Add PEP621/631 support.
(Issue #1647)
- Exposed matplotlib unit formatter (PR #1703)
- Fix error when when re-registering a formatter.
(PR #1629)
- Add new SI prefixes: ronna-, ronto-, quetta-, quecto-.
(PR #1652)
- Fixed bug causing operations between arrays of quantity scalars and quantity holding
array resulting in incorrect units.
(PR #1677)
- Fix unit check with `atol` using `np.allclose` & `np.isclose`.
(Issue #1658)
- Implementation for numpy.positive added for Quantity.
(PR #1663)
- Changed frequency to angular frequency in the docs.
(PR #1668)
- Remove deprecated `alen` numpy function
(PR #1678)
- Updated URLs for log and offset unit errors.
(PR #1727)
- Patched TYPE_CHECKING import regression.
(PR #1686)
- Parse '°' along with previous text, rather than adding a space,
allowing, eg 'Δ°C' as a unit.
(PR #1729)
- Improved escaping of special characters for LaTeX format
(PR #1712)
- Avoid addition of spurious trailing zeros when converting units and non-int-type is
Decimal (PR #1625).
- Implementation for numpy.delete added for Quantity.
(PR #1669)
- Fixed Quantity type returned from `__dask_postcompute__`.
(PR #1722)
- Added Townsend unit
(PR #1738)
- Fix get_compatible_units() in dynamically added units.
(Issue #1725)
- Fix pint-convert script
(Issue #1646)
- Honor non_int_type when dividing.
(Issue #1505)
- Fix `trapz`, `dot`, and `cross` to work properly with non-multiplicative units
(Issue #1593)

### Breaking Changes

- Support percent and ppm units. Support the `%` symbol.
(Issue #1277)
- Fix error when parsing subtraction operator followed by white space.
(PR #1701)
- Removed Td as an alias for denier (within the Textile group)

0.20.1 (2022-10-27)
-------------------
Expand Down Expand Up @@ -56,6 +113,10 @@ types for pint-pandas compatibility. (#1596)
- Create NaN-value quantities of appropriate non-int-type (Issue #1570).
- New documentation format and organization!
- Better support for pandas and dask.
- Fix masked arrays (with multiple values) incorrectly being passed through
setitem (Issue #1584)

- Add Quantity.to_preferred

0.19.2 (2022-04-23)
-------------------
Expand Down
7 changes: 4 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
include AUTHORS CHANGES LICENSE README.rst BADGES.rst version.txt .coveragerc .readthedocs.yaml
include AUTHORS CHANGES LICENSE README.rst BADGES.rst version.txt .coveragerc .readthedocs.yaml .pre-commit-config.yaml
recursive-include pint *
recursive-include docs *
recursive-include bench *
recursive-include benchmarks *
prune docs/_build
prune docs/_themes/.git
prune pint/.pytest_cache
exclude .editorconfig bors.toml pull_request_template.md requirements_docs.txt version.py
global-exclude *.pyc *~ .DS_Store *__pycache__* *.pyo .travis-exclude.yml
global-exclude *.pyc *~ .DS_Store *__pycache__* *.pyo .travis-exclude.yml *.lock
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ and constants. Due to its modular design, you can extend (or even rewrite!)
the complete list without changing the source code. It supports a lot of
numpy mathematical operations **without monkey patching or wrapping numpy**.

It has a complete test coverage. It runs in Python 3.8+ with no other dependency.
It has a complete test coverage. It runs in Python 3.9+ with no other dependency.
It is licensed under BSD.

It is extremely easy and natural to use:
Expand Down Expand Up @@ -153,7 +153,7 @@ see CHANGES_
.. _`NumPy`: http://www.numpy.org/
.. _`PEP 3101`: https://www.python.org/dev/peps/pep-3101/
.. _`Babel`: http://babel.pocoo.org/
.. _`Pandas Extension Types`: https://pandas.pydata.org/pandas-docs/stable/extending.html#extension-types
.. _`pint-pandas Jupyter notebook`: https://github.com/hgrecco/pint-pandas/blob/master/notebooks/pandas_support.ipynb
.. _`Pandas Extension Types`: https://pandas.pydata.org/pandas-docs/stable/development/extending.html#extension-types
.. _`pint-pandas Jupyter notebook`: https://github.com/hgrecco/pint-pandas/blob/master/notebooks/pint-pandas.ipynb
.. _`AUTHORS`: https://github.com/hgrecco/pint/blob/master/AUTHORS
.. _`CHANGES`: https://github.com/hgrecco/pint/blob/master/CHANGES
1 change: 0 additions & 1 deletion benchmarks/benchmarks/10_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@


def setup(*args):

global ureg, data

data["int"] = 1
Expand Down
Loading

0 comments on commit fdcfbd9

Please sign in to comment.