In the documentation for the shape parameter of md.pair.aniso.ALJ, the key rounding_radii is labelled "required", but the description says "defaults to (0.0, 0.0, 0.0)" and the key is omitted in the example code: alj.shape["A"] = dict(vertices=cube_verts, faces=cube_faces). The description and example code should be modified to reflect the fact that the key is required.
Motivation and context
Making sure the documentation is internally consistent will help prevent confusion on implementing the ALJ, which is already a complicated potential to use correctly.
When trying to assign the shape parameter dictionary without specifying the rounding_radii key, I get the following error, which indicates that the key is indeed required:
Traceback (most recent call last):
File "/home/joseph/miniconda3/envs/glotzergroup/lib/python3.11/site-packages/hoomd/operation.py", line 316, in _attach
self._apply_typeparam_dict(self._cpp_obj, self._simulation)
File "/home/joseph/miniconda3/envs/glotzergroup/lib/python3.11/site-packages/hoomd/operation.py", line 350, in _apply_typeparam_dict
typeparam._attach(cpp_obj, simulation.state)
File "/home/joseph/miniconda3/envs/glotzergroup/lib/python3.11/site-packages/hoomd/data/typeparam.py", line 171, in _attach
self.param_dict._attach(cpp_obj, self.name,
File "/home/joseph/miniconda3/envs/glotzergroup/lib/python3.11/site-packages/hoomd/data/parameterdicts.py", line 518, in _attach
self._single_setitem(key, parameters[key])
File "/home/joseph/miniconda3/envs/glotzergroup/lib/python3.11/site-packages/hoomd/data/parameterdicts.py", line 461, in _single_setitem
getattr(self._cpp_obj, self._setter)(key, item)
KeyError: 'rounding_radii'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/joseph/GlotzerGroup/pentagonal-nanorods/actions.py", line 66, in <module>
globals()[args.action](*jobs)
File "/home/joseph/GlotzerGroup/pentagonal-nanorods/actions.py", line 46, in run
utils.run(simulation=simulation, nsteps=1e6)
File "/home/joseph/GlotzerGroup/pentagonal-nanorods/utils.py", line 576, in run
simulation.run(nsteps)
File "/home/joseph/miniconda3/envs/glotzergroup/lib/python3.11/site-packages/hoomd/simulation.py", line 555, in run
self.operations._schedule()
File "/home/joseph/miniconda3/envs/glotzergroup/lib/python3.11/site-packages/hoomd/operations.py", line 211, in _schedule
self.integrator._attach(sim)
File "/home/joseph/miniconda3/envs/glotzergroup/lib/python3.11/site-packages/hoomd/operation.py", line 310, in _attach
self._attach_hook()
File "/home/joseph/miniconda3/envs/glotzergroup/lib/python3.11/site-packages/hoomd/md/integrate.py", line 307, in _attach_hook
super()._attach_hook()
File "/home/joseph/miniconda3/envs/glotzergroup/lib/python3.11/site-packages/hoomd/md/integrate.py", line 48, in _attach_hook
self._forces._sync(self._simulation, self._cpp_obj.forces)
File "/home/joseph/miniconda3/envs/glotzergroup/lib/python3.11/site-packages/hoomd/data/syncedlist.py", line 246, in _sync
raise err
File "/home/joseph/miniconda3/envs/glotzergroup/lib/python3.11/site-packages/hoomd/data/syncedlist.py", line 242, in _sync
self._register_item(item)
File "/home/joseph/miniconda3/envs/glotzergroup/lib/python3.11/site-packages/hoomd/data/syncedlist.py", line 190, in _register_item
value._attach(self._simulation)
File "/home/joseph/miniconda3/envs/glotzergroup/lib/python3.11/site-packages/hoomd/operation.py", line 318, in _attach
raise type(err)(
KeyError: "Error applying parameters for object of type <class 'hoomd.md.pair.aniso.ALJ'>."
Description
In the documentation for the
shape
parameter of md.pair.aniso.ALJ, the keyrounding_radii
is labelled "required", but the description says "defaults to (0.0, 0.0, 0.0)" and the key is omitted in the example code:alj.shape["A"] = dict(vertices=cube_verts, faces=cube_faces)
. The description and example code should be modified to reflect the fact that the key is required.Motivation and context
Making sure the documentation is internally consistent will help prevent confusion on implementing the ALJ, which is already a complicated potential to use correctly.
When trying to assign the
shape
parameter dictionary without specifying therounding_radii
key, I get the following error, which indicates that the key is indeed required: