Skip to content

Commit c222086

Browse files
Merge pull request #40 from casework/add_type_annotations
Add type annotations
2 parents 9424c02 + 7a983e0 commit c222086

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

case_mapping/directory.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
from .base import FacetEntity
12
from .case import *
23
from .uco import *
34

4-
submodules = [v for k, v in globals().items() if k[:2] != "__"]
5+
submodules = [v for k, v in globals().items() if k[:2] != "__" and k != "FacetEntity"]
56

6-
directory = dict()
7+
directory: dict[str, type[FacetEntity]] = dict()
78
for submodule in submodules:
89
directory |= submodule.directory

example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import cdo_local_uuid
44

5-
from case_mapping import case, uco
5+
from case_mapping import base, case, uco
66

77
# This is part of enabling non-random UUIDs for the demonstration
88
# output. The other part is handled at call time, and can be seen in
@@ -28,7 +28,7 @@ def _next_timestamp() -> datetime:
2828

2929
# Generate a case bundle and list to hold investigation items
3030
bundle = uco.core.Bundle(description="An Example Case File")
31-
investigation_items = []
31+
investigation_items: list[base.FacetEntity] = []
3232

3333
###################################
3434
# An item to be added to the case #

0 commit comments

Comments
 (0)