Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Dec 2, 2024
1 parent d12b7dd commit 28c5d0c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions src/integrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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()
12 changes: 6 additions & 6 deletions src/module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

// TODO: Include the header files of classes that will be exported to Python.

#include <pybind11/pybind11.h>
#include "hoomd/hpmc/ComputeFreeVolume.h"
#include "hoomd/hpmc/IntegratorHPMC.h"
#include "hoomd/hpmc/IntegratorHPMCMono.h"
#include <pybind11/pybind11.h>

#include "hoomd/hpmc/ComputeSDF.h"
#include "hoomd/hpmc/ShapeUnion.h"
Expand Down Expand Up @@ -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<ShapeMySphere>(m, "IntegratorHPMCMonoMySphere");
export_ComputeFreeVolume<ShapeMySphere>(m, "ComputeFreeVolumeMySphere");
export_ComputeSDF<ShapeMySphere>(m, "ComputeSDFMySphere");
Expand All @@ -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<ShapeMySphere>(m, "IntegratorHPMCMonoMySphereGPU");
export_ComputeFreeVolumeGPU<ShapeMySphere>(m, "ComputeFreeVolumeMySphereGPU");
export_UpdaterGCAGPU<ShapeMySphere>(m, "UpdaterGCAMySphereGPU");
export_UpdaterGCAGPU<ShapeMySphere>(m, "UpdaterGCAMySphereGPU");
#endif
}

} // end namespace md
} // namespace hpmc
} // end namespace hoomd
8 changes: 4 additions & 4 deletions src/pytest/test_mysphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 28c5d0c

Please sign in to comment.