From fa584992338592607472c7a235ce6f23aab1e3d0 Mon Sep 17 00:00:00 2001 From: Eleftherios Zisis Date: Mon, 14 Oct 2024 14:38:26 +0200 Subject: [PATCH] Add python3.13 & remove EOL python3.8 (#1132) --- .github/workflows/run-tox.yml | 2 +- neurom/__init__.py | 9 ++++----- pyproject.toml | 6 +++--- tox.ini | 7 +++---- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/run-tox.yml b/.github/workflows/run-tox.yml index 5dfcdaaa..cd5864bb 100644 --- a/.github/workflows/run-tox.yml +++ b/.github/workflows/run-tox.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 diff --git a/neurom/__init__.py b/neurom/__init__.py index 4a8c5242..4a4e2f37 100644 --- a/neurom/__init__.py +++ b/neurom/__init__.py @@ -32,7 +32,7 @@ Load a morphology >>> import neurom as nm - >>> m = nm.load_morphology('some/data/path/morph_file.swc') + >>> m = nm.load_morphology('tests/data/swc/Neuron.swc') Obtain some morphometrics using the get function @@ -43,16 +43,15 @@ files it finds and returns a list of morphologies >>> import numpy as np # For mean value calculation - >>> pop = nm.load_morphologies('some/data/directory') - >>> for m in pop: - ... print 'mean section length', np.mean(nm.get('section_lengths', m)) + >>> pop = nm.load_morphologies('tests/data/valid_set') + >>> mean_section_lengths = [np.mean(nm.get('section_lengths', m)) for m in pop] Apply a function to a selection of neurites in a morphology or morphology population. This example gets the number of points in each axon in a morphology population >>> import neurom as nm >>> filter = lambda n : n.type == nm.AXON - >>> mapping = lambda n : len(n.points) + >>> mapping = lambda n, section_type : len(n.points) >>> n_points = [n for n in nm.iter_neurites(pop, mapping, filter)] """ from importlib.metadata import version diff --git a/pyproject.toml b/pyproject.toml index 6deabda7..2d266887 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta" name = "neurom" description = "NeuroM: a light-weight neuron morphology analysis package" readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.9" license = { file = "LICENSE.txt" } authors = [ { name = "Blue Brain Project, EPFL" }, @@ -19,7 +19,6 @@ classifiers = [ "Intended Audience :: Education", "Intended Audience :: Science/Research", "Programming Language :: Python", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -78,10 +77,11 @@ testpaths = [ [tool.black] line-length = 100 target-version = [ - 'py38', 'py39', 'py310', 'py311', + 'py312', + 'py313', ] skip-string-normalization = true include = 'neurom\/.*\.py$|tests\/.*\.py$|doc\/source\/conf\.py$|setup\.py$|examples\/.*\.py$' diff --git a/tox.ini b/tox.ini index 89c07dd9..8d569dae 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ envlist = coverage tutorial check-packaging - py{38,39,310,311,312,313} + py{39,310,311,312,313} [testenv] deps = @@ -97,9 +97,8 @@ convention = google [gh-actions] python = - 3.8: py38, lint - 3.9: py39, docs + 3.9: py39, lint 3.10: py310, tutorial 3.11: py311, check-packaging - 3.12: py312 + 3.12: py312, docs 3.13: py313