ensure period in block order is last#309
Conversation
| return 4 | ||
| else: | ||
| return 5 | ||
| return 3 |
There was a problem hiding this comment.
so the general rule is: options, dimensions, grid, everything else, period blocks?
the packagedata condition above could go away then?
There was a problem hiding this comment.
It should always reflect dfn order, maybe so?
| block_name: {field["name"]: FieldV1.from_dict(field) for field in block} | ||
| for block_name, block in groupby(fields.values(), lambda field: field["block"]) | ||
| for block_name, block in groupby( | ||
| fields.values(multi=True), lambda field: field["block"] |
| k, _ = item | ||
| if k == "options": | ||
| return 0 | ||
| elif k == "dimensions": |
There was a problem hiding this comment.
does dimensions not need to come before grid data?
There was a problem hiding this comment.
This routine sorts dfn block order- elsewhere convention is the rule. Seems like enumerating all possible blocks is the right way if we want to enforce it here or if not remove?
There was a problem hiding this comment.
I guess it's not just convention, it's block order defined in dfn as schema.
There was a problem hiding this comment.
yeah only implicitly defined, right? and we are making it explicit with this routine. so if there is a rule to enforce, here is the place, but that's what I don't know: does the dimensions block need to come before griddata like it does before period blocks?
or do we just take the order defined in the DFN as the rule? in which case we should make that explicit somewhere.
There was a problem hiding this comment.
Yes dimensions always immediately follow options when it is defined.
That's what I was trying to get at- this really fits more cleanly in the schema and it is there already just not as explicit as we would like. Maybe we can talk about this before this PR goes in.
No description provided.