-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add CSV export method to Field class #379
base: main
Are you sure you want to change the base?
Conversation
Hey hey, thank you for the initiative! I think this should be easily doable, by providing another argument with which you can choose your export function/ format. I think it would even be okay for me, if CSV stays the default format. |
😂 This implementation is just For further IO stuff I would like to be able to pickle and unpickle our objects and/or use (safer) serialization approaches like json. Should we rename it to |
Yes, I had a look at your implementation. But from a quick check, it seems that I like the name of the function and I think you should keep Why would you want to specifically support json export? I don't think that json is a very fitting format for GSTools and would much more prefer other formats. |
But json for example to store CovModel configuration? I think this would be really cool. |
I think all the others export routines are more meant to be used for storing and loading again, since they are not human readable file formats. |
Exactly, the npy- and npz-files are binary and Numpy understands their content, making the reading much easier than CSV files. I actually use an npz-file for one of the plurigaussian examples So, I don't really get your argument against supporting Numpy's other save functions. |
We should probably shift this discussion to another time ;-) |
closes #367
This new method
csv_export
allows to export all fields of a field class together with the pos tuple into a csv file.Structured fields will be converted to unstructured to get flat arrays.
Example:
Resulting file
fields.csv
: