Open daniel-sol opened 12 months ago
Is the data class "dictionary"? Or "keyvalues"? Or "json"? I'm thinking of consistency with existing classes, e.g. table
, surface
, cpgrid
etc.
To clarify, we will end up with is something like this:
myfile.yml
.myfile.yml.yml
I have suggested to have class as dictionary. See PR #355
I am wobbling a bit but I think I am leaning more towards using json
(or yaml
) as class, not dict
. I worry about confusion with the dict
data type in Python. A Python dict
can contain "anything", but in this case we are constrained by what can actually be represented as json.
But, that being said - to materialize a JSON from Python, you have a dict
instance. And when parsing JSON with Python, you end up with a dict
instance.
This is conceptually tricky, as it mixes class
and format
. This is much easier with e.g. table
/csv
. I think we are missing the analogue to table
for this. JSON essentially contains two structures: name/value pairs, and (ordered) lists. But I think it will be confusing to start annotating those.
🤯
Well, I beg to differ. I don't think json or yaml, or yml for that matter are the right terms. These are formats, not data structures. But I have changed the classname to dictionary to keep it distinct from pythons dict.
There are several datatypes in the fmu domain that as a data structure best fits in as a dictionary. The first types that spring to mind: