Skip to content

Commit

Permalink
ref: make nanite pure Python
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jan 15, 2024
1 parent ec1d10c commit 615427f
Show file tree
Hide file tree
Showing 49 changed files with 17 additions and 160 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
python -m pip install --upgrade pip wheel
python -m pip install coverage flake8 pytest
# install dependencies
pip install -e .[CLI]
pip install -e .[ALL]
# show installed packages
pip freeze
- name: Test with pytest
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ python:
- method: pip
path: .
extra_requirements:
- CLI
- ALL

4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
4.1.0
- ref: move to "src"-rooted source tree
- ref: move iterative `sneddon_spher` model to separate package which
makes nanite a pure Python package
4.0.0
- BREAKING CHANGE: Due to the new imputation of nan-valued features,
rating inference might change slightly. For the "zef18" dataset,
Expand Down
134 changes: 0 additions & 134 deletions nanite/model/model_sneddon_spherical.pyx

This file was deleted.

13 changes: 3 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
[build-system]
# Defined by PEP 518:
# use oldest-supported-numpy (https://github.com/pypa/pip/issues/9542#issuecomment-771200755)
requires = [
# for building Cython extensions
"cython", "oldest-supported-numpy", "setuptools", "wheel",
# for version management
"setuptools>=45", "setuptools_scm[toml]>=6.2"
]
Expand Down Expand Up @@ -46,6 +42,8 @@ CLI = ["appdirs",
"matplotlib>=2.2.2",
"tifffile>=0.15.0",
]
ACA = ["nanite_model_sneddon_spher"]
ALL = ["nanite[CLI,ACA]"]

[project.scripts]
nanite-setup-profile = "nanite.cli:setup_profile [CLI]"
Expand All @@ -59,12 +57,7 @@ tracker = "https://github.com/AFM-Analysis/nanite/issues"
documentation = "https://nanite.readthedocs.io/en/stable/"
changelog = "https://nanite.readthedocs.io/en/stable/sec_changelog.html"

# We need the following, because automatic package discovery does not work
# when running cibuildwheel on GitHub Actions (there will be a "wheelhouse"
# directory).
[tool.setuptools]
packages = ["nanite"]

[tool.setuptools_scm]
write_to = "nanite/_version.py"
write_to = "src/nanite/_version.py"
version_scheme = "post-release"
13 changes: 0 additions & 13 deletions setup.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 8 additions & 1 deletion nanite/model/__init__.py → src/nanite/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@
from . import model_conical_indenter # noqa: F401
from . import model_hertz_paraboloidal # noqa: F401
from . import model_hertz_three_sided_pyramid # noqa: F401
from . import model_sneddon_spherical # noqa: F401
from . import model_sneddon_spherical_approximation # noqa: F401

from .core import NaniteFitModel # noqa: F401
from . import residuals # noqa: F401
from .logic import models_available, register_model
from .logic import deregister_model, load_model_from_file # noqa: F401

try:
# Since version 4.1.0, the iterative sneddon_spher model is not
# part of nanite anymore.
from nanite_model_sneddon_spher import \
model_sneddon_spherical # noqa: F401
except (ImportError, MemoryError):
pass


def compute_anc_parms(idnt, model_key):
"""Compute ancillary parameters for a force-distance dataset
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 615427f

Please sign in to comment.