@@ -23,48 +23,48 @@ class Orientation(TypedDict):
23
23
nugget : float
24
24
polarity : int # 1 for normal, -1 for reverse
25
25
26
- class Surface (TypedDict ):
27
- name : str
28
- id : int
29
- color : Optional [str ] # Hex color code
30
- vertices : Optional [List [List [float ]]] # List of [x, y, z] coordinates
26
+ class Surface (TypedDict , total = False ):
27
+ name : str # Required
28
+ id : NotRequired [ int ] # Optional, will be auto-generated if not provided
29
+ color : NotRequired [ Optional [str ]] # Optional hex color code
30
+ vertices : NotRequired [ Optional [List [List [float ]]]] # Optional list of [x, y, z] coordinates
31
31
32
- class Fault (TypedDict ):
33
- name : str
34
- id : int
35
- is_active : bool
32
+ class Fault (TypedDict , total = False ):
33
+ name : str # Required
34
+ id : NotRequired [ int ] # Optional, will be auto-generated
35
+ is_active : NotRequired [ bool ] # Optional, defaults to True
36
36
surface : Surface
37
37
38
38
class Series (TypedDict , total = False ):
39
39
name : str # Required
40
- id : int
41
- is_active : bool
42
- is_fault : bool
43
- order_series : int
44
- surfaces : List [ str ] # Required, list of surface names
45
- faults : List [Fault ]
40
+ surfaces : Union [ List [ str ], List [ Surface ]] # Required, can be list of names or Surface objects
41
+ id : NotRequired [ int ] # Optional, will be auto-generated
42
+ is_active : NotRequired [ bool ] # Optional, defaults to True
43
+ is_fault : NotRequired [ bool ] # Optional, defaults to False
44
+ order_series : NotRequired [ int ] # Optional, will be auto-generated
45
+ faults : NotRequired [ List [Fault ]] # Optional, defaults to empty list
46
46
structural_relation : NotRequired [str ] # Optional, defaults to "ONLAP"
47
- colors : NotRequired [Optional [List [str ]]] # Optional list of hex color codes
47
+ colors : NotRequired [Optional [List [str ]]] # Optional
48
48
49
- class GridSettings (TypedDict ):
50
- regular_grid_resolution : List [int ]
51
- regular_grid_extent : List [float ]
52
- octree_levels : Optional [int ]
49
+ class GridSettings (TypedDict , total = False ):
50
+ regular_grid_resolution : NotRequired [ List [int ]] # Optional, defaults to [10, 10, 10 ]
51
+ regular_grid_extent : NotRequired [ List [float ]] # Optional, auto-calculated from data
52
+ octree_levels : NotRequired [ Optional [int ]] # Optional
53
53
54
- class ModelMetadata (TypedDict ):
55
- name : str
56
- creation_date : str
57
- last_modification_date : str
58
- owner : Optional [str ]
54
+ class ModelMetadata (TypedDict , total = False ):
55
+ name : NotRequired [ str ] # Optional, defaults to "GemPy Model"
56
+ creation_date : NotRequired [ str ] # Optional, defaults to current date
57
+ last_modification_date : NotRequired [ str ] # Optional, defaults to current date
58
+ owner : NotRequired [ Optional [str ]] # Optional, defaults to "GemPy Team"
59
59
60
- class IdNameMapping (TypedDict ):
61
- name_to_id : Dict [str , int ]
60
+ class IdNameMapping (TypedDict , total = False ):
61
+ name_to_id : Dict [str , int ] # Required if id_name_mapping is provided
62
62
63
- class GemPyModelJson (TypedDict , total = False ):
64
- metadata : ModelMetadata
65
- surface_points : List [SurfacePoint ]
66
- orientations : List [Orientation ]
67
- series : List [ Series ]
68
- grid_settings : Optional [GridSettings ]
69
- interpolation_options : Optional [Dict [str , Any ]]
70
- id_name_mapping : IdNameMapping
63
+ class GemPyModelJson (TypedDict ):
64
+ surface_points : List [ SurfacePoint ] # Required
65
+ orientations : List [Orientation ] # Required
66
+ series : List [Series ] # Required but with minimal required fields
67
+ metadata : NotRequired [ ModelMetadata ] # Optional
68
+ grid_settings : NotRequired [ Optional [GridSettings ]] # Optional
69
+ interpolation_options : NotRequired [ Optional [Dict [str , Any ]]] # Optional
70
+ id_name_mapping : NotRequired [ IdNameMapping ] # Optional
0 commit comments