-
-
Notifications
You must be signed in to change notification settings - Fork 364
Closed
Labels
design discussionhelp wantedIssue could use help from someone with familiarity on the topicIssue could use help from someone with familiarity on the topic
Milestone
Description
In the current V3 draft version, all metadata classes are closely modeled after the json representation. For example, the regular chunk grid is represented as this json object:
{
"name": "regular",
"configuration": { "chunk_shape": [2, 5] }
}
In Python, these objects are implemented as 2 classes
@frozen
class RegularChunkGridConfigurationMetadata:
chunk_shape: ChunkCoords
@frozen
class RegularChunkGridMetadata:
configuration: RegularChunkGridConfigurationMetadata
name: Literal["regular"] = "regular"
ChunkGridMetadata = Union[RegularChunkGridMetadata]
This is an artifact of using cattrs for (de)serialization. However, we were thinking of dropping the attrs dependency. That would open the way for a more ergonomic class design that serializes to the same json structure.
class ChunkGrid(ABC):
pass
class RegularChunkGrid(ChunkGrid):
chunk_shape: ChunkCoords
Metadata
Metadata
Assignees
Labels
design discussionhelp wantedIssue could use help from someone with familiarity on the topicIssue could use help from someone with familiarity on the topic
Type
Projects
Status
Done