BrainPy has inconsistent guide on how to clear the name cache in the code and documentation, and it seems that none of them work.
For example:
In brainpy/_src/math/object_transform/naming.py:
f'In BrainPy, each object should have a unique name. '
f'However, we detect that {obj} has a used name "{name}". \n'
f'If you try to run multiple trials, you may need \n\n'
f'>>> brainpy.brainpy_object.clear_name_cache() \n\n'
f'to clear all cached names. '
UniqueNameError : In BrainPy, each object should have a unique name. However, we detect that <__main__.FHN object at 0x0000013BEA0DDF10> has a used name "Y".
If you try to run multiple trials, you may need
brainpy.base.clear_name_cache()
to clear all cached names.
3. In https://brainpy.readthedocs.io/en/latest/tutorial_building/customize_dynamical_systems.html, section "1. A systematic naming system.": same as point 2.
However, it seems that the correct command should be `brainpy.math.clear_name_cache()`. Hope the code and documentation could be updated.
BrainPy has inconsistent guide on how to clear the name cache in the code and documentation, and it seems that none of them work.
For example:
In
brainpy/_src/math/object_transform/naming.py
:In https://brainpy.readthedocs.io/en/latest/tutorial_advanced/base_and_collector.html, section "The naming system":
to clear all cached names.