Proposal: FileIO.save keyword argument syntax (FileIO.kwsave ?)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Begin with FileIO.save, especially its existing single-positional-argument method that returns an anonymous function for pipes. Clarify the desired keyword-argument interface and its compatibility with that method; done would be an agreed implementation scope and corresponding behavior in FileIO.
Written by the indexing model from the issue text.
Description
I've added a new syntax to JLD2 and I'm wondering if this could be made compatible with FileIO.
Current example using FileIO:
x = 1
y = 2
z = 42
save("test.jld2", "x", x, "y", "zebra", z)
# or
save("test.jld2", Dict("x" => x, "y" => y, "zebra" => z))
This is clearly very verbose, particularly when variable names are long.
However, this could be made much cleaner if we use keyword argument syntax instead
using JLD2
jldsave("test.jld2"; x, y, zebra=z)
What's great about this, is that we use standard julia syntax and let the parser do the work of extracting
variable names. Until now this was only possible using the @save and @load macros from e.g. BSON, JLD, or JLD2
but these macros introduce odd (and limited) syntax and keep being misunderstood by newcomers.
I'm aware that kwarg stuff is typically not type-stable but this is rarely important when IO is involved.
The problem:
There already is a single-positional-argument method for FileIO.save that returns an anonymous function
to be used with pipes.
What do you think?
Is this interface idea useful enough to add it to FileIO in some way?
- Dominant language
- Julia
- Stars
- 228
- Forks
- 83
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaIO/FileIO.jl
-
Drop the hard `Pkg` dependencyPossibly taken @thchr claimed this 26 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
Add SVGZ formatOpen
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
All issues in JuliaIO/FileIO.jl
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
question
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
brown-ccv/Chamber.jl#272 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
JuliaAstro/SolarPosition.jl#143 ·
-
distributions
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
JuliaBayes/Wren.jl#404 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
JuliaAI/MLJTransforms.jl#113 ·
Maintainers usually reply within 1 day