Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add _ext_module variable to base python classes #1853

Merged
merged 3 commits into from
Jul 22, 2024

Conversation

astatt
Copy link
Contributor

@astatt astatt commented Jul 19, 2024

Description

Without the variable _ext_module some of the base python classes cannot be easily extended in external plugins, because it will not correctly find it, i.e when wanting to use or import "plugin_name.wall.PotentialName" it will instead look for "hoomd.wall.PotentialName". The simple inclusion of "_ext_module = _md" that can be overwritten by the plugin fixes this issue.

Motivation and context

Needed for convenient development of external plugins.
Resolves Issue #1852.

How has this been tested?

This has been tested locally on the CPU. Because it only touches *.py files, no other tests are necessary.

Change log

Fix: External walls, external fields, and constrains can now be implemented via external plugins 

Checklist:

@astatt astatt requested review from a team, joaander, SchoeniPhlippsn and syjlee and removed request for a team July 19, 2024 20:52
hoomd/md/pair/aniso.py Outdated Show resolved Hide resolved
Copy link
Member

@joaander joaander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@joaander joaander merged commit 3ac3ed3 into glotzerlab:trunk-patch Jul 22, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants