-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Brief
We want to use arepo's read_parameter_file to load parameters at the amuse "commit" state. Before "commit", functions can be called to edit the parameter file (or buffer), and after this state, functions would instead modify the stored values (e.g., in All).
Steps
- Add example parameter files for existing cases (noh, collisionless, merger).
- Re-add call to
read_parameter_file. - Edit example parameter files and examples so they work with the examples.
- Move call to
read_parameter_fileto commit state. - Add functions for manipulating parameter files, only callable before commit.
- Have parameter getters/setters edit parameter file before commit and running state after commit.
Background
The approach to loading arepo parameters so far has been to remove the call to read_parameter_file from begrun11, and instead set the parameters via functions in the interface234. This had the advantage of being able to control the settings in the amuse code. The downside is that as we cover cases for different families of arepo configurations, we would need to make use of ifdefs to keep these functions compiling, which is becoming restrictive.
We probably also want functions which copy the parameter file from a params/ directory to the root arepo directory. Similar for make-configuration files?
Proposed solution
We will go back to using parameter files which are processed by read_parameter_file in the "commit" state.
To supplement this, we'll add functions for manipulating the parameter file prior to committing, in the "edit" state.
Functions include:
- Setting a new parameter's value
- Editing the line of an existing parameter
- Removing a line corresponding to a parameter entirely
These operations are only permitted during the edit state.
After this, we may instead need to enable editing a subset of the parameters via setters/getters.
Using these "direct" getters/setters prior to the "commit" state should either raise an error, or instead call the equivalent function editing the parameter file.
Interacting with a parameter file may be replaced by a buffer - a consideration for later.