Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:

steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: 3.9
python-version: "3.10"

- name: Install
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:

steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: 3.9
python-version: "3.10"

- name: Install
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:

steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: 3.9
python-version: "3.10"

- name: Install tools
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/unit-test-pinned.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:

steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Set up Python 3.9
uses: actions/setup-python@v5
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: 3.9
python-version: "3.10"

- name: Install pinned dependencies
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v7

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

Expand Down
5 changes: 5 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Release 0.3.8
- Migrated to Pint >= 0.24 (the `ScaleConverter` and `UnitDefinition` classes moved to `pint.facets.plain` and changed argument signatures). This reverses the `Pint < 0.20` pin introduced in 0.3.5 and restores compatibility with numpy 2.x, which older Pint versions could not import.
- Added support for Python 3.14.
- Dropped support for Python 3.9 as Pint >= 0.24 requires Python >= 3.10.

# Release 0.3.7
- Added support for Python 3.12 and 3.13.
- Dropped support for Python 3.6, 3.7 and 3.8 as they are at end of life.
Expand Down
8 changes: 5 additions & 3 deletions cellmlmanip/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

import pint
import sympy
from pint.converters import ScaleConverter
from pint.definitions import UnitDefinition
from pint.errors import DimensionalityError
from pint.facets.plain import ScaleConverter, UnitDefinition
from pint.util import UnitsContainer

from . import model

Expand Down Expand Up @@ -168,7 +168,9 @@ def add_unit(self, name, expression):
# To test if this is a dimensionless unit, parse the string as a Quantity and check if it's dimensionless
quantity = self._registry.parse_expression(expression)
if quantity.units == self._registry.dimensionless:
definition = UnitDefinition(qname, '', (), ScaleConverter(quantity.to(self._registry.dimensionless)))
definition = UnitDefinition(
qname, None, (), ScaleConverter(quantity.to(self._registry.dimensionless).magnitude),
UnitsContainer())
else:
definition = qname + '=' + expression

Expand Down
2 changes: 1 addition & 1 deletion cellmlmanip/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.7
0.3.8
2 changes: 1 addition & 1 deletion requirements/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
This directory contains some 'pinned' dependencies used in testing.
Users are **not** required to use these pinned versions of cellmlmanip's dependencies.

They are generated using Python 3.6, and are not expected to work with all other versions.
They are generated using Python 3.10, and are not expected to work with all other versions.

To update, install `pip-tools`, and run `make`.
2 changes: 1 addition & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lxml>=4.7
pint>=0.9, <0.20
pint>=0.24, <0.26
rdflib>=4
networkx>=2.1
sympy>=1.4, <1.13
35 changes: 20 additions & 15 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --output-file=base.txt base.in
#
decorator==4.4.2
# via networkx
isodate==0.6.0
flexcache==0.3
# via pint
flexparser==0.4
# via pint
isodate==0.7.2
# via rdflib
lxml==5.3.0
lxml==6.1.1
# via -r base.in
mpmath==1.1.0
mpmath==1.3.0
# via sympy
networkx==2.5
networkx==3.4.2
# via -r base.in
pint==0.19.2
pint==0.24.4
# via -r base.in
pyparsing==2.4.7
platformdirs==4.10.0
# via pint
pyparsing==3.3.2
# via rdflib
rdflib==5.0.0
rdflib==7.6.0
# via -r base.in
six==1.15.0
# via
# isodate
# rdflib
sympy==1.7.1
sympy==1.12.1
# via -r base.in
typing-extensions==4.16.0
# via
# flexcache
# flexparser
# pint
4 changes: 2 additions & 2 deletions requirements/check-python-version.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python
import sys
if not (sys.version_info[0] == 3 and sys.version_info[1] == 6):
if not (sys.version_info[0] == 3 and sys.version_info[1] == 10):
print(
'\033[31mERROR\033[0m: '
'Pinned dependencies should only be set from Python 3.6',
'Pinned dependencies should only be set from Python 3.10',
file=sys.stderr)
sys.exit(1)
98 changes: 60 additions & 38 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,71 +1,93 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --output-file=dev.txt dev.in
#
attrs==20.3.0
# via pytest
click==7.1.2
build==1.5.1
# via pip-tools
click==8.4.2
# via pip-tools
coverage==5.4
coverage[toml]==7.15.1
# via pytest-cov
decorator==4.4.2
# via networkx
flake8==3.8.4
exceptiongroup==1.3.1
# via pytest
flake8==7.3.0
# via
# -r dev.in
# -r test.in
iniconfig==1.1.1
flexcache==0.3
# via pint
flexparser==0.4
# via pint
iniconfig==2.3.0
# via pytest
isodate==0.6.0
isodate==0.7.2
# via rdflib
isort==5.7.0
isort==8.0.1
# via
# -r dev.in
# -r test.in
lxml==5.3.0
lxml==6.1.1
# via -r base.in
mccabe==0.6.1
mccabe==0.7.0
# via flake8
mpmath==1.1.0
mpmath==1.3.0
# via sympy
networkx==2.5
networkx==3.4.2
# via -r base.in
packaging==20.8
# via pytest
pint==0.19.2
packaging==26.2
# via
# build
# pytest
# wheel
pint==0.24.4
# via -r base.in
pip-tools==5.5.0
pip-tools==7.5.3
# via -r dev.in
pluggy==0.13.1
# via pytest
py==1.10.0
# via pytest
pycodestyle==2.6.0
platformdirs==4.10.0
# via pint
pluggy==1.6.0
# via
# pytest
# pytest-cov
pycodestyle==2.14.0
# via flake8
pyflakes==2.2.0
pyflakes==3.4.0
# via flake8
pyparsing==2.4.7
pygments==2.20.0
# via pytest
pyparsing==3.3.2
# via rdflib
pyproject-hooks==1.2.0
# via
# packaging
# rdflib
pytest==6.2.2
# build
# pip-tools
pytest==9.1.1
# via
# -r test.in
# pytest-cov
pytest-cov==2.11.1
pytest-cov==7.1.0
# via -r test.in
rdflib==5.0.0
rdflib==7.6.0
# via -r base.in
six==1.15.0
# via
# isodate
# rdflib
sympy==1.7.1
sympy==1.12.1
# via -r base.in
toml==0.10.2
# via pytest
tomli==2.4.1
# via
# build
# coverage
# pip-tools
# pytest
typing-extensions==4.16.0
# via
# exceptiongroup
# flexcache
# flexparser
# pint
wheel==0.47.0
# via pip-tools

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools
Loading
Loading