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

Roll out ScriptInterface #4541

Merged
merged 23 commits into from
Aug 8, 2022
Merged

Roll out ScriptInterface #4541

merged 23 commits into from
Aug 8, 2022

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Jul 22, 2022

Description of changes:

  • convert Cython files to Python files using the ScriptInterface framework:
    • particle handle/list/slice classes
    • system class and globals class
    • comfixed, galilei, analysis, polymer functions
    • code_info, cuda_init, version modules
  • make ScriptInterface conversion error messages clearer by printing the contents of Python containers, so as to provide a viable alternative to utils.check_type_or_throw_except()
  • remove timestamp from config.hpp and sort features alphabetically to improve ccache efficiency
  • API change: class attributes expecting 3 boolean values no longer accept integer values
    • affected properties: system.periodicity, particle.fix, particle.rotation
    • it is no longer possible to set those properties with e.g. [1, 1, 1] or [0, 0, 1]
  • declutter src/core and src/script_interface by grouping similar features into submodules
    • src/core/*.{h,c}pp files are now for the most part declaring or using global variables (snake case filenames), while src/core/*/*.{h,c}pp mostly contain class definitions (Pascal case filenames)
    • src/script_interface/*.{h,c}pp files now all contain the ScriptInterface classes and helper functions, while src/script_interface/*/*.{h,c}pp contains the consumer code that bridges the core classes to the Python classes

jngrad added 12 commits July 19, 2022 14:03
Return std::vector objects as numpy arrays and Utils::Vector objects
as array_locked. Add support for Utils::Vector3i and Utils::Vector3b.
Improve get_value() exception mechanism to print the types contained
in a container, e.g. `std::unordered_map<int, Variant>` is printed as
`std::unordered_map<int, ScriptInterface::Variant{int, Utils::Vector3d}>`
to help understand why a type conversion failed.
Move the features checking logic to a dedicated file.
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jngrad jngrad force-pushed the refactor_cython branch from d2a6ba7 to be4eeea Compare July 22, 2022 12:55
@jngrad jngrad force-pushed the refactor_cython branch from be4eeea to d1ea885 Compare July 22, 2022 16:07
@jngrad jngrad marked this pull request as ready for review July 22, 2022 16:57
@jngrad jngrad added this to the Espresso 4.3.0 milestone Jul 22, 2022
@jngrad jngrad mentioned this pull request Jul 22, 2022
@jngrad jngrad requested a review from christophlohrmann July 22, 2022 16:58
jngrad added 3 commits July 28, 2022 23:11
Make the script fully reproducible by sorting feature sets and
removing the absolute file path and timestamp. This makes object
file caching much more efficient. Cleanup outdated comments.
@jngrad jngrad requested a review from reinaual August 2, 2022 13:50
@jngrad
Copy link
Member Author

jngrad commented Aug 4, 2022

This PR needs to be merged before the coding day. It currently blocks the non-bonded interaction refactoring (coding day task) and the CMake FindPython refactoring (already deployed on the walberla branch).

reinaual
reinaual previously approved these changes Aug 5, 2022
@jngrad jngrad dismissed stale reviews from reinaual and christophlohrmann via bba0681 August 5, 2022 14:00
reinaual
reinaual previously approved these changes Aug 5, 2022
@jngrad jngrad added the automerge Merge with kodiak label Aug 8, 2022
@kodiakhq kodiakhq bot merged commit c06f911 into espressomd:python Aug 8, 2022
@jngrad jngrad deleted the refactor_cython branch August 8, 2022 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants