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

Eliminate second constructor for ECCO_metadata #241

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 1 addition & 4 deletions src/DataWrangling/ECCO/ECCO_metadata.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Base.summary(md::ECCOMetadata{<:AbstractCFDateTime, <:ECCO2Monthly}) = "ECCO2Mon
Base.summary(md::ECCOMetadata{<:AbstractCFDateTime, <:ECCO4Monthly}) = "ECCO4Monthly $(md.name) metadata at $(md.dates)"

"""
ECCOMetadata(name::Symbol;
ECCOMetadata(name::Symbol;
dates = DateTimeProlepticGregorian(1993, 1, 1),
version = ECCO4Monthly(),
dir = download_ECCO_cache)
Expand Down Expand Up @@ -77,9 +77,6 @@ function ECCOMetadata(name::Symbol;
return ECCOMetadata(name, dates, version, dir)
end

ECCOMetadata(name::Symbol, date, version=ECCO4Monthly(); dir=download_ECCO_cache) =
ECCOMetadata(name, date, version, dir)

# Treat ECCOMetadata as an array to allow iteration over the dates.
Base.eltype(metadata::ECCOMetadata) = Base.eltype(metadata.dates)

Expand Down
2 changes: 1 addition & 1 deletion src/DataWrangling/ECCO/ECCO_restoring.jl
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ function ECCORestoring(arch::AbstractArchitecture,
dates=all_ECCO_dates(version),
kw...)

metadata = ECCOMetadata(variable_name, dates, version)
metadata = ECCOMetadata(variable_name; dates, version)
return ECCORestoring(arch, metadata; kw...)
end

Expand Down
2 changes: 1 addition & 1 deletion test/test_ecco.jl
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ end

ocean = ocean_simulation(grid)
date = DateTimeProlepticGregorian(1993, 1, 1)
set!(ocean.model, T=ECCOMetadata(:temperature, date), S=ECCOMetadata(:salinity, date))
set!(ocean.model, T=ECCOMetadata(:temperature; dates=date), S=ECCOMetadata(:salinity; dates=date))
end
end

Expand Down
Loading