Skip to content

Commit

Permalink
Improve todo's and remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rosinaderks committed Oct 10, 2023
1 parent 25501b3 commit d6bf041
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/edr_pydantic/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class Collection(EDRBaseModel):
links: List[Link]
extent: Extent
data_queries: Optional[DataQueries] = None
# TODO According to req A.13 it should be CRSDetails object
# TODO According to req A.13 it shall be CRSDetails object, according to C.1 it is a string array
crs: Optional[List[str]] = None
output_formats: Optional[List[str]] = None
parameter_names: Dict[str, Parameter]
# TODO According to req A.13 MAY have distanceunits. If radius is in link, it SHALL have distanceunits
# TODO According to req A.13 may have distanceunits. If radius is in link, it shall have distanceunits
distanceunits: Optional[List[str]] = None


Expand Down
7 changes: 1 addition & 6 deletions src/edr_pydantic/data_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ class DataQueries(EDRBaseModel):
cube: Optional[EDRQuery] = None
trajectory: Optional[EDRQuery] = None
corridor: Optional[EDRQuery] = None
# TODO Difference object/req: item, location?
locations: Optional[EDRQuery] = None
items: Optional[EDRQuery] = None
# TODO ticket maken en maken voor separation
instances: Optional[EDRQuery] = None


class CollectionDataQueries(DataQueries):
# TODO Separate Instance and Collection objects
instances: Optional[EDRQuery] = None
2 changes: 0 additions & 2 deletions src/edr_pydantic/extent.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ class Spatial(EDRBaseModel):


class Temporal(EDRBaseModel):
# TODO Check: Array of ISO 8601 Data Array
interval: List[List[AwareDatetime]]
# TODO Check: ISO 8601 Data Array
values: List[str]
trs: str

Expand Down
1 change: 0 additions & 1 deletion src/edr_pydantic/reference_system.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from .my_base_model import EDRBaseModel


# TODO req A.24 vs object CRSDetails
class CRS(EDRBaseModel):
name: str # MAY EPSG code
wkt: str # SHALL Well Known Text
7 changes: 0 additions & 7 deletions tests/test_edr.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ def test_happy_cases(file_name, object_type):
data = json.load(f)
json_string = json.dumps(data, separators=(",", ":"), ensure_ascii=False)

# # Writing to sample.json
# with open("sample1.json", "w") as outfile:
# outfile.write(json_string)
# # Writing to sample.json
# with open("sample2.json", "w") as outfile:
# outfile.write(object_type.model_validate_json(json_string).model_dump_json(exclude_none=True))

# Round-trip
assert object_type.model_validate_json(json_string).model_dump_json(exclude_none=True) == json_string

Expand Down

0 comments on commit d6bf041

Please sign in to comment.