1
- from enum import Enum , auto
1
+ from enum import Enum
2
2
from pathlib import Path
3
3
from typing import Union , List , Optional
4
4
from dataclasses import dataclass
10
10
class GeometryType (Enum ):
11
11
"""Geometry type (gtype) of data"""
12
12
13
- POINT = auto ()
14
- TRACK = auto ()
15
- UNSTRUCTURED = auto ()
16
- GRID = auto ()
13
+ POINT = "point"
14
+ TRACK = "track"
15
+ UNSTRUCTURED = "unstructured"
16
+ GRID = "grid"
17
17
18
18
def __str__ (self ) -> str :
19
19
return self .name .lower ()
@@ -24,18 +24,19 @@ def from_string(s: str) -> "GeometryType":
24
24
25
25
Examples
26
26
--------
27
+ >>> from modelskill.types import GeometryType
27
28
>>> GeometryType.from_string("point")
28
- <GeometryType.POINT: 1 >
29
+ <GeometryType.POINT: 'point' >
29
30
>>> GeometryType.from_string("track")
30
- <GeometryType.TRACK: 2 >
31
+ <GeometryType.TRACK: 'track' >
31
32
>>> GeometryType.from_string("unstructured")
32
- <GeometryType.UNSTRUCTURED: 3 >
33
+ <GeometryType.UNSTRUCTURED: 'unstructured' >
33
34
>>> GeometryType.from_string("flexible mesh")
34
- <GeometryType.UNSTRUCTURED: 3 >
35
+ <GeometryType.UNSTRUCTURED: 'unstructured' >
35
36
>>> GeometryType.from_string("dfsu")
36
- <GeometryType.UNSTRUCTURED: 3 >
37
+ <GeometryType.UNSTRUCTURED: 'unstructured' >
37
38
>>> GeometryType.from_string("grid")
38
- <GeometryType.GRID: 4 >
39
+ <GeometryType.GRID: 'grid' >
39
40
"""
40
41
41
42
try :
0 commit comments