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 9 commits into
base: main
Choose a base branch
from
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 test/test_ecco.jl
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,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