diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index f92b02a..fe6381a 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} @@ -29,14 +29,14 @@ jobs: flake8 . --count --exit-zero --statistics - name: Run tests run: | - pytest --cov=./detl --cov-report xml --cov-report term-missing tests/ + pytest -v --cov=./detl --cov-report xml --cov-report term-missing tests/ - name: Upload coverage - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@v6 with: file: ./coverage.xml - name: Test Wheel install and import run: | - python setup.py bdist_wheel + python -m build cd dist pip install detl*.whl python -c "import detl; print(detl.__version__)" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f2b44d..ea6a4e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,17 +16,17 @@ jobs: - name: Set up Python uses: actions/setup-python@v6 with: - python-version: 3.9 + python-version: "3.13" - name: Install dependencies run: | pip install -e . - pip install flake8 pytest pytest-cov twine wheel + pip install flake8 pytest pytest-cov twine build - name: Test with pytest run: | - pytest --cov=./detl --cov-report xml --cov-report term-missing tests/ + pytest -v --cov=./detl --cov-report xml --cov-report term-missing tests/ - name: Build package run: | - python setup.py sdist bdist_wheel + python -m build - name: Check version number match run: | echo "GITHUB_REF: ${GITHUB_REF}" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ae3aadd..9af3eec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ exclude: testfiles/|\.(csv|ipynb)$ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v6.0.0 hooks: - id: check-merge-conflict - id: check-toml @@ -11,11 +11,11 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 8.0.1 hooks: - id: isort name: isort - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 26.3.1 hooks: - id: black diff --git a/detl/__init__.py b/detl/__init__.py index fc6a0c4..40aa602 100644 --- a/detl/__init__.py +++ b/detl/__init__.py @@ -1,7 +1,9 @@ +import importlib.metadata + from . import parsing from .core import DASwareParser, DASwareVersion, DWData -__version__ = "1.1.3" +__version__ = importlib.metadata.version(__package__ or __name__) parsers = { DASwareVersion.V4: parsing.dw4.DASware4Parser, diff --git a/detl/core.py b/detl/core.py index 6744163..0ac2d3f 100644 --- a/detl/core.py +++ b/detl/core.py @@ -1,4 +1,5 @@ """Specifies the base types for parsing and representing DASware data.""" + import abc import enum import pathlib diff --git a/detl/parsing/common.py b/detl/parsing/common.py index 1801691..97a5a0d 100644 --- a/detl/parsing/common.py +++ b/detl/parsing/common.py @@ -158,6 +158,6 @@ def transform_trackdata( if (not new_data.empty) and (not new_data.isnull().all()): transformed_data.loc[:, key] = new_data - transformed_data = transformed_data.fillna(method="ffill") + transformed_data = transformed_data.ffill() return transformed_data diff --git a/docs/requirements.txt b/docs/requirements.txt index 364ab4a..f608d45 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,4 +2,3 @@ sphinx sphinx_rtd_theme numpydoc nbsphinx -nbsphinx_link diff --git a/docs/source/01_Basic_Use.nblink b/docs/source/01_Basic_Use.nblink deleted file mode 100644 index 8f6846e..0000000 --- a/docs/source/01_Basic_Use.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../notebooks/01_Basic_Use.ipynb" -} diff --git a/docs/source/02_Closest_Point_Lookup.nblink b/docs/source/02_Closest_Point_Lookup.nblink deleted file mode 100644 index 449fb48..0000000 --- a/docs/source/02_Closest_Point_Lookup.nblink +++ /dev/null @@ -1,3 +0,0 @@ -{ - "path": "../../notebooks/02_Closest_Point_Lookup.ipynb" -} diff --git a/docs/source/conf.py b/docs/source/conf.py index 624f9c1..e3f9c4f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -37,7 +37,6 @@ "sphinx_rtd_theme", "numpydoc", "nbsphinx", - "nbsphinx_link", ] # Add any paths that contain templates here, relative to this directory. diff --git a/docs/source/index.rst b/docs/source/index.rst index 45a687d..bc2ed66 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -15,8 +15,8 @@ In the following chapters, we introduce the data structures, basic functions and :maxdepth: 2 :caption: Examples - 01_Basic_Use - 02_Closest_Point_Lookup + notebooks/01_Basic_Use + notebooks/02_Closest_Point_Lookup You can find auto-generated API documentation below: diff --git a/notebooks/01_Basic_Use.ipynb b/docs/source/notebooks/01_Basic_Use.ipynb similarity index 100% rename from notebooks/01_Basic_Use.ipynb rename to docs/source/notebooks/01_Basic_Use.ipynb diff --git a/notebooks/02_Closest_Point_Lookup.ipynb b/docs/source/notebooks/02_Closest_Point_Lookup.ipynb similarity index 100% rename from notebooks/02_Closest_Point_Lookup.ipynb rename to docs/source/notebooks/02_Closest_Point_Lookup.ipynb diff --git a/notebooks/README.md b/notebooks/README.md new file mode 100644 index 0000000..f629e89 --- /dev/null +++ b/notebooks/README.md @@ -0,0 +1,5 @@ +# Notebooks Moved + +Visit [docs/source/notebooks](../docs/source/notebooks). + +Or visit https://detl.readthedocs.io. diff --git a/pyproject.toml b/pyproject.toml index 1de3c8b..bf090ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,54 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "detl" +version = "1.2.0" +description = "Package for parsing and transforming DASware raw data exports." +readme = "README.md" +requires-python = ">=3.11" +license = "AGPL-3.0-or-later" +authors = [ + {name = "Michael Osthege", email = "m.osthege@fz-juelich.de"}, + {name = "Niklas Tenhaef", email = "n.tenhaef@fz-juelich.de"}, + {name = "Valentin Steier", email = "v.steier@fz-juelich.de"}, +] +classifiers = [ + "Programming Language :: Python", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering", +] +dependencies = [ + "numpy", + "pandas", + "pytz", +] + +[project.urls] +Homepage = "https://github.com/jubiotech/detl" +Documentation = "https://detl.readthedocs.io/en/latest/" +Download = "https://pypi.org/project/detl/" + +[tool.setuptools] +package-dir = {"detl" = "detl"} + +[tool.setuptools.package-data] +"detl" = ["py.typed"] + [tool.black] line-length = 100 [tool.isort] profile = "black" + +[tool.mypy] +ignore_missing_imports = true +exclude = [ + 'test_.*?\.py$', +] diff --git a/requirements-dev.txt b/requirements-dev.txt index 3b349c2..86b6e83 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,7 @@ +build flake8 +pandas>=3.0.0 pytest pytest-cov twine -wheel watermark diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 5da331c..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -numpy -pandas diff --git a/setup.py b/setup.py deleted file mode 100644 index 07702c1..0000000 --- a/setup.py +++ /dev/null @@ -1,43 +0,0 @@ -import pathlib - -import setuptools - -__packagename__ = "detl" -ROOT = pathlib.Path(__file__).parent - - -def get_version(): - import os - import re - - VERSIONFILE = os.path.join(__packagename__, "__init__.py") - initfile_lines = open(VERSIONFILE, "rt").readlines() - VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" - for line in initfile_lines: - mo = re.search(VSRE, line, re.M) - if mo: - return mo.group(1) - raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,)) - - -__version__ = get_version() - - -setuptools.setup( - name=__packagename__, - packages=setuptools.find_packages(), # this must be the same as the name above - version=__version__, - description="Package for parsing and transforming DASware raw data exports.", - url="https://github.com/JuBiotech/detl", - author="IBG-1", - copyright="(c) 2022 Forschungszentrum Jülich GmbH", - license="GNU Affero General Public License v3.0", - classifiers=[ - "Programming Language :: Python", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3.8", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: GNU Affero General Public License v3", - ], - install_requires=open(pathlib.Path(ROOT, "requirements.txt")).readlines(), -) diff --git a/tests/test_detl.py b/tests/test_detl.py index f3f769d..43d1772 100644 --- a/tests/test_detl.py +++ b/tests/test_detl.py @@ -1,4 +1,5 @@ """Contains unit tests for the `detl` package""" + import datetime import pathlib import unittest