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

Define runtime parameters in Python #253

Merged
merged 5 commits into from
Dec 18, 2024
Merged

Define runtime parameters in Python #253

merged 5 commits into from
Dec 18, 2024

Conversation

icui
Copy link
Collaborator

@icui icui commented Dec 9, 2024

Description

Implements runtime configuration and add pip dependencies.

Issue Number

#231

Checklist

Please make sure to check developer documentation on specfem docs.

[] I ran the code through pre-commit to check style
[] My code passes all the integration tests
[] I have added sufficient unittests to test my changes
[] I have added/updated documentation for the changes I am proposing
[] I have updated CMakeLists to ensure my code builds
[] My code builds across all platforms

@@ -95,7 +95,13 @@ void execute(const std::string &parameter_file, const std::string &default_file,
// Read parameter file
// --------------------------------------------------------------
auto start_time = std::chrono::system_clock::now();
specfem::runtime_configuration::setup setup(parameter_file, default_file);
specfem::runtime_configuration::setup setup(parameter_file, default_file,
#ifdef SPECFEMPP_BINDING_PYTHON
Copy link
Collaborator

@Rohit-Kakodkar Rohit-Kakodkar Dec 9, 2024

Choose a reason for hiding this comment

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

This becomes tough to read IMO. We need to come up with a better way

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This should be changed after we template YAML::Node

Copy link
Collaborator

Choose a reason for hiding this comment

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

Check comments on setup.hpp

*/
setup(const std::string &parameter_file, const std::string &default_file);
setup(const std::string &parameter_file, const std::string &default_file,
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we provide 2 constructors.

  1. setup(const std::string &parameter_file, const std::string &default_file) This gets called by specfem2d.cpp driver code
  2. template<typename Dictionary> setup(const Dictionary &Dictionary) this gets called by 1 (function listed above) and by python as setup(pybind::dict)

Copy link
Collaborator

@Rohit-Kakodkar Rohit-Kakodkar left a comment

Choose a reason for hiding this comment

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

See comments

@icui icui requested a review from Rohit-Kakodkar December 9, 2024 21:11
Copy link
Collaborator

@Rohit-Kakodkar Rohit-Kakodkar left a comment

Choose a reason for hiding this comment

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

LGTM

@icui icui merged commit 36a0aec into issue-231 Dec 18, 2024
2 of 3 checks passed
@icui icui deleted the issue-231-3-1 branch December 18, 2024 15:28
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