Skip to content

Commit 555fdaa

Browse files
committed
Fix comments that I think we are agreed on.
1 parent 60bd808 commit 555fdaa

File tree

6 files changed

+17
-12
lines changed

6 files changed

+17
-12
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ classifiers = [
2121
"Typing :: Typed",
2222
]
2323
version = "0.5.0"
24-
dependencies = ["pydantic>=2.3,<3"]
24+
dependencies = ["pydantic>=2.3,<3", "typing-extensions>=4.12.2"]
2525

2626
[project.optional-dependencies]
2727
test = ["pytest", "pytest-cov"]

src/edr_pydantic/extent.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ class Spatial(EdrBaseModel):
1414
crs: str
1515

1616

17-
IntervalLen = Len(min_length=2, max_length=2)
18-
19-
2017
class Temporal(EdrBaseModel):
21-
interval: List[Annotated[List[AwareDatetime], IntervalLen]]
18+
interval: List[Annotated[List[AwareDatetime], Len(min_length=2, max_length=2)]]
2219
# TODO: Validate this is a list of ISO 8601 single time, ISO 8601 time duration or ISO 8601 interval
2320
values: List[str]
2421
trs: str
File renamed without changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"interval": [
3+
[
4+
"2020-04-19T11:00:00Z",
5+
"2020-04-19T12:00:00Z",
6+
"2020-04-19T13:00:00Z"
7+
]
8+
],
9+
"values": [
10+
"2020-04-19T11:00:00Z/2020-06-30T09:00:00Z"
11+
],
12+
"trs": "TIMECRS[\"DateTime\",TDATUM[\"Gregorian Calendar\"],CS[TemporalDateTime,1],AXIS[\"Time (T)\",future]]"
13+
}

tests/test_edr.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def test_happy_cases(file_name, object_type):
3838

3939
error_cases = [
4040
("label-or-symbol-unit.json", Unit, r"Either 'label' or 'symbol' should be set"),
41-
("temporal-interval.json", Temporal, r"List should have at least 2 items after validation"),
41+
("temporal-interval-length1.json", Temporal, r"List should have at least 2 items after validation"),
42+
("temporal-interval-length3.json", Temporal, r"List should have at most 2 items after validation, not 3"),
4243
]
4344

4445

tests/test_extent.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)