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

where possible, use version of fitting script that corresponds to imported module #268

Open
bernstei opened this issue Oct 23, 2023 · 0 comments

Comments

@bernstei
Copy link
Contributor

For MACE and GAP, we can find the fitting script that's consistent with the currently installed module, and this should possibly be the default, ahead of the one that's in the path, if it's not explicitly specified in function arg or env var.

For mace, there's a script we can just run:

import mace
f = Path(mace.__file__).parent / "cli" / "run_train.py"
command = f"python3 {f}"

For gap there's no such script, but we could perhaps use

command = f"python3 -c 'import quippy.cli; quippy.cli.gap_fit()'"

assuming that the executed python3 will inherit the same PYTHONPATH as the running one (could always do some sort of thing with env PYTHONPATH={...} python3 ... filling in the path from sys.path.

Note that the inheriting of the PYTHONPATH could also be a problem, albeit in a subtler way, for the mace option, because even if we explicitly find the version of run_train.py, any modules it loads will come from PYTHONPATH.

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

No branches or pull requests

1 participant