From 28c5d0c933aabc965ce4c6191d598b09d973f52f Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Mon, 2 Dec 2024 12:07:10 -0500 Subject: [PATCH] pre-commit --- src/integrate.py | 12 ++++++------ src/module.cc | 12 ++++++------ src/pytest/test_mysphere.py | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/integrate.py b/src/integrate.py index 4d9bd4a..093d34e 100644 --- a/src/integrate.py +++ b/src/integrate.py @@ -4,17 +4,17 @@ """Example Shape Integrator.""" # Import the C++ module -from . import _template - import hoomd +from . import _template + class MySphere(hoomd.hpmc.integrate.HPMCIntegrator): """Example shape integrator.""" # set static class data _ext_module = _template - _cpp_cls = "IntegratorHPMCMonoMySphere" + _cpp_cls = 'IntegratorHPMCMonoMySphere' def __init__( self, @@ -30,15 +30,15 @@ def __init__( ) typeparam_shape = hoomd.data.typeparam.TypeParameter( - "shape", - type_kind="particle_types", + 'shape', + type_kind='particle_types', param_dict=hoomd.data.parameterdicts.TypeParameterDict( radius=float, ignore_statistics=False, orientable=False, len_keys=1 ), ) self._add_typeparam(typeparam_shape) - @hoomd.logging.log(category="object", requires_run=True) + @hoomd.logging.log(category='object', requires_run=True) def type_shapes(self): """list[dict]: Description of shapes in ``type_shapes`` format.""" return super()._return_type_shapes() diff --git a/src/module.cc b/src/module.cc index 2080690..9c7407d 100644 --- a/src/module.cc +++ b/src/module.cc @@ -3,10 +3,10 @@ // TODO: Include the header files of classes that will be exported to Python. -#include #include "hoomd/hpmc/ComputeFreeVolume.h" #include "hoomd/hpmc/IntegratorHPMC.h" #include "hoomd/hpmc/IntegratorHPMCMono.h" +#include #include "hoomd/hpmc/ComputeSDF.h" #include "hoomd/hpmc/ShapeUnion.h" @@ -36,7 +36,7 @@ namespace hpmc // CMakeLists.txt), prefixed with an underscore. PYBIND11_MODULE(_template, m) { - // TODO: Call export_Class(m) for each C++ class to be exported to Python. + // TODO: Call export_Class(m) for each C++ class to be exported to Python. export_IntegratorHPMCMono(m, "IntegratorHPMCMonoMySphere"); export_ComputeFreeVolume(m, "ComputeFreeVolumeMySphere"); export_ComputeSDF(m, "ComputeSDFMySphere"); @@ -50,13 +50,13 @@ PYBIND11_MODULE(_template, m) .def("asDict", &MySphereParams::asDict); #ifdef ENABLE_HIP - // TODO: Call export_ClassGPU(m) for each GPU enabled C++ class to be exported - // to Python. + // TODO: Call export_ClassGPU(m) for each GPU enabled C++ class to be exported + // to Python. export_IntegratorHPMCMonoGPU(m, "IntegratorHPMCMonoMySphereGPU"); export_ComputeFreeVolumeGPU(m, "ComputeFreeVolumeMySphereGPU"); - export_UpdaterGCAGPU(m, "UpdaterGCAMySphereGPU"); + export_UpdaterGCAGPU(m, "UpdaterGCAMySphereGPU"); #endif } - } // end namespace md + } // namespace hpmc } // end namespace hoomd diff --git a/src/pytest/test_mysphere.py b/src/pytest/test_mysphere.py index 6b7e671..993ae2c 100644 --- a/src/pytest/test_mysphere.py +++ b/src/pytest/test_mysphere.py @@ -5,15 +5,15 @@ import hoomd.template - # TODO: rewrite the unit tests to verify that your shape functions correctly. + def test_attach(simulation_factory, two_particle_snapshot_factory): """Ensure that an integrator can be created with the shape.""" mc = hoomd.template.MySphere() - mc.shape["A"] = dict(radius=0.5) - mc.d["A"] = 0.1 - mc.a["A"] = 0.1 + mc.shape['A'] = dict(radius=0.5) + mc.d['A'] = 0.1 + mc.a['A'] = 0.1 sim = simulation_factory(two_particle_snapshot_factory()) sim.operations.integrator = mc