luminarycloud 0.22.1__py3-none-any.whl → 0.22.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. luminarycloud/_client/client.py +5 -3
  2. luminarycloud/_helpers/__init__.py +9 -0
  3. luminarycloud/_helpers/_inference_jobs.py +227 -0
  4. luminarycloud/_helpers/_parse_iso_datetime.py +54 -0
  5. luminarycloud/_helpers/proto_decorator.py +38 -7
  6. luminarycloud/_proto/api/v0/luminarycloud/geometry/geometry_pb2.py +45 -25
  7. luminarycloud/_proto/api/v0/luminarycloud/geometry/geometry_pb2.pyi +30 -0
  8. luminarycloud/_proto/api/v0/luminarycloud/geometry/geometry_pb2_grpc.py +34 -0
  9. luminarycloud/_proto/api/v0/luminarycloud/geometry/geometry_pb2_grpc.pyi +12 -0
  10. luminarycloud/_proto/api/v0/luminarycloud/physics_ai/physics_ai_pb2.py +118 -45
  11. luminarycloud/_proto/api/v0/luminarycloud/physics_ai/physics_ai_pb2.pyi +246 -2
  12. luminarycloud/_proto/api/v0/luminarycloud/physics_ai/physics_ai_pb2_grpc.py +34 -0
  13. luminarycloud/_proto/api/v0/luminarycloud/physics_ai/physics_ai_pb2_grpc.pyi +12 -0
  14. luminarycloud/_proto/api/v0/luminarycloud/physicsaiinference/physicsaiinference_pb2.py +93 -33
  15. luminarycloud/_proto/api/v0/luminarycloud/physicsaiinference/physicsaiinference_pb2.pyi +105 -0
  16. luminarycloud/_proto/api/v0/luminarycloud/physicsaiinference/physicsaiinference_pb2_grpc.py +70 -0
  17. luminarycloud/_proto/api/v0/luminarycloud/physicsaiinference/physicsaiinference_pb2_grpc.pyi +29 -0
  18. luminarycloud/_proto/api/v0/luminarycloud/simulation/simulation_pb2.py +29 -7
  19. luminarycloud/_proto/api/v0/luminarycloud/simulation/simulation_pb2.pyi +39 -0
  20. luminarycloud/_proto/api/v0/luminarycloud/simulation/simulation_pb2_grpc.py +36 -0
  21. luminarycloud/_proto/api/v0/luminarycloud/simulation/simulation_pb2_grpc.pyi +18 -0
  22. luminarycloud/_proto/api/v0/luminarycloud/thirdpartyintegration/onshape/onshape_pb2.py +70 -70
  23. luminarycloud/_proto/api/v0/luminarycloud/thirdpartyintegration/onshape/onshape_pb2.pyi +5 -5
  24. luminarycloud/_proto/api/v0/luminarycloud/vis/vis_pb2.py +163 -153
  25. luminarycloud/_proto/api/v0/luminarycloud/vis/vis_pb2.pyi +37 -3
  26. luminarycloud/_proto/client/simulation_pb2.py +356 -337
  27. luminarycloud/_proto/client/simulation_pb2.pyi +89 -3
  28. luminarycloud/_proto/physicsaiinferenceservice/physicsaiinferenceservice_pb2.py +9 -4
  29. luminarycloud/_proto/physicsaitrainingservice/physicsaitrainingservice_pb2.py +6 -3
  30. luminarycloud/_proto/physicsaitrainingservice/physicsaitrainingservice_pb2_grpc.py +34 -0
  31. luminarycloud/_proto/physicsaitrainingservice/physicsaitrainingservice_pb2_grpc.pyi +12 -0
  32. luminarycloud/_wrapper.py +53 -7
  33. luminarycloud/feature_modification.py +25 -32
  34. luminarycloud/geometry.py +6 -6
  35. luminarycloud/outputs/__init__.py +2 -0
  36. luminarycloud/outputs/output_definitions.py +3 -3
  37. luminarycloud/outputs/stopping_conditions.py +94 -0
  38. luminarycloud/params/enum/_enum_wrappers.py +16 -0
  39. luminarycloud/params/geometry/shapes.py +33 -33
  40. luminarycloud/params/simulation/adaptive_mesh_refinement/__init__.py +1 -0
  41. luminarycloud/params/simulation/adaptive_mesh_refinement/active_region_.py +83 -0
  42. luminarycloud/params/simulation/adaptive_mesh_refinement/boundary_layer_profile_.py +1 -1
  43. luminarycloud/params/simulation/adaptive_mesh_refinement_.py +8 -1
  44. luminarycloud/physics_ai/__init__.py +7 -0
  45. luminarycloud/physics_ai/inference.py +166 -199
  46. luminarycloud/physics_ai/models.py +22 -0
  47. luminarycloud/pipelines/api.py +45 -9
  48. luminarycloud/project.py +56 -2
  49. luminarycloud/simulation.py +25 -0
  50. luminarycloud/types/__init__.py +2 -0
  51. luminarycloud/types/ids.py +2 -0
  52. luminarycloud/vis/__init__.py +1 -0
  53. luminarycloud/vis/filters.py +97 -0
  54. luminarycloud/vis/visualization.py +3 -0
  55. luminarycloud/volume_selection.py +6 -6
  56. luminarycloud/workflow_utils.py +149 -0
  57. {luminarycloud-0.22.1.dist-info → luminarycloud-0.22.2.dist-info}/METADATA +1 -1
  58. {luminarycloud-0.22.1.dist-info → luminarycloud-0.22.2.dist-info}/RECORD +59 -60
  59. luminarycloud/_proto/api/v0/luminarycloud/inference/inference_pb2.py +0 -61
  60. luminarycloud/_proto/api/v0/luminarycloud/inference/inference_pb2.pyi +0 -85
  61. luminarycloud/_proto/api/v0/luminarycloud/inference/inference_pb2_grpc.py +0 -67
  62. luminarycloud/_proto/api/v0/luminarycloud/inference/inference_pb2_grpc.pyi +0 -26
  63. luminarycloud/_proto/inferenceservice/inferenceservice_pb2.py +0 -69
  64. {luminarycloud-0.22.1.dist-info → luminarycloud-0.22.2.dist-info}/WHEEL +0 -0
@@ -747,6 +747,14 @@ class PtTableFluid(_IntEnum):
747
747
  R410A.
748
748
  REAL_GAS_R507A
749
749
  R507A.
750
+ REAL_GAS_R513A
751
+ R513A.
752
+ REAL_GAS_R513B
753
+ R513B.
754
+ REAL_GAS_R515A
755
+ R515A.
756
+ REAL_GAS_R515B
757
+ R515B.
750
758
  REAL_GAS_RC318
751
759
  RC318.
752
760
  REAL_GAS_SES36
@@ -883,6 +891,10 @@ class PtTableFluid(_IntEnum):
883
891
  >>> PtTableFluid.REAL_GAS_R41
884
892
  >>> PtTableFluid.REAL_GAS_R410A
885
893
  >>> PtTableFluid.REAL_GAS_R507A
894
+ >>> PtTableFluid.REAL_GAS_R513A
895
+ >>> PtTableFluid.REAL_GAS_R513B
896
+ >>> PtTableFluid.REAL_GAS_R515A
897
+ >>> PtTableFluid.REAL_GAS_R515B
886
898
  >>> PtTableFluid.REAL_GAS_RC318
887
899
  >>> PtTableFluid.REAL_GAS_SES36
888
900
  >>> PtTableFluid.REAL_GAS_SULFUR_DIOXIDE
@@ -1009,6 +1021,10 @@ class PtTableFluid(_IntEnum):
1009
1021
  REAL_GAS_R41 = _clientpb.REAL_GAS_R41
1010
1022
  REAL_GAS_R410A = _clientpb.REAL_GAS_R410A
1011
1023
  REAL_GAS_R507A = _clientpb.REAL_GAS_R507A
1024
+ REAL_GAS_R513A = _clientpb.REAL_GAS_R513A
1025
+ REAL_GAS_R513B = _clientpb.REAL_GAS_R513B
1026
+ REAL_GAS_R515A = _clientpb.REAL_GAS_R515A
1027
+ REAL_GAS_R515B = _clientpb.REAL_GAS_R515B
1012
1028
  REAL_GAS_RC318 = _clientpb.REAL_GAS_RC318
1013
1029
  REAL_GAS_SES36 = _clientpb.REAL_GAS_SES36
1014
1030
  REAL_GAS_SULFUR_DIOXIDE = _clientpb.REAL_GAS_SULFUR_DIOXIDE
@@ -1,84 +1,84 @@
1
1
  # Copyright 2024 Luminary Cloud, Inc. All Rights Reserved.
2
- from dataclasses import dataclass
2
+ from dataclasses import dataclass, field
3
3
 
4
- from luminarycloud.types import Vector3
5
- from luminarycloud._helpers.proto_decorator import proto_decorator
4
+ from luminarycloud._helpers.proto_decorator import ProtoConvertible, proto_decorator
6
5
  from luminarycloud._proto.cad import shape_pb2 as shapepb
6
+ from luminarycloud.types import Vector3
7
7
 
8
8
 
9
- class Shape:
9
+ class Shape(ProtoConvertible):
10
10
  pass
11
11
 
12
12
 
13
13
  @dataclass(kw_only=True)
14
14
  @proto_decorator(shapepb.Sphere)
15
15
  class Sphere(Shape):
16
- center: Vector3
17
- radius: float
16
+ center: Vector3 = field(default_factory=Vector3)
17
+ radius: float = 0.0
18
18
 
19
19
 
20
20
  @dataclass(kw_only=True)
21
21
  @proto_decorator(shapepb.SphereShell)
22
22
  class SphereShell(Shape):
23
- center: Vector3
24
- radius: float
25
- radius_inner: float
23
+ center: Vector3 = field(default_factory=Vector3)
24
+ radius: float = 0.0
25
+ radius_inner: float = 0.0
26
26
 
27
27
 
28
28
  @dataclass(kw_only=True)
29
29
  @proto_decorator(shapepb.HalfSphere)
30
30
  class HalfSphere(Shape):
31
- center: Vector3
32
- radius: float
33
- normal: Vector3
31
+ center: Vector3 = field(default_factory=Vector3)
32
+ radius: float = 0.0
33
+ normal: Vector3 = field(default_factory=Vector3)
34
34
 
35
35
 
36
36
  @dataclass(kw_only=True)
37
37
  @proto_decorator(shapepb.Cube)
38
38
  class Cube(Shape):
39
- min: Vector3
40
- max: Vector3
39
+ min: Vector3 = field(default_factory=Vector3)
40
+ max: Vector3 = field(default_factory=Vector3)
41
41
 
42
42
 
43
43
  @dataclass(kw_only=True)
44
44
  @proto_decorator(shapepb.OrientedCube)
45
45
  class OrientedCube(Shape):
46
- min: Vector3
47
- max: Vector3
48
- origin: Vector3
49
- x_axis: Vector3
50
- y_axis: Vector3
46
+ min: Vector3 = field(default_factory=Vector3)
47
+ max: Vector3 = field(default_factory=Vector3)
48
+ origin: Vector3 = field(default_factory=Vector3)
49
+ x_axis: Vector3 = field(default_factory=Vector3)
50
+ y_axis: Vector3 = field(default_factory=Vector3)
51
51
 
52
52
 
53
53
  @dataclass(kw_only=True)
54
54
  @proto_decorator(shapepb.Cylinder)
55
55
  class Cylinder(Shape):
56
- start: Vector3
57
- end: Vector3
58
- radius: float
56
+ start: Vector3 = field(default_factory=Vector3)
57
+ end: Vector3 = field(default_factory=Vector3)
58
+ radius: float = 0.0
59
59
 
60
60
 
61
61
  @dataclass(kw_only=True)
62
62
  @proto_decorator(shapepb.AnnularCylinder)
63
63
  class AnnularCylinder(Shape):
64
- start: Vector3
65
- end: Vector3
66
- radius: float
67
- radius_inner: float
64
+ start: Vector3 = field(default_factory=Vector3)
65
+ end: Vector3 = field(default_factory=Vector3)
66
+ radius: float = 0.0
67
+ radius_inner: float = 0.0
68
68
 
69
69
 
70
70
  @dataclass(kw_only=True)
71
71
  @proto_decorator(shapepb.Torus)
72
72
  class Torus(Shape):
73
- center: Vector3
74
- normal: Vector3
75
- major_radius: float
76
- minor_radius: float
73
+ center: Vector3 = field(default_factory=Vector3)
74
+ normal: Vector3 = field(default_factory=Vector3)
75
+ major_radius: float = 0.0
76
+ minor_radius: float = 0.0
77
77
 
78
78
 
79
79
  @dataclass(kw_only=True)
80
80
  @proto_decorator(shapepb.Cone)
81
81
  class Cone(Shape):
82
- apex: Vector3
83
- base_center: Vector3
84
- base_radius: float
82
+ apex: Vector3 = field(default_factory=Vector3)
83
+ base_center: Vector3 = field(default_factory=Vector3)
84
+ base_radius: float = 0.0
@@ -1 +1,2 @@
1
+ from .active_region_ import ActiveRegion
1
2
  from .boundary_layer_profile_ import BoundaryLayerProfile
@@ -0,0 +1,83 @@
1
+ # Generated by generate_sdk_wrappers.py. DO NOT EDIT
2
+
3
+ from abc import ABC, ABCMeta
4
+ from dataclasses import dataclass, field
5
+ from typing import Any
6
+ from uuid import uuid4
7
+
8
+ from google.protobuf.message import Message as _Message
9
+ from luminarycloud.tables import RectilinearTable, _param_name_to_table_type
10
+ from luminarycloud.types import Vector3, LcFloat
11
+ from luminarycloud.types.adfloat import _to_ad_proto, _from_ad_proto
12
+ from luminarycloud._helpers._entity_identifier import _create_entity_identifier
13
+ from luminarycloud._proto.client import simulation_pb2 as clientpb
14
+ from luminarycloud._proto.client.entity_pb2 import EntityIdentifier
15
+ from luminarycloud._helpers import CodeRepr
16
+ import luminarycloud.params.enum._enum_wrappers as enum
17
+
18
+ from luminarycloud.params.simulation._lib import ParamGroupWrapper, create_unique_id
19
+
20
+ from luminarycloud.params.geometry import shapes
21
+
22
+
23
+ @dataclass(kw_only=True)
24
+ class ActiveRegion(CodeRepr, ParamGroupWrapper[clientpb.ActiveRegion]):
25
+ """Region(s) within which the mesh is adapted at full resolution. Outside of these regions the mesh is coarsened with increasing distance from the region."""
26
+
27
+ error_weight: LcFloat = 1.0
28
+ "Error weighting from the active region at Max Distance. Local error weighting is 1.0 inside the region and decreases to Error Weight at the Max Distance."
29
+ max_distance: LcFloat = 0.0
30
+ "Distance from the active regions at which to apply the full error factor."
31
+ cube: shapes.Cube | None = None
32
+ "Coordinate-aligned box."
33
+ oriented_cube: shapes.OrientedCube | None = None
34
+ "Box oriented along arbitrary axes."
35
+ cylinder: shapes.Cylinder | None = None
36
+ "Cylinder shape."
37
+ annular_cylinder: shapes.AnnularCylinder | None = None
38
+ "Cylinder with a hole along the axis."
39
+ sphere: shapes.Sphere | None = None
40
+ "Sphere shape."
41
+ sphere_shell: shapes.SphereShell | None = None
42
+ "Spherical shell shape."
43
+
44
+ def _to_proto(self) -> clientpb.ActiveRegion:
45
+ _proto = clientpb.ActiveRegion()
46
+ _proto.error_weight.CopyFrom(_to_ad_proto(self.error_weight))
47
+ _proto.max_distance.CopyFrom(_to_ad_proto(self.max_distance))
48
+ if self.cube is not None:
49
+ _proto.cube.CopyFrom(self.cube._to_proto())
50
+ if self.oriented_cube is not None:
51
+ _proto.oriented_cube.CopyFrom(self.oriented_cube._to_proto())
52
+ if self.cylinder is not None:
53
+ _proto.cylinder.CopyFrom(self.cylinder._to_proto())
54
+ if self.annular_cylinder is not None:
55
+ _proto.annular_cylinder.CopyFrom(self.annular_cylinder._to_proto())
56
+ if self.sphere is not None:
57
+ _proto.sphere.CopyFrom(self.sphere._to_proto())
58
+ if self.sphere_shell is not None:
59
+ _proto.sphere_shell.CopyFrom(self.sphere_shell._to_proto())
60
+ return _proto
61
+
62
+ def _from_proto(self, proto: clientpb.ActiveRegion) -> None:
63
+ self.error_weight = _from_ad_proto(proto.error_weight)
64
+ self.max_distance = _from_ad_proto(proto.max_distance)
65
+ if proto.cube.ByteSize() > 0:
66
+ self.cube = shapes.Cube()
67
+ self.cube._from_proto(proto.cube)
68
+ if proto.oriented_cube.ByteSize() > 0:
69
+ self.oriented_cube = shapes.OrientedCube()
70
+ self.oriented_cube._from_proto(proto.oriented_cube)
71
+ if proto.cylinder.ByteSize() > 0:
72
+ self.cylinder = shapes.Cylinder()
73
+ self.cylinder._from_proto(proto.cylinder)
74
+ if proto.annular_cylinder.ByteSize() > 0:
75
+ self.annular_cylinder = shapes.AnnularCylinder()
76
+ self.annular_cylinder._from_proto(proto.annular_cylinder)
77
+ if proto.sphere.ByteSize() > 0:
78
+ self.sphere = shapes.Sphere()
79
+ self.sphere._from_proto(proto.sphere)
80
+ if proto.sphere_shell.ByteSize() > 0:
81
+ self.sphere_shell = shapes.SphereShell()
82
+ self.sphere_shell._from_proto(proto.sphere_shell)
83
+ return None
@@ -20,7 +20,7 @@ from luminarycloud.params.simulation._lib import ParamGroupWrapper, create_uniqu
20
20
 
21
21
  @dataclass(kw_only=True)
22
22
  class BoundaryLayerProfile(CodeRepr, ParamGroupWrapper[clientpb.BoundaryLayerProfile]):
23
- """"""
23
+ """Boundary layer meshing parameters to apply to adapted meshes."""
24
24
 
25
25
  n_layers: int = 40
26
26
  "Maximum number of prism layers within a boundary layer mesh."
@@ -17,6 +17,8 @@ import luminarycloud.params.enum._enum_wrappers as enum
17
17
 
18
18
  from luminarycloud.params.simulation._lib import ParamGroupWrapper, create_unique_id
19
19
 
20
+ from luminarycloud.params.simulation.adaptive_mesh_refinement.active_region_ import ActiveRegion
21
+ from luminarycloud.params.simulation.adaptive_mesh_refinement.active_region_ import *
20
22
  from luminarycloud.params.simulation.adaptive_mesh_refinement.boundary_layer_profile_ import (
21
23
  BoundaryLayerProfile,
22
24
  )
@@ -46,7 +48,9 @@ class AdaptiveMeshRefinement(CodeRepr, ParamGroupWrapper[clientpb.AdaptiveMeshRe
46
48
  user_scaling: LcFloat = 1.0
47
49
  "Scale factor between the geometry and the mesh."
48
50
  boundary_layer_profile: list[BoundaryLayerProfile] = field(default_factory=list)
49
- ""
51
+ "Boundary layer meshing parameters to apply to adapted meshes."
52
+ active_region: list[ActiveRegion] = field(default_factory=list)
53
+ "Region(s) within which the mesh is adapted at full resolution. Outside of these regions the mesh is coarsened with increasing distance from the region."
50
54
 
51
55
  def _to_proto(self) -> clientpb.AdaptiveMeshRefinement:
52
56
  _proto = clientpb.AdaptiveMeshRefinement()
@@ -61,6 +65,8 @@ class AdaptiveMeshRefinement(CodeRepr, ParamGroupWrapper[clientpb.AdaptiveMeshRe
61
65
  _proto.user_scaling.CopyFrom(_to_ad_proto(self.user_scaling))
62
66
  if self.boundary_layer_profile is not None:
63
67
  _proto.boundary_layer_profile.extend(v._to_proto() for v in self.boundary_layer_profile)
68
+ if self.active_region is not None:
69
+ _proto.active_region.extend(v._to_proto() for v in self.active_region)
64
70
  return _proto
65
71
 
66
72
  def _from_proto(self, proto: clientpb.AdaptiveMeshRefinement) -> None:
@@ -76,4 +82,5 @@ class AdaptiveMeshRefinement(CodeRepr, ParamGroupWrapper[clientpb.AdaptiveMeshRe
76
82
  self.boundary_layer_profile = [
77
83
  BoundaryLayerProfile.from_proto(v) for v in proto.boundary_layer_profile
78
84
  ]
85
+ self.active_region = [ActiveRegion.from_proto(v) for v in proto.active_region]
79
86
  return None
@@ -12,3 +12,10 @@ from .models import (
12
12
  from .solution import (
13
13
  _download_processed_solution_physics_ai as _download_processed_solution_physics_ai,
14
14
  )
15
+
16
+ from .inference import (
17
+ InferenceJob as InferenceJob,
18
+ SurfaceForInference as SurfaceForInference,
19
+ VisualizationExport as VisualizationExport,
20
+ NumericResult as NumericResult,
21
+ )