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

More detailed examples in the documentation on how to use JLSO.save? #88

Open
CosmoProf opened this issue Nov 10, 2020 · 1 comment
Open

Comments

@CosmoProf
Copy link

Hi, what is the syntax needed to use JLSO.save to save other objects, like arrays , ODEsolutions, etc.?
And how does one save using different options, like format=:julia_serialize, etc.?

There is only one example in the documentation,
JLSO.save("breakfast.jlso", "food" => "☕️🥓🍳", "cost" => 11.95, "time" => Time(9, 0)) ,
and this does not clarify the general syntax for how to save data structures.

Thanks for any info.

@rofinn
Copy link
Member

rofinn commented Nov 10, 2020

It's the same syntax regardless of the object being saved. JLSO doesn't really care about what the objects are as long as the underlying serialization format can handle it (e.g., :bson vs :julia_serialization). The save options are just keywords as you'd expect. Here's an example of how we generate our test files for each new JLSO file format version released.

https://github.com/invenia/JLSO.jl/blob/master/test/test_data_setup.jl#L34

In that case, we're passing a dict cause that's more convenient, but pairs will also work.

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

No branches or pull requests

2 participants