Skip to content

Commit

Permalink
Merge pull request #189 from g4edge/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
chore: update pre-commit hooks
  • Loading branch information
stewartboogert authored Oct 13, 2024
2 parents c5e19de + dd75c34 commit 57c00b9
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 26 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.6.0"
rev: "v5.0.0"
hooks:
- id: check-case-conflict
- id: check-executables-have-shebangs
Expand All @@ -22,7 +22,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: "24.4.2"
rev: "24.10.0"
hooks:
- id: black-jupyter
args: ["--line-length", "100"]
Expand All @@ -34,7 +34,7 @@ repos:
additional_dependencies: [black==23.3.0]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.5.0"
rev: "v0.6.9"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down Expand Up @@ -87,7 +87,7 @@ repos:
]

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v18.1.8"
rev: "v19.1.1"
hooks:
- id: clang-format
types_or: [c++, c, cuda]
12 changes: 6 additions & 6 deletions src/pyg4ometry/pycgal_old/algo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -557,12 +557,12 @@ PYBIND11_MODULE(algo, m) {
.def(py::init<py::list &, py::list &>())
.def(py::init<std::string &>())
.def("add_vertex", &SurfaceMesh::add_vertex)
.def("add_face", (std::size_t(SurfaceMesh::*)(std::size_t, std::size_t,
std::size_t)) &
SurfaceMesh::add_face)
.def("add_face", (std::size_t(SurfaceMesh::*)(std::size_t, std::size_t,
std::size_t, std::size_t)) &
SurfaceMesh::add_face)
.def("add_face",
(std::size_t(SurfaceMesh::*)(std::size_t, std::size_t,
std::size_t))&SurfaceMesh::add_face)
.def("add_face",
(std::size_t(SurfaceMesh::*)(std::size_t, std::size_t, std::size_t,
std::size_t))&SurfaceMesh::add_face)
.def("translate", &SurfaceMesh::translate)
.def("transform", &SurfaceMesh::transform)
.def("union", &SurfaceMesh::unioN)
Expand Down
6 changes: 4 additions & 2 deletions src/pyg4ometry/pycsg/core.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/pyg4ometry/pycsg/geom.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions tests/geant4/fixture_geant4solids.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import pyg4ometry.gdml as _gd


@pytest.fixture()
@pytest.fixture
def registry():
return _g4.Registry()


@pytest.fixture()
@pytest.fixture
def two_materials(registry):
def _two_materials(nist_materials=False):
if nist_materials:
Expand All @@ -23,7 +23,7 @@ def _two_materials(nist_materials=False):
return _two_materials


@pytest.fixture()
@pytest.fixture
def geant4_world(registry):
wx = _gd.Constant("wx", "100", registry, True)
wy = _gd.Constant("wy", "100", registry, True)
Expand All @@ -34,7 +34,7 @@ def geant4_world(registry):
return ws


@pytest.fixture()
@pytest.fixture
def geant4_box(registry):
bx = _gd.Constant("bx", "10", registry, True)
by = _gd.Constant("by", "10", registry, True)
Expand All @@ -45,7 +45,7 @@ def geant4_box(registry):
return bs


@pytest.fixture()
@pytest.fixture
def geant4_tubs(registry):
trmin = _gd.Constant("trmin", "2.5", registry, True)
trmax = _gd.Constant("trmax", "10.0", registry, True)
Expand All @@ -63,7 +63,7 @@ def geant4_tubs(registry):
return ts


@pytest.fixture()
@pytest.fixture
def geant4_cuttubs(registry):
ctrmin = _gd.Constant("trmin", "2.5", registry, True)
ctrmax = _gd.Constant("trmax", "10.0", registry, True)
Expand Down Expand Up @@ -94,7 +94,7 @@ def geant4_cuttubs(registry):
return cts


@pytest.fixture()
@pytest.fixture
def geant4_cons(registry):
crmin1 = _gd.Constant("crmin1", "6", registry, True)
crmax1 = _gd.Constant("crmax1", "20", registry, True)
Expand Down Expand Up @@ -124,7 +124,7 @@ def geant4_cons(registry):
return cs


@pytest.fixture()
@pytest.fixture
def geant4_para(registry):
px = _gd.Constant("px", "10", registry, True)
py = _gd.Constant("py", "20", registry, True)
Expand All @@ -142,7 +142,7 @@ def geant4_para(registry):
return ps


@pytest.fixture()
@pytest.fixture
def geant4_trd(registry):
tx1 = _gd.Constant("tx1", "20", registry, True)
ty1 = _gd.Constant("ty1", "25", registry, True)
Expand All @@ -155,7 +155,7 @@ def geant4_trd(registry):
return ts


@pytest.fixture()
@pytest.fixture
def geant4_trap(registry):
tx1 = _gd.Constant("tx1", "5", registry, True)
tx2 = _gd.Constant("tx2", "5", registry, True)
Expand Down Expand Up @@ -198,7 +198,7 @@ def geant4_trap(registry):
return ts


@pytest.fixture()
@pytest.fixture
def geant4_sphere(registry):
srmin = _gd.Constant("rmin", "8", registry, True)
srmax = _gd.Constant("rmax", "10", registry, True)
Expand All @@ -225,7 +225,7 @@ def geant4_sphere(registry):
return ss


@pytest.fixture()
@pytest.fixture
def geant4_structure():
def _geant4_structure(solid, registry, two_materials, geant4_world):
wl = _g4.LogicalVolume(geant4_world, two_materials()["wm"], "wl", registry)
Expand Down

0 comments on commit 57c00b9

Please sign in to comment.