Skip to content

Commit f310e19

Browse files
committed
revert : no more type issue
1 parent 73c8b89 commit f310e19

29 files changed

Lines changed: 283 additions & 411 deletions

src/opengeodeweb_back/geode_functions.py

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

88
# Local application imports
99
from .geode_objects import geode_objects
10-
from .geode_objects.types import GeodeObjectType, geode_object_type, cast_str
10+
from .geode_objects.types import GeodeObjectType, geode_object_type
1111
from .geode_objects.geode_object import GeodeObject
1212
from opengeodeweb_microservice.database.data import Data
1313

@@ -45,7 +45,7 @@ def get_data_info(data_id: str) -> Data:
4545
def upload_file_path(filename: str) -> str:
4646
upload_folder = flask.current_app.config["UPLOAD_FOLDER"]
4747
secure_filename = werkzeug.utils.secure_filename(filename)
48-
return cast_str(os.path.abspath(os.path.join(upload_folder, secure_filename)))
48+
return os.path.abspath(os.path.join(upload_folder, secure_filename))
4949

5050

5151
def geode_object_output_extensions(

src/opengeodeweb_back/geode_objects/geode_brep.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Standard library imports
22
from __future__ import annotations
3-
from typing import cast
43

54
# Third party imports
65
import opengeode as og
@@ -9,7 +8,7 @@
98
import geode_viewables as viewables
109

1110
# Local application imports
12-
from .types import GeodeModelType, cast_str, cast_list_str, cast_int, cast_bool
11+
from .types import GeodeModelType
1312
from .geode_model import GeodeModel, ComponentRegistry
1413

1514

@@ -25,7 +24,7 @@ def geode_object_type(cls) -> GeodeModelType:
2524
return "BRep"
2625

2726
def native_extension(self) -> str:
28-
return cast_str(self.brep.native_extension())
27+
return self.brep.native_extension()
2928

3029
@classmethod
3130
def is_3D(cls) -> bool:
@@ -52,34 +51,30 @@ def is_loadable(cls, filename: str) -> og.Percentage:
5251

5352
@classmethod
5453
def input_extensions(cls) -> list[str]:
55-
return cast_list_str(og.BRepInputFactory.list_creators())
54+
return og.BRepInputFactory.list_creators()
5655

5756
@classmethod
5857
def output_extensions(cls) -> list[str]:
59-
return cast_list_str(og.BRepOutputFactory.list_creators())
58+
return og.BRepOutputFactory.list_creators()
6059

6160
@classmethod
6261
def object_priority(cls, filename: str) -> int:
63-
return cast_int(og.brep_object_priority(filename))
62+
return og.brep_object_priority(filename)
6463

6564
def is_saveable(self, filename: str) -> bool:
66-
return cast_bool(og.is_brep_saveable(self.brep, filename))
65+
return og.is_brep_saveable(self.brep, filename)
6766

6867
def save(self, filename: str) -> list[str]:
69-
return cast_list_str(og.save_brep(self.brep, filename))
68+
return og.save_brep(self.brep, filename)
7069

7170
def save_viewable(self, filename_without_extension: str) -> str:
72-
return cast_str(
73-
viewables.save_viewable_brep(self.brep, filename_without_extension)
74-
)
71+
return viewables.save_viewable_brep(self.brep, filename_without_extension)
7572

7673
def save_light_viewable(self, filename_without_extension: str) -> str:
77-
return cast_str(
78-
viewables.save_light_viewable_brep(self.brep, filename_without_extension)
79-
)
74+
return viewables.save_light_viewable_brep(self.brep, filename_without_extension)
8075

8176
def mesh_components(self) -> ComponentRegistry:
82-
return cast(ComponentRegistry, self.brep.mesh_components())
77+
return self.brep.mesh_components()
8378

8479
def inspect(self) -> og_inspector.BRepInspectionResult:
8580
return og_inspector.inspect_brep(self.brep)

src/opengeodeweb_back/geode_objects/geode_cross_section.py

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import geode_viewables as viewables
88

99
# Local application imports
10-
from .types import GeodeModelType, cast_str, cast_list_str, cast_int, cast_bool
10+
from .types import GeodeModelType
1111
from .geode_section import GeodeSection
1212

1313

@@ -29,7 +29,7 @@ def geode_object_type(cls) -> GeodeModelType:
2929
return "CrossSection"
3030

3131
def native_extension(self) -> str:
32-
return cast_str(self.cross_section.native_extension())
32+
return self.cross_section.native_extension()
3333

3434
def builder(self) -> og_geosciences.CrossSectionBuilder:
3535
return og_geosciences.CrossSectionBuilder(self.cross_section)
@@ -48,36 +48,28 @@ def is_loadable(cls, filename: str) -> og.Percentage:
4848

4949
@classmethod
5050
def input_extensions(cls) -> list[str]:
51-
return cast_list_str(og_geosciences.CrossSectionInputFactory.list_creators())
51+
return og_geosciences.CrossSectionInputFactory.list_creators()
5252

5353
@classmethod
5454
def output_extensions(cls) -> list[str]:
55-
return cast_list_str(og_geosciences.CrossSectionOutputFactory.list_creators())
55+
return og_geosciences.CrossSectionOutputFactory.list_creators()
5656

5757
@classmethod
5858
def object_priority(cls, filename: str) -> int:
59-
return cast_int(og_geosciences.cross_section_object_priority(filename))
59+
return og_geosciences.cross_section_object_priority(filename)
6060

6161
def is_saveable(self, filename: str) -> bool:
62-
return cast_bool(
63-
og_geosciences.is_cross_section_saveable(self.cross_section, filename)
64-
)
62+
return og_geosciences.is_cross_section_saveable(self.cross_section, filename)
6563

6664
def save(self, filename: str) -> list[str]:
67-
return cast_list_str(
68-
og_geosciences.save_cross_section(self.cross_section, filename)
69-
)
65+
return og_geosciences.save_cross_section(self.cross_section, filename)
7066

7167
def save_viewable(self, filename_without_extension: str) -> str:
72-
return cast_str(
73-
viewables.save_viewable_cross_section(
74-
self.cross_section, filename_without_extension
75-
)
68+
return viewables.save_viewable_cross_section(
69+
self.cross_section, filename_without_extension
7670
)
7771

7872
def save_light_viewable(self, filename_without_extension: str) -> str:
79-
return cast_str(
80-
viewables.save_light_viewable_cross_section(
81-
self.cross_section, filename_without_extension
82-
)
73+
return viewables.save_light_viewable_cross_section(
74+
self.cross_section, filename_without_extension
8375
)

src/opengeodeweb_back/geode_objects/geode_edged_curve2d.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import geode_viewables as viewables
99

1010
# Local application imports
11-
from .types import GeodeMeshType, cast_str, cast_list_str, cast_int, cast_bool
11+
from .types import GeodeMeshType
1212
from .geode_graph import GeodeGraph
1313

1414

@@ -26,7 +26,7 @@ def geode_object_type(cls) -> GeodeMeshType:
2626
return "EdgedCurve2D"
2727

2828
def native_extension(self) -> str:
29-
return cast_str(self.edged_curve.native_extension())
29+
return self.edged_curve.native_extension()
3030

3131
@classmethod
3232
def is_3D(cls) -> bool:
@@ -53,34 +53,32 @@ def is_loadable(cls, filename: str) -> og.Percentage:
5353

5454
@classmethod
5555
def input_extensions(cls) -> list[str]:
56-
return cast_list_str(og.EdgedCurveInputFactory2D.list_creators())
56+
return og.EdgedCurveInputFactory2D.list_creators()
5757

5858
@classmethod
5959
def output_extensions(cls) -> list[str]:
60-
return cast_list_str(og.EdgedCurveOutputFactory2D.list_creators())
60+
return og.EdgedCurveOutputFactory2D.list_creators()
6161

6262
@classmethod
6363
def object_priority(cls, filename: str) -> int:
64-
return cast_int(og.edged_curve_object_priority2D(filename))
64+
return og.edged_curve_object_priority2D(filename)
6565

6666
def is_saveable(self, filename: str) -> bool:
67-
return cast_bool(og.is_edged_curve_saveable2D(self.edged_curve, filename))
67+
return og.is_edged_curve_saveable2D(self.edged_curve, filename)
6868

6969
def save(self, filename: str) -> list[str]:
70-
return cast_list_str(og.save_edged_curve2D(self.edged_curve, filename))
70+
return og.save_edged_curve2D(self.edged_curve, filename)
7171

7272
def save_viewable(self, filename_without_extension: str) -> str:
73-
return cast_str(
74-
viewables.save_viewable_edged_curve2D(
73+
return viewables.save_viewable_edged_curve2D(
7574
self.edged_curve, filename_without_extension
76-
),
75+
,
7776
)
7877

7978
def save_light_viewable(self, filename_without_extension: str) -> str:
80-
return cast_str(
81-
viewables.save_light_viewable_edged_curve2D(
79+
return viewables.save_light_viewable_edged_curve2D(
8280
self.edged_curve, filename_without_extension
83-
),
81+
,
8482
)
8583

8684
def inspect(self) -> og_inspector.EdgedCurveInspectionResult:

src/opengeodeweb_back/geode_objects/geode_edged_curve3d.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import geode_viewables as viewables
99

1010
# Local application imports
11-
from .types import GeodeMeshType, cast_str, cast_list_str, cast_int, cast_bool
11+
from .types import GeodeMeshType
1212
from .geode_graph import GeodeGraph
1313

1414

@@ -26,7 +26,7 @@ def geode_object_type(cls) -> GeodeMeshType:
2626
return "EdgedCurve3D"
2727

2828
def native_extension(self) -> str:
29-
return cast_str(self.edged_curve.native_extension())
29+
return self.edged_curve.native_extension()
3030

3131
@classmethod
3232
def is_3D(cls) -> bool:
@@ -53,34 +53,32 @@ def is_loadable(cls, filename: str) -> og.Percentage:
5353

5454
@classmethod
5555
def input_extensions(cls) -> list[str]:
56-
return cast_list_str(og.EdgedCurveInputFactory3D.list_creators())
56+
return og.EdgedCurveInputFactory3D.list_creators()
5757

5858
@classmethod
5959
def output_extensions(cls) -> list[str]:
60-
return cast_list_str(og.EdgedCurveOutputFactory3D.list_creators())
60+
return og.EdgedCurveOutputFactory3D.list_creators()
6161

6262
@classmethod
6363
def object_priority(cls, filename: str) -> int:
64-
return cast_int(og.edged_curve_object_priority3D(filename))
64+
return og.edged_curve_object_priority3D(filename)
6565

6666
def is_saveable(self, filename: str) -> bool:
67-
return cast_bool(og.is_edged_curve_saveable3D(self.edged_curve, filename))
67+
return og.is_edged_curve_saveable3D(self.edged_curve, filename)
6868

6969
def save(self, filename: str) -> list[str]:
70-
return cast_list_str(og.save_edged_curve3D(self.edged_curve, filename))
70+
return og.save_edged_curve3D(self.edged_curve, filename)
7171

7272
def save_viewable(self, filename_without_extension: str) -> str:
73-
return cast_str(
74-
viewables.save_viewable_edged_curve3D(
73+
return viewables.save_viewable_edged_curve3D(
7574
self.edged_curve, filename_without_extension
76-
),
75+
,
7776
)
7877

7978
def save_light_viewable(self, filename_without_extension: str) -> str:
80-
return cast_str(
81-
viewables.save_light_viewable_edged_curve3D(
79+
return viewables.save_light_viewable_edged_curve3D(
8280
self.edged_curve, filename_without_extension
83-
),
81+
,
8482
)
8583

8684
def inspect(self) -> og_inspector.EdgedCurveInspectionResult:

src/opengeodeweb_back/geode_objects/geode_graph.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import opengeode as og
66

77
# Local application imports
8-
from .types import GeodeMeshType, cast_str, cast_list_str, cast_int, cast_bool
8+
from .types import GeodeMeshType
99
from .geode_vertex_set import GeodeVertexSet
1010

1111

@@ -21,7 +21,7 @@ def geode_object_type(cls) -> GeodeMeshType:
2121
return "Graph"
2222

2323
def native_extension(self) -> str:
24-
return cast_str(self.graph.native_extension())
24+
return self.graph.native_extension()
2525

2626
@classmethod
2727
def is_3D(cls) -> bool:
@@ -48,21 +48,21 @@ def is_loadable(cls, filename: str) -> og.Percentage:
4848

4949
@classmethod
5050
def input_extensions(cls) -> list[str]:
51-
return cast_list_str(og.GraphInputFactory.list_creators())
51+
return og.GraphInputFactory.list_creators()
5252

5353
@classmethod
5454
def output_extensions(cls) -> list[str]:
55-
return cast_list_str(og.GraphOutputFactory.list_creators())
55+
return og.GraphOutputFactory.list_creators()
5656

5757
@classmethod
5858
def object_priority(cls, filename: str) -> int:
59-
return cast_int(og.graph_object_priority(filename))
59+
return og.graph_object_priority(filename)
6060

6161
def is_saveable(self, filename: str) -> bool:
62-
return cast_bool(og.is_graph_saveable(self.graph, filename))
62+
return og.is_graph_saveable(self.graph, filename)
6363

6464
def save(self, filename: str) -> list[str]:
65-
return cast_list_str(og.save_graph(self.graph, filename))
65+
return og.save_graph(self.graph, filename)
6666

6767
def save_viewable(self, filename_without_extension: str) -> str:
6868
return ""

src/opengeodeweb_back/geode_objects/geode_hybrid_solid3d.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import geode_viewables as viewables
77

88
# Local application imports
9-
from .types import GeodeMeshType, cast_str, cast_list_str, cast_int, cast_bool
9+
from .types import GeodeMeshType
1010
from .geode_solid_mesh3d import GeodeSolidMesh3D
1111

1212

@@ -24,7 +24,7 @@ def geode_object_type(cls) -> GeodeMeshType:
2424
return "HybridSolid3D"
2525

2626
def native_extension(self) -> str:
27-
return cast_str(self.hybrid_solid.native_extension())
27+
return self.hybrid_solid.native_extension()
2828

2929
def builder(self) -> og.HybridSolidBuilder3D:
3030
return og.HybridSolidBuilder3D.create(self.hybrid_solid)
@@ -43,32 +43,30 @@ def is_loadable(cls, filename: str) -> og.Percentage:
4343

4444
@classmethod
4545
def input_extensions(cls) -> list[str]:
46-
return cast_list_str(og.HybridSolidInputFactory3D.list_creators())
46+
return og.HybridSolidInputFactory3D.list_creators()
4747

4848
@classmethod
4949
def output_extensions(cls) -> list[str]:
50-
return cast_list_str(og.HybridSolidOutputFactory3D.list_creators())
50+
return og.HybridSolidOutputFactory3D.list_creators()
5151

5252
@classmethod
5353
def object_priority(cls, filename: str) -> int:
54-
return cast_int(og.hybrid_solid_object_priority3D(filename))
54+
return og.hybrid_solid_object_priority3D(filename)
5555

5656
def is_saveable(self, filename: str) -> bool:
57-
return cast_bool(og.is_hybrid_solid_saveable3D(self.hybrid_solid, filename))
57+
return og.is_hybrid_solid_saveable3D(self.hybrid_solid, filename)
5858

5959
def save(self, filename: str) -> list[str]:
60-
return cast_list_str(og.save_hybrid_solid3D(self.hybrid_solid, filename))
60+
return og.save_hybrid_solid3D(self.hybrid_solid, filename)
6161

6262
def save_viewable(self, filename_without_extension: str) -> str:
63-
return cast_str(
64-
viewables.save_viewable_hybrid_solid3D(
63+
return viewables.save_viewable_hybrid_solid3D(
6564
self.hybrid_solid, filename_without_extension
66-
),
65+
,
6766
)
6867

6968
def save_light_viewable(self, filename_without_extension: str) -> str:
70-
return cast_str(
71-
viewables.save_light_viewable_hybrid_solid3D(
69+
return viewables.save_light_viewable_hybrid_solid3D(
7270
self.hybrid_solid, filename_without_extension
73-
),
71+
,
7472
)

0 commit comments

Comments
 (0)