Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@orso82 @bclyons12 @eldond
This Pull Request introduces the implementation of the "writeg" function in EFIT.jl, which serves as the counterpart to the existing readg function.
Overview of "writeg" function:
The "writeg" function is designed to take a GEQDSKFile struct and write it as an ASCII file in the G_EQDSK format to disk.
Input/Output Details:
Input 1: g::GEQDSKFile — The GEQDSKFile struct containing the data to be written.
Input 2: filename::String — The name of the file to which the data will be written.
Keyword Argument: desc::String="description" — A description that can be added to the file header (optional).
Output: Bool — Returns true on successful write operation, or false if the write operation fails.
Helper functions to compare GEQDSKFile structs
In addition to the writeg function, some helper functions were implemented to facilitate hash-based comparison of GEQDSKFile structs.
One can now compare two GEQDSKFile structs for equality using:
Tests:
These helper functions were used in runtests.jl to validate the correctness of the writeg function, ensuring that the output file is properly written and the data is accurately represented.