Skip to content

Commit

Permalink
Chore: Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-berchet committed Oct 1, 2024
1 parent 8b0991a commit 2c22e09
Show file tree
Hide file tree
Showing 39 changed files with 61 additions and 22 deletions.
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.59
_commit: 0.1.63
_src_path: git@bbpgitlab.epfl.ch:neuromath/python-template.git
author_email: bbp-ou-cells@groupes.epfl.ch
author_name: bbp-ou-cells
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.9
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.6
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
1 change: 1 addition & 0 deletions examples/parameter_update/compare.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example of comparison."""

import json

import pandas as pd
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Setup for the synthesis-workflow package."""

import importlib
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions src/morphval/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Morphology Statistical Validation Package."""

import pkg_resources

__version__ = pkg_resources.get_distribution("synthesis_workflow").version
1 change: 1 addition & 0 deletions src/morphval/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Private helper functions of the validation module."""

import contextlib
import json
import os
Expand Down
1 change: 1 addition & 0 deletions src/morphval/validation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Statistical validation tools."""

import copy
from collections import namedtuple
from decimal import Decimal
Expand Down
1 change: 1 addition & 0 deletions src/morphval/validation_main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Main module of MorphVal package."""

import collections
import os
import time
Expand Down
1 change: 1 addition & 0 deletions src/synthesis_workflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Workflow for neuronal synthesis validation."""

import pkg_resources
from morphio import SectionType # noqa

Expand Down
1 change: 1 addition & 0 deletions src/synthesis_workflow/circuit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions for slicing mvd3 circuit files to place specific cells only."""

import logging
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions src/synthesis_workflow/extra/insitu_validation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""In-situ validation functions for synthesis in atlas."""

from pathlib import Path

import matplotlib
Expand Down
1 change: 1 addition & 0 deletions src/synthesis_workflow/extra/make_map.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Make a atlas map from scatter data."""

from copy import copy

import matplotlib
Expand Down
1 change: 1 addition & 0 deletions src/synthesis_workflow/fit_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Some functions used to fit path distances with depth."""

from typing import Sequence
from typing import Tuple

Expand Down
1 change: 1 addition & 0 deletions src/synthesis_workflow/morphology_combos/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Module to create and modify morphologie combos with dataframes."""

from .create_me_combos import * # noqa
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to create and modify combos dataframe."""

import json
import logging
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/synthesis_workflow/synthesis.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions for synthesis to be used by luigi tasks."""

import logging
import os
import re
Expand Down
9 changes: 6 additions & 3 deletions src/synthesis_workflow/tasks/circuit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Luigi tasks for circuit and atlas processings."""

import pickle
from copy import deepcopy
from functools import partial
Expand Down Expand Up @@ -243,9 +244,11 @@ def run(self):
mtype_taxonomy_path,
CircuitConfig().atlas_path,
self.density_factor,
mask=self.input()["boundary"].path
if CreateBoundaryMask().boundary_thickness > 0
else None,
mask=(
self.input()["boundary"].path
if CreateBoundaryMask().boundary_thickness > 0
else None
),
seed=self.seed,
region=CircuitConfig().region,
)
Expand Down
1 change: 1 addition & 0 deletions src/synthesis_workflow/tasks/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""CLI for validation workflows."""

import argparse
import inspect
import logging
Expand Down
1 change: 1 addition & 0 deletions src/synthesis_workflow/tasks/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Configurations for luigi tasks."""

import logging
import shutil
import warnings
Expand Down
1 change: 1 addition & 0 deletions src/synthesis_workflow/tasks/diametrizer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Luigi tasks to diametrize cells."""

import logging
import os
import sys
Expand Down
1 change: 1 addition & 0 deletions src/synthesis_workflow/tasks/synthesis.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Luigi tasks for morphology synthesis."""

import json
import logging
from pathlib import Path
Expand Down
3 changes: 2 additions & 1 deletion src/synthesis_workflow/tasks/vacuum_synthesis.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Luigi tasks for morphology synthesis in vacuum."""

import json
import logging

Expand Down Expand Up @@ -104,7 +105,7 @@ class PlotVacuumMorphologies(WorkflowTask):
"""Plot morphologies to obtain annotations.
Attributes:
vacuum_synth_morphology_path (str): Column name to use from the morphlogy DataFrame.
vacuum_synth_morphology_path (str): Column name to use from the morphology DataFrame.
"""

pdf_filename = PathParameter(
Expand Down
1 change: 1 addition & 0 deletions src/synthesis_workflow/tasks/validation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Luigi tasks for validation of synthesis."""

import json
import logging
import pickle
Expand Down
9 changes: 6 additions & 3 deletions src/synthesis_workflow/tasks/workflows.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Luigi tasks for validation workflows."""

import configparser
import json
import pickle
Expand Down Expand Up @@ -70,9 +71,11 @@ def run(self):
if sample is None:
sample = SliceCircuit().n_cells
config["cells"] = {
"mtypes": json.dumps(list(SynthesisConfig().mtypes))
if SynthesisConfig().mtypes is not None
else "",
"mtypes": (
json.dumps(list(SynthesisConfig().mtypes))
if SynthesisConfig().mtypes is not None
else ""
),
"sample": str(sample),
}
config["planes"] = {
Expand Down
1 change: 1 addition & 0 deletions src/synthesis_workflow/tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Some tool functions used in synthesis."""

import glob
import json
import logging
Expand Down
1 change: 1 addition & 0 deletions src/synthesis_workflow/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utils functions."""

import json
import logging
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/synthesis_workflow/vacuum_synthesis.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions for synthesis in vacuum to be used by luigi tasks."""

import itertools

import matplotlib.pyplot as plt
Expand Down
3 changes: 2 additions & 1 deletion src/synthesis_workflow/validation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions for validation of synthesis to be used by luigi tasks."""

# pylint: disable=too-many-lines
import itertools
import json
Expand Down Expand Up @@ -451,7 +452,7 @@ def _plot_layers(x_pos, atlas, ax):
layer_bounds[:, 0],
layer_bounds[:, 1],
alpha=0.5,
label=f"layer {layer+1}",
label=f"layer {layer + 1}",
)


Expand Down
1 change: 1 addition & 0 deletions src/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Package version."""

VERSION = "1.2.0.dev1"
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests suite for the synthesis-workflow package."""

from configparser import ConfigParser


Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Configuration for the pytest test suite."""

# pylint: disable=redefined-outer-name
import json
import os
Expand Down
1 change: 1 addition & 0 deletions tests/morphval/test_validation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the `morphval.validation` module."""

from copy import deepcopy

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/morphval/test_validation_main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the morphval package."""

from pathlib import Path

import pkg_resources
Expand Down
1 change: 1 addition & 0 deletions tests/test_O1_workflow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for workflows module."""

import luigi
import numpy as np
import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the synthesis_workflow.cli module."""

import re

from synthesis_workflow.tasks import cli
Expand Down
1 change: 1 addition & 0 deletions tests/test_fit_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the synthesis_workflow.fit_utils module."""

# pylint: disable=redefined-outer-name
import numpy as np
import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for utils module."""

import json

import pandas as pd
Expand Down
1 change: 1 addition & 0 deletions tests/test_vacuum_workflow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for workflows module."""

import shutil

import luigi
Expand Down
11 changes: 6 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ setenv =
COVERAGE_FILE = {env:COVERAGE_FILE:.coverage-{envname}}
PIP_INDEX_URL = {env:PIP_INDEX_URL:https://bbpteam.epfl.ch/repository/devpi/simple}
PIP_EXTRA_INDEX_URL = {env:PIP_EXTRA_INDEX_URL:https://pypi.python.org/simple}
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:3} \
--dist loadgroup \
Expand Down Expand Up @@ -72,6 +67,12 @@ commands =

[testenv:min_versions]
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.9
Expand Down

0 comments on commit 2c22e09

Please sign in to comment.