Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
KDP-1528 initial implementation of the EDR spec
Browse files Browse the repository at this point in the history
  • Loading branch information
rosina-derks committed Oct 5, 2023
1 parent 4071bde commit 1850ca0
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 107 deletions.
43 changes: 43 additions & 0 deletions src/edr_pydantic_classes/collections.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from __future__ import annotations

from typing import List
from typing import Optional

from .data_queries import DataQueries
from .extent import Extent
from .link import Link
from .my_base_model import EDRBaseModel
from .parameter import ParameterNames


# TODO instances or collections as base?
class Collection(EDRBaseModel):
links: List[Link]
id: str
extent: Extent
parameter_names: ParameterNames
title: Optional[str] = None
description: Optional[str] = None
keywords: Optional[List[str]] = None
data_queries: Optional[DataQueries] = None
# TODO required according to A.13, string array or crs object?
crs: Optional[List[str]] = None
# TODO in req as f?
output_formats: Optional[List[str]] = None
# TODO may have distanceunits, if radius is in link, it shall have distanceunits
distanceunits: Optional[List[str]] = None


class CollectionsModel(EDRBaseModel):
links: List[Link]
collections: List[Collection]


class InstancesModel(EDRBaseModel):
links: List[Link]
instances: List[Instance]


# For now, the instance metadata corresponds to the first collection metadata. So they have equal classes
class Instance(Collection):
pass
107 changes: 0 additions & 107 deletions src/edr_pydantic_classes/instances.py

This file was deleted.

0 comments on commit 1850ca0

Please sign in to comment.