-
Notifications
You must be signed in to change notification settings - Fork 78
Update tutorial/docs, improve C++ error handling, and fix Kokkos types #451
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
base: master
Are you sure you want to change the base?
Conversation
Removed unfix command for 'nve' to be compatible with ase==3.27.0 lammps calculator logic
using += when adding command strings to a list will breaks the string into single char
Move skip logic inside all_gp fixture body using pytest.skip()
ASE uses a string for 'velocity'
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.
Pull request overview
This pull request enhances the FLARE codebase with comprehensive improvements across documentation, C++ LAMMPS plugins, Kokkos implementations, and Python code. The changes focus on updating installation requirements, improving error handling in file I/O operations, modernizing Kokkos type definitions, and fixing several bugs in Python code.
Changes:
- Updated installation documentation to use Python 3.10 and GCC 11, and removed the development branch requirement
- Added comprehensive error handling for file reading operations in LAMMPS C++ plugins with NULL checks on fgets() calls
- Migrated Kokkos code from deprecated float types (X_FLOAT, F_FLOAT, E_FLOAT) to modern types (KK_FLOAT, KK_ACC_FLOAT)
- Fixed Python bugs in LAMMPS calculator related to list/string type handling and corrected sscanf pointer usage in C++ code
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_mgp.py | Moved pytest skip check from decorator to inside fixture body for better clarity |
| tests/test_lammps.py | Corrected velocity parameter type from list to string to match ASE LAMMPS API |
| lammps_plugins/pair_mgp.cpp | Added NULL checks for fgets() calls and fixed sscanf char array pointer usage |
| lammps_plugins/pair_flare.cpp | Added NULL checks for fgets() calls and fixed sscanf char array pointer usage |
| lammps_plugins/compute_flare_std_atom.cpp | Added comprehensive error handling for file reading operations |
| lammps_plugins/kokkos/pair_mgp_kokkos.h | Updated type definitions from F_FLOAT/E_FLOAT to KK_FLOAT/KK_ACC_FLOAT |
| lammps_plugins/kokkos/pair_mgp_kokkos.cpp | Replaced all deprecated Kokkos float types with modern equivalents |
| lammps_plugins/kokkos/pair_flare_kokkos.h | Updated Kokkos type definitions and view types |
| lammps_plugins/kokkos/pair_flare_kokkos.cpp | Migrated to KK_FLOAT and KK_ACC_FLOAT throughout |
| flare/scripts/otf_train.py | Fixed typo: "intialize" → "initialize" |
| flare/md/lammps.py | Fixed model_post list append operations and velocity parameter type |
| docs/source/tutorials/colabs.rst | Updated main tutorial link and description |
| docs/source/installation/install.rst | Updated Python version examples from 3.8 to 3.10 |
| .github/workflows/flare.yml | Updated to GCC 11 and removed ASE patch step |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
This pull request introduces several improvements across the documentation, Python, and C++/Kokkos codebases for FLARE. The changes include updating documentation and installation instructions, improving error handling in the LAMMPS plugin C++ code, and correcting data types for Kokkos compatibility. Additionally, there are minor bug fixes and code cleanups.
Documentation and Installation Updates:
developmentbranch, and updated example paths to reflect Python 3.10. [1] [2] [3] [4]colabs.rst, updating the main FLARE tutorial and improving clarity.LAMMPS Plugin and C++ Improvements:
Kokkos Codebase Corrections:
X_FLOAT/F_FLOATtoKK_FLOAT/KK_ACC_FLOATthroughout the Kokkos pair potential implementation. [1] [2] [3] [4] [5] [6] [7] [8]Python Code Fixes:
model_postandcomputecommands inflare/md/lammps.pyto use lists consistently, preventing string concatenation bugs. Also, corrected the expected type for thevelocityparameter for ASE LAMMPS calculator. [1] [2]flare/scripts/otf_train.py.Workflow Simplification: