From eb14cde3726b525b221d68da57561b8d92844272 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 00:24:53 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/particles/elements/Aperture.H | 6 +++--- src/python/elements.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/particles/elements/Aperture.H b/src/particles/elements/Aperture.H index d11b3ee2f..90d8157e6 100644 --- a/src/particles/elements/Aperture.H +++ b/src/particles/elements/Aperture.H @@ -49,7 +49,7 @@ namespace impactx static std::string shape_name (Shape const & shape); - + static std::string action_name (Action const & action); @@ -143,7 +143,7 @@ namespace impactx amrex::ParticleIDWrapper{idcpu}.make_invalid(); } break; - + case Shape::elliptical : if (std::pow(u,2) + std::pow(v,2) > 1_prt) { amrex::ParticleIDWrapper{idcpu}.make_invalid(); @@ -161,7 +161,7 @@ namespace impactx amrex::ParticleIDWrapper{idcpu}.make_invalid(); } break; - + case Shape::elliptical : if (std::pow(u,2) + std::pow(v,2) < 1_prt) { amrex::ParticleIDWrapper{idcpu}.make_invalid(); diff --git a/src/python/elements.cpp b/src/python/elements.cpp index 5a1a511b2..2c42cbfd5 100644 --- a/src/python/elements.cpp +++ b/src/python/elements.cpp @@ -302,7 +302,7 @@ void init_elements(py::module& m) if (action != "transmit" && action != "absorb") throw std::runtime_error(R"(action must be "transmit" or "absorb")"); - + Aperture::Shape const s = shape == "rectangular" ? Aperture::Shape::rectangular : Aperture::Shape::elliptical; @@ -341,14 +341,14 @@ void init_elements(py::module& m) ) .def_property("action", [](Aperture & ap) - { + { return ap.action_name(ap.m_action); }, [](Aperture & ap, std::string const & action) { if (action != "transmit" && action != "absorb") throw std::runtime_error(R"(action must be "transmit" or "absorb")"); - + ap.m_action = action == "transmit" ? Aperture::Action::transmit : Aperture::Action::absorb;