-
Notifications
You must be signed in to change notification settings - Fork 18
(0.5.1) Metadata
for JRA55
#286
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
Conversation
sounds good |
Ok, please clarify what you see as the trade-offs for user interface. I think you are assuming a design, but it is not being explicitly state. I can't respond or judge what user interface you are referring to, unless you state it explicitly. Part of the problem is the proposal to define someting like struct Metadatum # represents a single file
# properties
end
const Metadata = Vector{Metadatum} has no specific implications for how The difference is mainly that we could define a new constructor for a single So in summary i don't see what changes would be required of the user interface. The difference is that we can expand the user interface to make more sense while leaving existing components unchanged. |
Here's a simple example, just one of many possibilities # source
Metadata(name; version, dates) = [Metadatum(name; version, date for date in dates] datum = Metadatum(name; version, date)
data = Metadata(name; version, dates) the idea of a "version" for general Metadata is weird to me by the way. What concept are we expressing here. |
I was referring to achieving something similar avoiding a Metadatum
name
version
date
dir
end
@propagate_inbounds Base.getindex(m::Metadata, i::Int) = Metadatum(m.name, m.dates[i], m.version, m.dir)
@propagate_inbounds Base.first(m::Metadata) = Metadatum(m.name, m.dates[1], m.version, m.dir)
@propagate_inbounds Base.last(m::Metadata) = Metadatum(m.name, m.dates[end], m.version, m.dir)
@inline function Base.iterate(m::Metadata, i=1)
if (i % UInt) - 1 < length(m)
return Metadatum(m.name, m.dates[i], m.version, m.dir), i + 1
else
return nothing
end
end also in this way it would be possible to do datum = Metadatum(name; version, date)
data = Metadata(name; version, dates) |
I guess I was seeing the ability to mix "versions" as a perk. For example JRA55 was originally generated up to 2018, but there are updates which continue the dataset past that. You may not be able to form a single consistent dataset (eg a single "version") that encompasses all dates, but it still could be valid to write something like up_to_2018 = Metadata(name; dataset=original_dataset, dates=dates_till_2018)
past_2018 = Metadata(name; dataset=continuation, dates=dates_past_2018)
data = vcat(up_to_2018, past_2018) by the way what does "version" mean in the context of a general |
I guess version is more suited in main where Metadata is You are right that that field name has to change in this PR, I like |
eg struct ECCODataset
version :: Symbol
end am I right that the path to a particular file is determined by a combination of |
yep, in general the full file path is determined by the whole |
Ruminating on "dataset" --- I think it could be a good term, because it expresses the concept of a "category of data". Which is what we mean here, a single Also just to offer an alternative --- rather than metadatum / metadata, we could have struct Metadata
name
dataset
end
const MetadataSeries = Vector{Metadata} semantically, MetadataSeries is easier to distinguish from |
…ean.jl into ss/metadata-for-everything
I think I can merge here even if the examples are not passing. We are hitting a scalar indexing problem, which I believe is connected to CliMA/Oceananigans.jl#4087 but is not part of this PR. Then we can think about an interface for metadata that allows distinguishing between dates and date |
Metadata
for JRA55Metadata
for JRA55
Metadata
for JRA55Metadata
for JRA55
…ean.jl into ss/metadata-for-everything
Metadata
for JRA55Metadata
for JRA55
The errors in the examples are not due to this PR. I opened an issue with the error. Let's not delay this PR further. I will merge this, then we can look at differences in |
This PR is an initial proposal to generalize
ECCOMetadata
toMetadata
and rework the JRA55 module to useMetadata
. In this way, we can have different JRA55 versions (repeat year and multiple year) and we can define adownload_dataset
function to download the dataset independently of using JRA55 as we can do for ECCOThis PR also removes the ability to generate a
JRA55FieldTimeSeries
directly interpolated on the ocean grid, since we need to interpolate anyways when we compute fluxescloses #182