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

implement better save macro #198

Merged
merged 5 commits into from
Aug 13, 2020

Conversation

JonasIsensee
Copy link
Collaborator

@JonasIsensee JonasIsensee commented Jul 5, 2020

Hi,

this PR implements a new @save macro.
As far as I can see it does not break any old behaviour but it allows for more flexibility.

New features are:
Option passing:

hello = "world"
@save "test.jld2" {compress=true} hello
@save "test.jld2" {compress=true, mmaparrays=false} hello
  • Assignment syntax
@save "test.jld2" bye=hello
@save "test.jld2" hello randomnumber=rand(10)

This is relevant for:
#162
closes #132
closes #133

What do you think?
Is this a good compromise in terms of syntax?

@JonasIsensee
Copy link
Collaborator Author

This PR now has an additional commit that adds iotype as a kwarg to the interface.
In this way one can now write e.g.

@save "test.jld2" {iotype=IOStream} key=val

jldopen("test.jld2", "w"; iotype=IOStream) do f
    write(f, key, val)
end

@JonasIsensee JonasIsensee merged commit e5e884e into JuliaIO:master Aug 13, 2020
@biona001
Copy link

Hello, so what is the new syntax for saving something with compress=true?

@JonasIsensee
Copy link
Collaborator Author

Hi
the new syntax is

hello = "world"
@save "test.jld2" {compress=true} hello

but so far this is only on master.
In about 2 weeks there should be a new release so that you can update JLD2 locally for the new features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Global compress option var=expr support in @save macro
2 participants