Skip to content

Commit

Permalink
Drop support for Python 3.8 to use latests xarray versions
Browse files Browse the repository at this point in the history
  • Loading branch information
enekomartinmartinez committed Oct 2, 2023
1 parent d9c43f4 commit 4c6e82e
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.8', '3.11']
python-version: ['3.9', '3.11']

steps:
- uses: actions/checkout@v4
Expand All @@ -39,7 +39,7 @@ jobs:
uses: coverallsapp/github-action@v2
with:
file: coverage.xml
if: ${{ matrix.python-version == 3.8 && matrix.os == 'ubuntu-latest' }}
if: ${{ matrix.python-version == 3.9 && matrix.os == 'ubuntu-latest' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

This project is a library for running [System Dynamics](http://en.wikipedia.org/wiki/System_dynamics) (SD) models in Python, with the purpose of improving integration of *Big Data* and *Machine Learning* into the SD workflow.

**The current version needs to run at least Python 3.8.**
**The current version needs to run at least Python 3.9.**

## Resources

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
]

intersphinx_mapping = {
'python': ('https://docs.python.org/3.8', None),
'python': ('https://docs.python.org/3.9', None),
'pysdcookbook': ('http://pysd-cookbook.readthedocs.org/en/latest/', None),
'pandas': ('https://pandas.pydata.org/docs/', None),
'xarray': ('https://docs.xarray.dev/en/stable/', None),
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ In the source directory use the command:
Required Dependencies
---------------------
PySD requires **Python 3.8** or above.
PySD requires **Python 3.9** or above.

PySD builds on the core Python data analytics stack, and the following third party libraries:

* Numpy < 1.24
* Scipy
* Pandas (with Excel support: `pip install pandas[excel]`)
* Parsimonious
* xarray
* xarray >= 2023.09
* lxml
* regex
* chardet
Expand Down
4 changes: 2 additions & 2 deletions docs/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ New Features

Breaking changes
~~~~~~~~~~~~~~~~
- Remove support for Python 3.7. (`@enekomartinmartinez <https://github.com/enekomartinmartinez>`_)
- Remove support for Python 3.7 and 3.8. (`@enekomartinmartinez <https://github.com/enekomartinmartinez>`_)
- Update the cellrange retrievel to be compatible with :py:mod:`openpyxl` >= 3.1. It breaks the code for lower versions. (`@enekomartinmartinez <https://github.com/enekomartinmartinez>`_)

Deprecations
Expand All @@ -27,7 +27,7 @@ Performance
Internal Changes
~~~~~~~~~~~~~~~~
- Update libraries used for building documentation and `.readthedocs.yml`. (`@enekomartinmartinez <https://github.com/enekomartinmartinez>`_)
- Avoid conflicting :py:mod:`xarray` versions. (`@enekomartinmartinez <https://github.com/enekomartinmartinez>`_)
- Force to use :py:mod:`xarray` >= 2023.09. (`@enekomartinmartinez <https://github.com/enekomartinmartinez>`_)
- Use `pandas[excel]` instead of xlrd dependency in the requirements. (`@gdrosos <https://github.com/gdrosos>`_)


Expand Down
4 changes: 2 additions & 2 deletions pysd/pysd.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
from pysd.py_backend.model import Model


if sys.version_info[:2] < (3, 8): # pragma: no cover
if sys.version_info[:2] < (3, 9): # pragma: no cover
raise RuntimeError(
"\n\n"
+ "Your Python version is no longer supported by PySD.\n"
+ "The current version needs to run at least Python 3.8."
+ "The current version needs to run at least Python 3.9."
+ " You are running:\n\tPython "
+ sys.version
+ "\nPlease update your Python version or use the last "
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
numpy<1.24
pandas[excel]
parsimonious
xarray!=2023.8,!=2023.9
xarray>=2023.9
lxml
regex
chardet
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
setup(
name='pysd',
version=__version__,
python_requires='>=3.8',
python_requires='>=3.9',
author='PySD contributors',
packages=find_packages(exclude=['docs', 'tests', 'dist', 'build']),
url='https://github.com/SDXorg/pysd',
Expand All @@ -22,7 +22,6 @@
'Topic :: Scientific/Engineering :: Information Analysis',
'Intended Audience :: Science/Research',

'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
Expand Down
2 changes: 1 addition & 1 deletion tests/pytest_types/data/pytest_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_invalid_interp_method(self):
xr.DataArray([1, 2], {"dim": ["A", "B"]}, ["dim"])
]),
xr.DataArray(
[[[1, 2], [1, 2]], [[10, 20], [10, 20]], [[1, 2], [1, 2]]],
[[[1, 1], [2, 2]], [[10, 10], [20, 20]], [[1, 1], [2, 2]]],
{"time": [1, 20, 40], "dim":["A", "B"], "dim2": ["C", "D"]},
["time", "dim", "dim2"])
)
Expand Down
2 changes: 1 addition & 1 deletion tests/pytest_types/lookup/pytest_lookups.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
xr.DataArray([1, 2], {"dim": ["A", "B"]}, ["dim"])
]),
xr.DataArray(
[[[1, 2], [1, 2]], [[10, 20], [10, 20]], [[1, 2], [1, 2]]],
[[[1, 1], [2, 2]], [[10, 10], [20, 20]], [[1, 1], [2, 2]]],
{
"lookup_dim": [1, 20, 40],
"dim":["A", "B"],
Expand Down

0 comments on commit 4c6e82e

Please sign in to comment.