From 43fba6d5731f97e9d43c236014d44f4b326f9d01 Mon Sep 17 00:00:00 2001 From: Frithjof Date: Thu, 10 Oct 2024 22:56:10 -0500 Subject: [PATCH] Add style check action (#82) --- .github/workflows/style.yml | 10 ++++++++++ src/miv_simulator/interface/legacy/prepare_data.py | 1 - src/miv_simulator/synapses.py | 2 -- src/scripts/tools/query_cell_attrs.py | 1 - src/scripts/tools/show_h5types.py | 1 - tests/mechanisms/test_gfluct3.py | 1 - 6 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/style.yml diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 0000000..9a385b5 --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,10 @@ +name: Style check +on: [push, pull_request] +jobs: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/ruff-action@v1 + with: + args: "format --check" \ No newline at end of file diff --git a/src/miv_simulator/interface/legacy/prepare_data.py b/src/miv_simulator/interface/legacy/prepare_data.py index 99494bb..bee1fa4 100644 --- a/src/miv_simulator/interface/legacy/prepare_data.py +++ b/src/miv_simulator/interface/legacy/prepare_data.py @@ -1,4 +1,3 @@ - import pathlib import subprocess diff --git a/src/miv_simulator/synapses.py b/src/miv_simulator/synapses.py index ee273aa..da8394e 100644 --- a/src/miv_simulator/synapses.py +++ b/src/miv_simulator/synapses.py @@ -2123,9 +2123,7 @@ def config_syn( nc_param = False mech_param = False - for param, val in params.items(): - failed = True if param in mech_rules["mech_params"]: if syn is None: diff --git a/src/scripts/tools/query_cell_attrs.py b/src/scripts/tools/query_cell_attrs.py index a22197b..fd69900 100644 --- a/src/scripts/tools/query_cell_attrs.py +++ b/src/scripts/tools/query_cell_attrs.py @@ -1,4 +1,3 @@ - import click import numpy as np from miv_simulator.utils import io as io_utils diff --git a/src/scripts/tools/show_h5types.py b/src/scripts/tools/show_h5types.py index 0c6d779..c5b1647 100644 --- a/src/scripts/tools/show_h5types.py +++ b/src/scripts/tools/show_h5types.py @@ -1,4 +1,3 @@ - import click from miv_simulator.utils import io as io_utils diff --git a/tests/mechanisms/test_gfluct3.py b/tests/mechanisms/test_gfluct3.py index 12a74a3..c5558b5 100644 --- a/tests/mechanisms/test_gfluct3.py +++ b/tests/mechanisms/test_gfluct3.py @@ -8,7 +8,6 @@ import numpy as np - def test_run_with_Gfluct3(): compile_and_load("tests/mechanisms", force=True)