-
Notifications
You must be signed in to change notification settings - Fork 10
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
Does ECCOMetadata
have dates
or a date
? (Should we use a different design for ECCOMetadata
?)
#224
Comments
I guess another possibility is to discontinue "single date" support, so users just have to write |
I can confirm that following the documentation example and using
throws an error:
But changing the syntax to
works, as expected. |
I guess the global simulation example uses date = DateTimeProlepticGregorian(1993, 1, 1)
set!(ocean.model, T=ECCOMetadata(:temperature; dates=date),
S=ECCOMetadata(:salinity; dates=date)) If we are ok with this syntax we can close this issue. I guess the basic idea is that we can make metadata representing a range of dates: julia> dates = DateTimeProlepticGregorian(1993, 1, 1):Month(1):DateTimeProlepticGregorian(1994, 1, 1)
DateTimeProlepticGregorian(1993-01-01T00:00:00):Month(1):DateTimeProlepticGregorian(1994-01-01T00:00:00)
julia> metadata = ECCOMetadata(:temperature; dates)
ECCOMetadata:
├── name: temperature
├── dates: DateTimeProlepticGregorian(1993-01-01T00:00:00):Month(1):DateTimeProlepticGregorian(1994-01-01T00:00:00)
├── version: ClimaOcean.DataWrangling.ECCO.ECCO4Monthly()
└── dir: /Users/gregorywagner/.julia/scratchspaces/0376089a-ecfe-4b0e-a64f-9c555d74d754/ECCO Then we can index into that metadata like its a vector: julia> metadata[1]
ECCOMetadata:
├── name: temperature
├── dates: DateTimeProlepticGregorian(1993-01-01T00:00:00)
├── version: ClimaOcean.DataWrangling.ECCO.ECCO4Monthly()
└── dir: /Users/gregorywagner/.julia/scratchspaces/0376089a-ecfe-4b0e-a64f-9c555d74d754/ECCO which gives the same thing as building the metadata with a single date. It doesn't feel like the most natural syntax but it's also not horrible. So maybe we can close this issue. |
Also worth noting that the docstring was fixed at some point:
|
The docstring says
date
ClimaOcean.jl/src/DataWrangling/ECCO/ECCO_metadata.jl
Line 54 in 9c858b0
but the actual function signature requires
dates
:ClimaOcean.jl/src/DataWrangling/ECCO/ECCO_metadata.jl
Line 59 in 9c858b0
I also want to note that I think this design is confusing. The user interface is confusing, and it also makes the source code confusing.
Another design could be to have
ECCOMetadata
represent a single instance and then use a vector ofECCOMetadata
to represent many of them (if that is even necessary).Anything to make the design more explicit with less hidden suprises.
The text was updated successfully, but these errors were encountered: