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

Chore: Bump Copier template #108

Merged
merged 9 commits into from
Sep 27, 2024
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
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changes here will be overwritten by Copier

_commit: 0.1.57
_commit: 0.1.63
_src_path: git@bbpgitlab.epfl.ch:neuromath/python-template.git
author_email: ''
author_name: Blue Brain Project, EPFL
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
check-pr-title:
name: Check PR title
runs-on: ubuntu-latest
env:
PR_TITLE: ${{ github.event.pull_request.title }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -16,4 +18,4 @@ jobs:
- run: npm install -g --force commitlint @commitlint/cli commitlint-plugin-cleanfeet
- run: npm install conventional-changelog-conventionalcommits
- run: touch .git/COMMIT_EDITMSG
- run: echo "${{ github.event.pull_request.title }}" | commitlint
- run: echo "$PR_TITLE" | commitlint
4 changes: 2 additions & 2 deletions .github/workflows/publish-sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: "3.10"
- name: Build a wheel and a source tarball
run: |
pip install setuptools>=42 build setuptools_scm[toml]>=3.4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
min_versions: ["min_versions", "latest_versions"]
exclude:
- min_versions: "min_versions"
include:
- python-version: "3.8"
- python-version: "3.9"
min_versions: "min_versions"

steps:
Expand Down
14 changes: 6 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
default_language_version:
python: python3.8
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -13,22 +11,22 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.5.0
rev: v9.17.0
hooks:
- id: commitlint
stages:
- commit-msg
additional_dependencies: ['conventional-changelog-conventionalcommits']
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.9.1
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
rev: v2.3.0
hooks:
- id: codespell
args: ["-x", ".codespellignorelines"]
Expand All @@ -38,6 +36,6 @@ repos:
- id: pydocstyle
additional_dependencies: ["tomli"]
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.1.1
hooks:
- id: flake8
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ disable=
invalid-name,
len-as-condition,
no-else-return,
broad-exception-raised
broad-exception-raised,
too-many-positional-arguments

[FORMAT]
# Regexp for a line that is allowed to be longer than the limit.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ When you wish to contribute to the code base, please consider the following guid
or

```shell
tox -e py38 -e lint -e docs -e check-packaging
tox -e py39 -e lint -e docs -e check-packaging
```

* Commit your changes using a descriptive commit message.
Expand Down
8 changes: 5 additions & 3 deletions neurots/generate/grower.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,11 @@ def _post_grow(self):
self.neuron = Morphology(self.neuron)

self.apical_sections = [
point_to_section_segment(self.neuron, apical_point)[0]
if apical_point is not None
else None
(
point_to_section_segment(self.neuron, apical_point)[0]
if apical_point is not None
else None
)
for apical_point in apical_points
]

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ build-backend = "setuptools.build_meta"
[tool.black]
line-length = 100
target-version = [
"py38",
"py39",
"py310",
"py311",
"py312",
]

[tool.pydocstyle]
Expand Down
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"matplotlib>=3.4",
"morphio>=3.3.6,<4.0",
"neurom>=3.0,<4.0",
"numpy>=1.22.0",
"numpy>=1.22.0,<2",
"packaging>=20",
"scipy>=1.6",
"tmd>=2.3.0",
Expand All @@ -35,10 +35,10 @@
"dictdiffer>=0.5",
"mock>=3",
"morph-tool>=2.9",
"pytest>=6",
"pytest-cov>=3",
"pytest-html>=2",
"pytest-cov>=4.1",
"pytest-html>=3.2",
"pytest-xdist>=2",
"pytest>=6.1",
"tqdm>=4.8.4",
]

Expand All @@ -55,7 +55,7 @@
},
license="Apache License 2.0",
packages=find_namespace_packages(include=["neurots*"]),
python_requires=">=3.8",
python_requires=">=3.9",
use_scm_version=True,
setup_requires=[
"setuptools_scm",
Expand All @@ -72,10 +72,10 @@
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Bio-Informatics",
],
)
27 changes: 13 additions & 14 deletions tests/astrocyte/test_space_colonization.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@ def test_colonization_split():

module = "neurots.astrocyte.space_colonization."

with patch(module + "_repulsion") as repulsion, patch(
module + "upper_half_ball_query"
) as half_ball_query, patch(module + "_fallback_strategy") as fallback_strategy, patch(
module + "_colonization_strategy_primary"
) as primary_strategy, patch(
module + "_colonization_strategy_secondary"
) as secondary_strategy:
with (
patch(module + "_repulsion") as repulsion,
patch(module + "upper_half_ball_query") as half_ball_query,
patch(module + "_fallback_strategy") as fallback_strategy,
patch(module + "_colonization_strategy_primary") as primary_strategy,
patch(module + "_colonization_strategy_secondary") as secondary_strategy,
):
repulsion.return_value = np.array([3.0, 2.0, 1.0])
half_ball_query.return_value = []

Expand Down Expand Up @@ -344,13 +344,12 @@ def test_colonization_split_with_target_influence():

module = "neurots.astrocyte.space_colonization."

with patch(module + "_colonization_split") as mock_colonization_split, patch(
module + "in_squared_proximity"
) as mock_in_squared_proximity, patch(
module + "_add_attraction_bias"
) as mock_add_attraction_bias, patch(
module + "_majorize_process"
) as mock_majorize_process:
with (
patch(module + "_colonization_split") as mock_colonization_split,
patch(module + "in_squared_proximity") as mock_in_squared_proximity,
patch(module + "_add_attraction_bias") as mock_add_attraction_bias,
patch(module + "_majorize_process") as mock_majorize_process,
):
mock_colonization_split.return_value = (
np.array([0.0, 0.0, 1.0]),
None,
Expand Down
1 change: 1 addition & 0 deletions tests/test_preprocess.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the neurots.preprocess functions."""

# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
import json
Expand Down
25 changes: 13 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ envlist =
lint
docs
min_versions
py{38,39,310,311}
py{39,310,311,312}
coverage

minversion = 3.18
Expand All @@ -18,12 +18,7 @@ extras =
test
setenv =
COVERAGE_FILE = {env:COVERAGE_FILE:.coverage-{envname}}
deps =
min_versions: Requirements-Builder
commands =
min_versions: requirements-builder --level=min --extras=test -o {envtmpdir}/requirements_min.txt setup.py
min_versions: pip install -r {envtmpdir}/requirements_min.txt
min_versions: pip freeze
pytest \
-n {env:PYTEST_NPROCS:4} \
--basetemp={envtmpdir} \
Expand Down Expand Up @@ -58,10 +53,16 @@ commands =
twine check {envtmpdir}/dist/*

[testenv:min_versions]
basepython = python3.8
basepython = python3.9
deps =
Requirements-Builder
commands_pre =
requirements-builder --level=min --extras=test -o {envtmpdir}/requirements_min.txt setup.py
pip install -r {envtmpdir}/requirements_min.txt
pip freeze

[testenv:lint]
basepython = python3.8
basepython = python3.9
deps =
pre-commit
pylint
Expand All @@ -70,7 +71,7 @@ commands =
pylint -j {env:PYLINT_NPROCS:1} {[base]files}

[testenv:format]
basepython = python3.8
basepython = python3.9
skip_install = true
deps =
codespell
Expand All @@ -91,7 +92,7 @@ commands =

[gh-actions]
python =
3.8: py38, lint
3.9: py39, docs
3.9: py39, lint
3.10: py310, check-packaging
3.11: py311
3.11: py311, docs
3.12: py312
1 change: 1 addition & 0 deletions validation/boxplot_comparison.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Example for comparing a neuron to a population
using their morphometrics"""

import neurom as nm
import numpy as np
import pylab as plt
Expand Down
1 change: 1 addition & 0 deletions validation/violin_comparison.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Example for comparing two populations using
the violin plots from their morphometrics"""

import neurom as nm
import numpy as np
import pandas
Expand Down