-
Notifications
You must be signed in to change notification settings - Fork 17
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
i-PI integration #307
i-PI integration #307
Conversation
bindings/rascal/models/krr.py
Outdated
def compute_KNM(frames, X_sparse, kernel, soap): | ||
Nstructures, Ngrads, Ngrad_stride = get_strides(frames) | ||
KNM = np.zeros((Nstructures + Ngrads, X_sparse.size())) | ||
pbar = tqdm(frames, desc="compute KNM", leave=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, I'm not sure how I feel about including tqdm
at such a deep level -- it seems wrong for the code to need to know about something that's in principle unrelated, but I'm not sure I see a better solution.
One idea would instead be to wrap frames
in a tqdm
before passing it to this function in whatever notebook uses these - will look into this later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will look into this later.
Did you try this? I would find it much more elegant, and it gives the user more control over the tqdm display name/positions/style etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet; I ended up just using the fix in cf0e660.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I found a way that works -- it's not pretty, because the function iterates through the frames twice and I can't find a way to reset a tqdm bar once it's finished (you'd think that would be a pretty basic feature, but whatever).
A few high level comments before I dive into this for a review
|
I'll do that when I rebase this branch. The (tiny) conflicts here were caused by a rebase/squash of yesterday's bugfix branch (that was extracted from this one).
Didn't realize it was that large... I was already using what felt like a very small number of sparse points, but I'll try to cut it down further.
That's really a discussion for #305 (which is going to be my main "project" after this PR; it was also the branch used to generate this model file). To summarize for now, the model JSON is the serialization of a Python And anyway, the file lives in |
(still need to work out some kinks in the return format, depending on what i-PI expects)
and fix naming issue
also update description and autoformat
Simplify and test IPI tutorial notebook; replace BaTiO3 example with Zundel
Remove i-PI specific unit conversions and input/output formatting; this should be taken care of on the i-PI side.
Edit: reduce the size of simple testing GAP model file
Cherry-picked from feat/gaptools for compatibility with gaptools-generated model
(although probably they should be moved to something like a notebook-utils folder, or eventually just merged into gaptools) also, remove unused imports in zundel i-PI example
and update versions in requirements.txt too (for CI)
The updated example model file is much better, and I'm fine with leaving the discussion of the serialization format for models for a later PR! |
- Remove 'assume_pbc' option; user must now specify PBC explicitly on initialization - Allow specifying bare 'atomic_numbers' in lieu of structure template - Check for number-of-atoms consistency
It should only ever be initialized via the standard __init__ way
I'm pretty much done on the bindings side; perhaps @lgigli can have a look at the notebook comments since he's the one who wrote it? |
not sure what's happening with the doc build... Sphinx is complaining about some utf-8 characters in a file it's trying to interpret in ASCII mode (why??? why won't ASCII die already??) -- but I'm pretty sure I didn't add any funny characters or change file encodings or the build configuration since the last successful doc build. And it runs just fine on my machine. |
This is full (!) traceback of the error, looks like it happens when trying to load the
|
omg no way, the build is failing due to a bug in the latest version (0.17) of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good, feel free to merge after squashing related commits together!
Note also: i-PI examples dir has been renamed Co-authored-by: Guillaume Fraux <[email protected]>
(https://sourceforge.net/p/docutils/bugs/414/, can revert this once it's pushed to pyPI)
Add support for i-PI using a dedicated calculator, which is also usable as a "generic" MD interface for any other MD code. Works with the branch https://github.com/cosmo-epfl/i-pi/tree/feat/librascal
The new calculator is implemented in
bindings/rascal/models/genericmd.py
.Still to be worked out:
Confirm sign convention of virialConfirmed experimentallyMake units handling more robust (fewer assumptions)moved to i-PIDoes i-PI run non-periodic simulations? If so, how is this signalled to the force driver?NoTasks before review:
formatted correctly (ask @max-veit if you need help with this task).
explain the feature and its usage in plain English
to verify the fix and catch future regressions as well as similar bugs
elsewhere in the code.
make lint
on the project, ensure it passesmake pretty-cpp
andmake pretty-python
, check that theauto-formatting is sensible
own branch
Co-written with Lorenzo (@lgigli)