[x] Implemented the source code change that satisfies the tests
[x] Documented the feature by providing worked example
[x] Updated the README or other documentation
[x] Completed the pre-Request checklist below
Change Description
This PR implements a Python class for creating an object that holds all the data needed for an initialisation file and a method for writing it to disk. The class is designed to create idealised setups with a fixed resolution. Once we start using realistic grids more, we may want to generalise it.
The user creates an object, giving the constructor the array dimensions and resolution. The initial object contains all the variables that should be included in the initialisation file, all set to zero. The user can modify these variables at will. The file is written once the object goes out of scope (the end of a loop or program). The method for writing to the file does some minimal checking and warning.
Closes #533
Test Description
No direct tests implemented, but this should be used in the integration tests (not done yet).
Documentation Impact
Documentation of this class is to be included in #520. There is some minimal self-documentation in the class itself.
Other Details
N/A
Pre-Request Checklist
[x] The requirements of this pull request are fully captured in an issue or design specification and are linked and summarised in the description of this PR
[x] No new warnings are generated
[x] The documentation has been updated (or an issue has been created to track the corresponding change)
[x] Methods and Tests are commented such that they can be understood without having to obtain additional context
[x] This PR/Issue is labelled as a bug/feature/enhancement/breaking change
[x] File dates have been updated to reflect modification date
[x] This change conforms to the conventions described in the README
Better way to create init files
Fixes #533
Task List
Change Description
This PR implements a Python class for creating an object that holds all the data needed for an initialisation file and a method for writing it to disk. The class is designed to create idealised setups with a fixed resolution. Once we start using realistic grids more, we may want to generalise it.
The user creates an object, giving the constructor the array dimensions and resolution. The initial object contains all the variables that should be included in the initialisation file, all set to zero. The user can modify these variables at will. The file is written once the object goes out of scope (the end of a loop or program). The method for writing to the file does some minimal checking and warning.
Closes #533
Test Description
No direct tests implemented, but this should be used in the integration tests (not done yet).
Documentation Impact
Documentation of this class is to be included in #520. There is some minimal self-documentation in the class itself.
Other Details
N/A
Pre-Request Checklist