Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Python v3.13 #375

Merged
merged 10 commits into from
Jan 29, 2025
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
42 changes: 23 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
with:
fetch-depth: "0"

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

- name: Install dependencies
run: |
Expand All @@ -47,7 +47,7 @@ jobs:

- name: pylint check
run: |
python -m pylint --max-positional-arguments 20 src/gstools/
python -m pylint src/gstools/

- name: cython-lint check
run: |
Expand Down Expand Up @@ -75,13 +75,14 @@ jobs:
fetch-depth: "0"

- name: Build wheels
uses: pypa/cibuildwheel@v2.18.0
uses: pypa/cibuildwheel@v2.22.0
with:
output-dir: dist
output-dir: dist-wheel-${{ matrix.os }}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: ./dist/*.whl
name: dist-wheel-${{ matrix.os }}
path: ./dist-wheel-${{ matrix.os }}/*.whl

build_sdist:
name: sdist on ${{ matrix.os }} with py ${{ matrix.ver.py }} numpy${{ matrix.ver.np }} scipy${{ matrix.ver.sp }}
Expand All @@ -92,12 +93,13 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
# https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg
ver:
- { py: "3.8", np: "==1.20.0", sp: "==1.5.4" }
- { py: "3.9", np: "==1.20.0", sp: "==1.5.4" }
- { py: "3.10", np: "==1.21.6", sp: "==1.7.2" }
- { py: "3.11", np: "==1.23.2", sp: "==1.9.2" }
- { py: "3.12", np: "==1.26.2", sp: "==1.11.2" }
- { py: "3.12", np: ">=2.0.0rc1", sp: ">=1.13.0" }
- {py: '3.8', np: '==1.20.0', sp: '==1.5.4'}
- {py: '3.9', np: '==1.20.0', sp: '==1.5.4'}
- {py: '3.10', np: '==1.21.6', sp: '==1.7.2'}
- {py: '3.11', np: '==1.23.2', sp: '==1.9.2'}
- {py: '3.12', np: '==1.26.2', sp: '==1.11.2'}
- {py: '3.13', np: '==2.1.0', sp: '==1.14.1'}
- {py: '3.13', np: '>=2.1.0', sp: '>=1.14.1'}
exclude:
- os: macos-14
ver: { py: "3.8", np: "==1.20.0", sp: "==1.5.4" }
Expand Down Expand Up @@ -134,21 +136,23 @@ jobs:
- name: Build sdist
run: |
# PEP 517 package builder from pypa
python -m build --sdist --outdir dist .
python -m build --sdist --outdir dist-sdist .

- uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest' && matrix.ver.py == '3.9'
- uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest' && matrix.ver.py == '3.11'
with:
path: dist/*.tar.gz
name: dist-sdist
path: dist-sdist/*.tar.gz

upload_to_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
pattern: dist-*
merge-multiple: true
path: dist

- name: Publish to Test PyPI
Expand Down
6 changes: 3 additions & 3 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# GSTools
# Authors

GSTools is available on [GitHub](https://github.com/GeoStat-Framework/GSTools)
and was created by following people.


## Main Authors
## Core developers

- Sebastian Müller, GitHub: [@MuellerSeb](https://github.com/MuellerSeb), Email: <[email protected]>
- Lennart Schüler, GitHub: [@LSchueler](https://github.com/LSchueler), Email: <[email protected]>
Expand All @@ -14,4 +14,4 @@ and was created by following people.

- Falk Heße, GitHub: [@fhesze](https://github.com/fhesze), Email: <[email protected]>
- Bane Sullivan, GitHub: [@banesullivan](https://github.com/banesullivan)
- Tobias Glaubach, GitHub: [@TobiasGlaubach](https://github.com/TobiasGlaubach)
- Tobias Glaubach, GitHub: [@TobiasGlaubach](https://github.com/TobiasGlaubach)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<img align="right" width="450" src="https://raw.githubusercontent.com/GeoStat-Framework/GSTools/main/docs/source/pics/demonstrator.png" alt="">

GeoStatTools provides geostatistical tools for various purposes:
GSTools provides geostatistical tools for various purposes:
- random field generation, including periodic boundaries
- simple, ordinary, universal and external drift kriging
- conditioned field generation
Expand Down Expand Up @@ -369,7 +369,7 @@ You can contact us via <[email protected]>.

## License

[LGPLv3][license_link] © 2018-2024
[LGPLv3][license_link] © 2018-2025

[pip_link]: https://pypi.org/project/gstools
[conda_link]: https://docs.conda.io/en/latest/miniconda.html
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python3 -msphinx
SPHINXPROJ = GeoStatTools
SPHINXPROJ = GSTools
SOURCEDIR = source
BUILDDIR = build

Expand Down
2 changes: 2 additions & 0 deletions docs/source/authors.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. include:: ../../AUTHORS.md
:parser: myst_parser.docutils_
3 changes: 2 additions & 1 deletion docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.. mdinclude:: ../../CHANGELOG.md
.. include:: ../../CHANGELOG.md
:parser: myst_parser.docutils_
30 changes: 16 additions & 14 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# GeoStatTools documentation build configuration file, created by
# GSTools documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 5 14:20:43 2018.
#
# This file is execfile()d with the current directory set to its
Expand Down Expand Up @@ -67,7 +67,7 @@ def setup(app):
"sphinx.ext.napoleon", # parameters look better than with numpydoc only
"numpydoc",
"sphinx_gallery.gen_gallery",
"m2r2",
"myst_parser",
"sphinxcontrib.youtube",
]

Expand Down Expand Up @@ -98,7 +98,11 @@ def setup(app):

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
source_suffix = [".rst", ".md"]
source_suffix = {
".rst": "restructuredtext",
".md": "markdown",
}
# source_suffix = [".rst", ".md"]
# source_suffix = ".rst"

# The master toctree document.
Expand Down Expand Up @@ -152,7 +156,7 @@ def setup(app):
# 'canonical_url': '',
# 'analytics_id': '',
"logo_only": False,
"display_version": True,
"version_selector": True,
"prev_next_buttons_location": "top",
# 'style_external_links': False,
# 'vcs_pageview_mode': '',
Expand Down Expand Up @@ -188,7 +192,7 @@ def setup(app):
# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = "GeoStatToolsdoc"
htmlhelp_basename = "GSToolsdoc"
# logos for the page
html_logo = "pics/gstools_150.png"
html_favicon = "pics/gstools.ico"
Expand Down Expand Up @@ -217,8 +221,8 @@ def setup(app):
latex_documents = [
(
master_doc,
"GeoStatTools.tex",
"GeoStatTools Documentation",
"GSTools.tex",
"GSTools Documentation",
"Sebastian Müller, Lennart Schüler",
"manual",
)
Expand All @@ -229,9 +233,7 @@ def setup(app):

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, "geostattools", "GeoStatTools Documentation", [author], 1)
]
man_pages = [(master_doc, "GSTools", "GSTools Documentation", [author], 1)]


# -- Options for Texinfo output -------------------------------------------
Expand All @@ -242,10 +244,10 @@ def setup(app):
texinfo_documents = [
(
master_doc,
"GeoStatTools",
"GeoStatTools Documentation",
"GSTools",
"GSTools Documentation",
author,
"GeoStatTools",
"GSTools",
"Geo-statistical toolbox.",
"Miscellaneous",
)
Expand Down Expand Up @@ -320,7 +322,7 @@ def setup(app):
# Sort gallery example by file name instead of number of lines (default)
"within_subsection_order": FileNameSortKey,
# directory where function granular galleries are stored
"backreferences_dir": None,
"backreferences_dir": "examples/backreferences",
# Modules for which function level galleries are created. In
"doc_module": "gstools",
# "first_notebook_cell": (
Expand Down
1 change: 1 addition & 0 deletions docs/source/contents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ Contents
index
tutorials
api
authors
changelog
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ GSTools Quickstart
Purpose
=======

GeoStatTools provides geostatistical tools for various purposes:
GSTools provides geostatistical tools for various purposes:

- random field generation, including periodic boundaries
- simple, ordinary, universal and external drift kriging
Expand Down
9 changes: 9 additions & 0 deletions docs/source/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,12 @@ explore its whole beauty and power.

.. youtube:: qZBJ-AZXq6Q
:width: 100%

|

Gallery
=======

.. minigallery::

../../examples/**/*.py
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: GIS",
"Topic :: Scientific/Engineering :: Hydrology",
Expand All @@ -56,15 +57,15 @@ dependencies = [

[project.optional-dependencies]
doc = [
"m2r2>=0.2.8",
"myst_parser",
"matplotlib>=3.7",
"meshzoo>=0.7",
"numpydoc>=1.1",
"pykrige>=1.5,<2",
"pyvista>=0.40",
"sphinx>=7",
"sphinx-gallery>=0.8",
"sphinx-rtd-theme>=2",
"sphinx-rtd-theme>=3",
"sphinxcontrib-youtube>=1.1",
]
plotting = [
Expand Down Expand Up @@ -110,6 +111,7 @@ target-version = [
"py310",
"py311",
"py312",
"py313",
]

[tool.coverage]
Expand Down Expand Up @@ -157,11 +159,12 @@ target-version = [
max-statements = 85
max-attributes = 25
max-public-methods = 80
max-positional-arguments=20

[tool.cibuildwheel]
# Switch to using build
build-frontend = "build"
# Disable building PyPy wheels on all platforms, 32bit for py3.10/11/12, musllinux builds, py3.6/7
# Disable building PyPy wheels on all platforms, 32bit for py3.10/11/12/13, musllinux builds, py3.6/7
skip = ["cp36-*", "cp37-*", "pp*", "*-win32", "*-manylinux_i686", "*-musllinux_*"]
# Run the package tests using `pytest`
test-extras = "test"
Expand Down
2 changes: 1 addition & 1 deletion src/gstools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Purpose
=======

GeoStatTools is a library providing geostatistical tools
GSTools is a library providing geostatistical tools
for random field generation, conditioned field generation,
kriging and variogram estimation
based on a list of provided or even user-defined covariance models.
Expand Down
8 changes: 6 additions & 2 deletions src/gstools/normalizer/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@
import warnings

import numpy as np
import scipy.misc as spm
import scipy.optimize as spo


def _derivative(f, x, dx=1e-6):
"""Central difference formula."""
return (f(x + dx) - f(x - dx)) / (2 * dx)


class Normalizer:
"""Normalizer class.

Expand Down Expand Up @@ -57,7 +61,7 @@ def _normalize(self, data):
return data

def _derivative(self, data):
return spm.derivative(self._normalize, data, dx=self._dx)
return _derivative(self._normalize, data, dx=self._dx)

def _loglikelihood(self, data):
add = -0.5 * np.size(data) * (np.log(2 * np.pi) + 1)
Expand Down
Loading