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

Generalized save #347

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 93 additions & 1 deletion src/DatasetAPI/Datasets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using Glob: glob
using DimensionalData: DimensionalData as DD

export Dataset, Cube, open_dataset, to_dataset, savecube, savedataset
export Dataset, Cube, open_dataset, to_dataset, savecube, savedataset, save

"""
Dataset object which stores an `OrderedDict` of YAXArrays with Symbol keys.
Expand Down Expand Up @@ -638,6 +638,98 @@
Cube(ds, joinname = datasetaxis)
end

"""
Generalized save, for cubes and datasets.
"""
function save(

Check warning on line 644 in src/DatasetAPI/Datasets.jl

View check run for this annotation

Codecov / codecov/patch

src/DatasetAPI/Datasets.jl#L644

Added line #L644 was not covered by tests
c::YAXArray,
path::AbstractString;
layername = get(c.properties,"name","layer"),
datasetaxis = "Variable",
max_cache = 5e8,
backend = :all,
driver = backend,
chunks = nothing,
overwrite = false,
append = false,
skeleton=false,
writefac=4.0,
kwargs...
)
savecube(

Check warning on line 659 in src/DatasetAPI/Datasets.jl

View check run for this annotation

Codecov / codecov/patch

src/DatasetAPI/Datasets.jl#L659

Added line #L659 was not covered by tests
c,
path::AbstractString;
layername = layername,
datasetaxis = datasetaxis,
max_cache = max_cache,
backend = backend,
driver = driver,
chunks = chunks,
overwrite = overwrite,
append = append,
skeleton = skeleton,
writefac = writefac,
kwargs...
)
end
function save(

Check warning on line 675 in src/DatasetAPI/Datasets.jl

View check run for this annotation

Codecov / codecov/patch

src/DatasetAPI/Datasets.jl#L675

Added line #L675 was not covered by tests
c::Dataset,
path::AbstractString;
layername = get(c.properties,"name","layer"),
datasetaxis = "Variable",
max_cache = 5e8,
backend = :all,
driver = backend,
chunks = nothing,
overwrite = false,
append = false,
skeleton=false,
writefac=4.0,
kwargs...
)
savecube(

Check warning on line 690 in src/DatasetAPI/Datasets.jl

View check run for this annotation

Codecov / codecov/patch

src/DatasetAPI/Datasets.jl#L690

Added line #L690 was not covered by tests
c,
path::AbstractString;
layername = layername,
datasetaxis = datasetaxis,
max_cache = max_cache,
backend = backend,
driver = driver,
chunks = chunks,
overwrite = overwrite,
append = append,
skeleton = skeleton,
writefac = writefac,
kwargs...
)
end

function save(

Check warning on line 707 in src/DatasetAPI/Datasets.jl

View check run for this annotation

Codecov / codecov/patch

src/DatasetAPI/Datasets.jl#L707

Added line #L707 was not covered by tests
ds::Dataset,
path::AbstractString;
persist = nothing,
overwrite = false,
append = false,
skeleton=false,
backend = :all,
driver = backend,
max_cache = 5e8,
writefac=4.0,
kwargs...)

savedataset(

Check warning on line 720 in src/DatasetAPI/Datasets.jl

View check run for this annotation

Codecov / codecov/patch

src/DatasetAPI/Datasets.jl#L720

Added line #L720 was not covered by tests
ds;
path = path,
persist = persist,
overwrite = overwrite,
append = append,
skeleton = skeleton,
backend = backend,
driver = driver,
max_cache = max_cache,
writefac = writefac,
kwargs...)
end

"""
function createdataset(DS::Type,axlist; kwargs...)
Expand Down
Loading