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

writeg G-EQDSK file #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mgyoo86
Copy link

@mgyoo86 mgyoo86 commented Oct 23, 2024

@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:

g1 == g2
isequal(g1, g2)

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.

@orso82 orso82 requested a review from lstagner October 23, 2024 22:12
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.

1 participant