luminarycloud 0.20.0__py3-none-any.whl → 0.22.0__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 (95) hide show
  1. luminarycloud/__init__.py +5 -1
  2. luminarycloud/_client/client.py +5 -0
  3. luminarycloud/_client/http_client.py +10 -8
  4. luminarycloud/_feature_flag.py +22 -0
  5. luminarycloud/_helpers/_create_simulation.py +7 -2
  6. luminarycloud/_helpers/_upload_mesh.py +1 -0
  7. luminarycloud/_helpers/download.py +3 -1
  8. luminarycloud/_helpers/pagination.py +62 -0
  9. luminarycloud/_helpers/proto_decorator.py +13 -5
  10. luminarycloud/_helpers/upload.py +18 -12
  11. luminarycloud/_proto/api/v0/luminarycloud/feature_flag/feature_flag_pb2.py +55 -0
  12. luminarycloud/_proto/api/v0/luminarycloud/feature_flag/feature_flag_pb2.pyi +52 -0
  13. luminarycloud/_proto/api/v0/luminarycloud/feature_flag/feature_flag_pb2_grpc.py +72 -0
  14. luminarycloud/_proto/api/v0/luminarycloud/feature_flag/feature_flag_pb2_grpc.pyi +35 -0
  15. luminarycloud/_proto/api/v0/luminarycloud/geometry/geometry_pb2.py +168 -124
  16. luminarycloud/_proto/api/v0/luminarycloud/geometry/geometry_pb2.pyi +133 -4
  17. luminarycloud/_proto/api/v0/luminarycloud/geometry/geometry_pb2_grpc.py +66 -0
  18. luminarycloud/_proto/api/v0/luminarycloud/geometry/geometry_pb2_grpc.pyi +20 -0
  19. luminarycloud/_proto/api/v0/luminarycloud/inference/inference_pb2.py +8 -8
  20. luminarycloud/_proto/api/v0/luminarycloud/inference/inference_pb2.pyi +5 -5
  21. luminarycloud/_proto/api/v0/luminarycloud/mesh/mesh_pb2.py +74 -73
  22. luminarycloud/_proto/api/v0/luminarycloud/mesh/mesh_pb2.pyi +17 -3
  23. luminarycloud/_proto/api/v0/luminarycloud/physics_ai/physics_ai_pb2.py +33 -20
  24. luminarycloud/_proto/api/v0/luminarycloud/physics_ai/physics_ai_pb2.pyi +21 -1
  25. luminarycloud/_proto/api/v0/luminarycloud/project/project_pb2.py +16 -16
  26. luminarycloud/_proto/api/v0/luminarycloud/project/project_pb2.pyi +7 -3
  27. luminarycloud/_proto/api/v0/luminarycloud/simulation/simulation_pb2.py +97 -61
  28. luminarycloud/_proto/api/v0/luminarycloud/simulation/simulation_pb2.pyi +72 -3
  29. luminarycloud/_proto/api/v0/luminarycloud/simulation/simulation_pb2_grpc.py +34 -0
  30. luminarycloud/_proto/api/v0/luminarycloud/simulation/simulation_pb2_grpc.pyi +12 -0
  31. luminarycloud/_proto/api/v0/luminarycloud/simulation_template/simulation_template_pb2.py +33 -31
  32. luminarycloud/_proto/api/v0/luminarycloud/simulation_template/simulation_template_pb2.pyi +23 -2
  33. luminarycloud/_proto/api/v0/luminarycloud/vis/vis_pb2.py +68 -19
  34. luminarycloud/_proto/api/v0/luminarycloud/vis/vis_pb2.pyi +98 -0
  35. luminarycloud/_proto/api/v0/luminarycloud/vis/vis_pb2_grpc.py +33 -0
  36. luminarycloud/_proto/api/v0/luminarycloud/vis/vis_pb2_grpc.pyi +10 -0
  37. luminarycloud/_proto/assistant/assistant_pb2.py +74 -41
  38. luminarycloud/_proto/assistant/assistant_pb2.pyi +64 -2
  39. luminarycloud/_proto/assistant/assistant_pb2_grpc.py +33 -0
  40. luminarycloud/_proto/assistant/assistant_pb2_grpc.pyi +10 -0
  41. luminarycloud/_proto/base/base_pb2.py +20 -7
  42. luminarycloud/_proto/base/base_pb2.pyi +38 -0
  43. luminarycloud/_proto/cad/shape_pb2.py +39 -19
  44. luminarycloud/_proto/cad/shape_pb2.pyi +86 -34
  45. luminarycloud/_proto/cad/transformation_pb2.py +60 -16
  46. luminarycloud/_proto/cad/transformation_pb2.pyi +138 -32
  47. luminarycloud/_proto/client/simulation_pb2.py +490 -348
  48. luminarycloud/_proto/client/simulation_pb2.pyi +570 -8
  49. luminarycloud/_proto/geometry/geometry_pb2.py +77 -63
  50. luminarycloud/_proto/geometry/geometry_pb2.pyi +42 -3
  51. luminarycloud/_proto/hexmesh/hexmesh_pb2.py +24 -18
  52. luminarycloud/_proto/hexmesh/hexmesh_pb2.pyi +23 -2
  53. luminarycloud/_proto/inferenceservice/inferenceservice_pb2.py +10 -10
  54. luminarycloud/_proto/inferenceservice/inferenceservice_pb2.pyi +5 -5
  55. luminarycloud/_proto/quantity/quantity_options_pb2.py +6 -6
  56. luminarycloud/_proto/quantity/quantity_options_pb2.pyi +10 -1
  57. luminarycloud/_proto/quantity/quantity_pb2.py +176 -167
  58. luminarycloud/_proto/quantity/quantity_pb2.pyi +11 -5
  59. luminarycloud/enum/__init__.py +1 -0
  60. luminarycloud/enum/gpu_type.py +2 -0
  61. luminarycloud/enum/quantity_type.py +9 -0
  62. luminarycloud/enum/vis_enums.py +23 -3
  63. luminarycloud/feature_modification.py +45 -35
  64. luminarycloud/geometry.py +104 -8
  65. luminarycloud/geometry_version.py +57 -3
  66. luminarycloud/meshing/mesh_generation_params.py +8 -8
  67. luminarycloud/params/enum/_enum_wrappers.py +537 -30
  68. luminarycloud/params/simulation/adaptive_mesh_refinement_.py +4 -0
  69. luminarycloud/params/simulation/physics/__init__.py +0 -1
  70. luminarycloud/params/simulation/physics/periodic_pair_.py +12 -31
  71. luminarycloud/physics_ai/architectures.py +5 -5
  72. luminarycloud/physics_ai/inference.py +13 -13
  73. luminarycloud/physics_ai/solution.py +3 -1
  74. luminarycloud/pipelines/__init__.py +11 -3
  75. luminarycloud/pipelines/api.py +240 -4
  76. luminarycloud/pipelines/arguments.py +15 -0
  77. luminarycloud/pipelines/core.py +113 -96
  78. luminarycloud/pipelines/{operators.py → stages.py} +96 -39
  79. luminarycloud/project.py +15 -47
  80. luminarycloud/simulation.py +66 -3
  81. luminarycloud/simulation_param.py +0 -9
  82. luminarycloud/types/matrix3.py +12 -0
  83. luminarycloud/vis/__init__.py +2 -0
  84. luminarycloud/vis/interactive_report.py +79 -93
  85. luminarycloud/vis/report.py +219 -65
  86. luminarycloud/vis/visualization.py +60 -0
  87. luminarycloud/volume_selection.py +132 -69
  88. {luminarycloud-0.20.0.dist-info → luminarycloud-0.22.0.dist-info}/METADATA +1 -1
  89. {luminarycloud-0.20.0.dist-info → luminarycloud-0.22.0.dist-info}/RECORD +90 -89
  90. luminarycloud/params/simulation/physics/periodic_pair/__init__.py +0 -2
  91. luminarycloud/params/simulation/physics/periodic_pair/periodicity_type/__init__.py +0 -2
  92. luminarycloud/params/simulation/physics/periodic_pair/periodicity_type/rotational_periodicity_.py +0 -31
  93. luminarycloud/params/simulation/physics/periodic_pair/periodicity_type/translational_periodicity_.py +0 -29
  94. luminarycloud/params/simulation/physics/periodic_pair/periodicity_type_.py +0 -25
  95. {luminarycloud-0.20.0.dist-info → luminarycloud-0.22.0.dist-info}/WHEEL +0 -0
@@ -30,7 +30,7 @@ from .params.geometry import (
30
30
  Volume,
31
31
  )
32
32
  from .types import Matrix3, Vector3, Vector3Like
33
- from .types.vector3 import _to_vector3
33
+ from .types.vector3 import _to_vector3, _to_vector3_ad_proto
34
34
 
35
35
  if TYPE_CHECKING:
36
36
  from .geometry import Geometry
@@ -182,7 +182,7 @@ class VolumeSelection:
182
182
  )
183
183
  )
184
184
 
185
- def union(self, *, feature_name: str = "Union") -> None:
185
+ def union(self, keep: bool = False, *, feature_name: str = "Union") -> None:
186
186
  """
187
187
  Merge the selected volumes.
188
188
 
@@ -190,6 +190,8 @@ class VolumeSelection:
190
190
 
191
191
  Parameters
192
192
  ----------
193
+ keep : bool
194
+ Whether to keep the original bodies.
193
195
  feature_name : str
194
196
  The name of the feature.
195
197
  """
@@ -199,6 +201,7 @@ class VolumeSelection:
199
201
  boolean=gpb.Boolean(
200
202
  reg_union=booleanpb.RegularUnion(
201
203
  bodies=self.__volume_ids,
204
+ keep_source_bodies=keep,
202
205
  )
203
206
  ),
204
207
  )
@@ -207,6 +210,8 @@ class VolumeSelection:
207
210
  def subtract(
208
211
  self,
209
212
  tool_volumes: Iterable[Volume],
213
+ keep_source_bodies: bool = False,
214
+ keep_tool_bodies: bool = False,
210
215
  *,
211
216
  propagate_tags: bool = False,
212
217
  feature_name: str = "Subtract",
@@ -220,6 +225,10 @@ class VolumeSelection:
220
225
  ----------
221
226
  tool_volumes : Iterable[Volume]
222
227
  The volumes to subtract from the selected volumes.
228
+ keep_source_bodies : bool
229
+ Whether to keep the original bodies.
230
+ keep_tool_bodies : bool
231
+ Whether to keep the tool bodies.
223
232
  propagate_tags : bool
224
233
  Whether to propagate the tool volume tags to the surfaces created by the subtraction.
225
234
  feature_name : str
@@ -232,13 +241,15 @@ class VolumeSelection:
232
241
  reg_subtraction=booleanpb.RegularSubtraction(
233
242
  bodies=self.__volume_ids,
234
243
  tools=[int(v.id) for v in tool_volumes],
244
+ keep_source_bodies=keep_source_bodies,
245
+ keep_tool_bodies=keep_tool_bodies,
235
246
  propagate_tool_tags=propagate_tags,
236
247
  )
237
248
  ),
238
249
  )
239
250
  )
240
251
 
241
- def intersection(self, *, feature_name: str = "Intersection") -> None:
252
+ def intersection(self, keep: bool = False, *, feature_name: str = "Intersection") -> None:
242
253
  """
243
254
  Create an intersection of the selected volumes.
244
255
 
@@ -246,6 +257,8 @@ class VolumeSelection:
246
257
 
247
258
  Parameters
248
259
  ----------
260
+ keep : bool
261
+ Whether to keep the original bodies.
249
262
  feature_name : str
250
263
  The name of the feature.
251
264
  """
@@ -255,6 +268,7 @@ class VolumeSelection:
255
268
  boolean=gpb.Boolean(
256
269
  reg_intersection=booleanpb.RegularIntersection(
257
270
  bodies=self.__volume_ids,
271
+ keep_source_bodies=keep,
258
272
  )
259
273
  ),
260
274
  )
@@ -263,6 +277,8 @@ class VolumeSelection:
263
277
  def chop(
264
278
  self,
265
279
  tool_volumes: Iterable[Volume],
280
+ keep_source_bodies: bool = False,
281
+ keep_tool_bodies: bool = False,
266
282
  *,
267
283
  propagate_tags: bool = False,
268
284
  feature_name: str = "Chop",
@@ -277,6 +293,10 @@ class VolumeSelection:
277
293
  ----------
278
294
  tool_volumes : Iterable[Volume]
279
295
  The volumes to chop the selected volumes with.
296
+ keep_source_bodies : bool
297
+ Whether to keep the original bodies.
298
+ keep_tool_bodies : bool
299
+ Whether to keep the tool bodies.
280
300
  propagate_tags : bool
281
301
  Whether to propagate the tool volume tags to the surfaces created by the chop.
282
302
  feature_name : str
@@ -289,38 +309,38 @@ class VolumeSelection:
289
309
  reg_chop=booleanpb.RegularChop(
290
310
  bodies=self.__volume_ids,
291
311
  tools=[int(v.id) for v in tool_volumes],
312
+ keep_source_bodies=keep_source_bodies,
313
+ keep_tool_bodies=keep_tool_bodies,
292
314
  propagate_tool_tags=propagate_tags,
293
315
  )
294
316
  ),
295
317
  )
296
318
  )
297
319
 
298
- def translate(self, displacement: Vector3Like, *, feature_name: str = "Translate") -> None:
320
+ def translate(
321
+ self, displacement: Vector3Like, *, keep: bool = False, feature_name: str = "Translate"
322
+ ) -> None:
299
323
  """
300
324
  Translate the selected volumes.
301
325
 
302
- The selected volumes are modified in-place.
303
-
304
326
  Parameters
305
327
  ----------
306
328
  displacement : Vector3Like
307
329
  The displacement to translate the selected volumes by.
330
+ keep : bool, default False
331
+ Whether to keep a copy of the original bodies.
308
332
  feature_name : str
309
333
  The name of the feature.
310
334
  """
311
- displacement = _to_vector3(displacement)
312
335
  self.__create_feature(
313
336
  gpb.Feature(
314
337
  feature_name=feature_name,
315
338
  transform=gpb.Transform(
316
339
  body=self.__volume_ids,
317
340
  translation=transformationpb.Translation(
318
- vector=basepb.Vector3(
319
- x=displacement.x,
320
- y=displacement.y,
321
- z=displacement.z,
322
- ),
341
+ vector=_to_vector3_ad_proto(displacement),
323
342
  ),
343
+ keep=keep,
324
344
  ),
325
345
  )
326
346
  )
@@ -331,13 +351,12 @@ class VolumeSelection:
331
351
  axis: Vector3Like,
332
352
  origin: Vector3Like,
333
353
  *,
354
+ keep: bool = False,
334
355
  feature_name: str = "Rotate",
335
356
  ) -> None:
336
357
  """
337
358
  Rotate the selected volumes.
338
359
 
339
- The selected volumes are modified in-place.
340
-
341
360
  Parameters
342
361
  ----------
343
362
  angle : float
@@ -346,31 +365,24 @@ class VolumeSelection:
346
365
  The axis to rotate the selected volumes around.
347
366
  origin : Vector3Like
348
367
  The origin to rotate the selected volumes around.
368
+ keep : bool, default False
369
+ Whether to keep a copy of the original bodies.
349
370
  feature_name : str
350
371
  The name of the feature.
351
372
  """
352
- axis = _to_vector3(axis)
353
- origin = _to_vector3(origin)
354
373
  self.__create_feature(
355
374
  gpb.Feature(
356
375
  feature_name=feature_name,
357
376
  transform=gpb.Transform(
358
377
  body=self.__volume_ids,
359
378
  rotation=transformationpb.Rotation(
360
- angle=angle,
361
- arbitrary=transformationpb.AnchoredVector3(
362
- origin=basepb.Vector3(
363
- x=origin.x,
364
- y=origin.y,
365
- z=origin.z,
366
- ),
367
- direction=basepb.Vector3(
368
- x=axis.x,
369
- y=axis.y,
370
- z=axis.z,
371
- ),
379
+ angle=_to_ad_proto(angle),
380
+ arbitrary=transformationpb.AnchoredAdVector3(
381
+ origin=_to_vector3_ad_proto(origin),
382
+ direction=_to_vector3_ad_proto(axis),
372
383
  ),
373
384
  ),
385
+ keep=keep,
374
386
  ),
375
387
  )
376
388
  )
@@ -380,36 +392,71 @@ class VolumeSelection:
380
392
  factor: float,
381
393
  origin: Vector3Like,
382
394
  *,
395
+ keep: bool = False,
383
396
  feature_name: str = "Scale",
384
397
  ) -> None:
385
398
  """
386
399
  Isotropically scale the selected volumes.
387
400
 
388
- The selected volumes are modified in-place.
389
-
390
401
  Parameters
391
402
  ----------
392
403
  factor : float
393
404
  The scaling factor.
394
405
  origin : Vector3Like
395
406
  The origin to scale the selected volumes from.
407
+ keep : bool, default False
408
+ Whether to keep a copy of the original bodies.
396
409
  feature_name : str
397
410
  The name of the feature.
398
411
  """
399
- origin = _to_vector3(origin)
400
412
  self.__create_feature(
401
413
  gpb.Feature(
402
414
  feature_name=feature_name,
403
415
  transform=gpb.Transform(
404
416
  body=self.__volume_ids,
405
417
  scaling=transformationpb.Scaling(
406
- isotropic=factor,
407
- arbitrary=basepb.Vector3(
408
- x=origin.x,
409
- y=origin.y,
410
- z=origin.z,
411
- ),
418
+ isotropic=_to_ad_proto(factor),
419
+ arbitrary=_to_vector3_ad_proto(origin),
412
420
  ),
421
+ keep=keep,
422
+ ),
423
+ )
424
+ )
425
+
426
+ def mirror(
427
+ self,
428
+ origin: Vector3Like,
429
+ normal: Vector3Like,
430
+ *,
431
+ keep: bool = True,
432
+ feature_name: str = "Mirror",
433
+ ) -> None:
434
+ """
435
+ Mirror the selected volumes across a plane.
436
+
437
+ Parameters
438
+ ----------
439
+ origin : Vector3Like
440
+ A point on the reflection plane.
441
+ normal : Vector3Like
442
+ The normal of the reflection plane.
443
+ keep : bool, default True
444
+ Whether to keep a copy of the original bodies.
445
+ feature_name : str
446
+ The name of the feature.
447
+ """
448
+ self.__create_feature(
449
+ gpb.Feature(
450
+ feature_name=feature_name,
451
+ transform=gpb.Transform(
452
+ body=self.__volume_ids,
453
+ reflection=transformationpb.Reflection(
454
+ arbitrary=transformationpb.AnchoredAdVector3(
455
+ origin=_to_vector3_ad_proto(origin),
456
+ direction=_to_vector3_ad_proto(normal),
457
+ )
458
+ ),
459
+ keep=keep,
413
460
  ),
414
461
  )
415
462
  )
@@ -419,36 +466,61 @@ class VolumeSelection:
419
466
  transform: Matrix3,
420
467
  translation: Vector3Like,
421
468
  *,
469
+ keep: bool = False,
422
470
  feature_name: str = "Transform",
423
471
  ) -> None:
424
472
  """
425
473
  Transform the selected volumes.
426
474
 
427
- The selected volumes are modified in-place.
428
-
429
475
  Parameters
430
476
  ----------
431
477
  transform : Matrix3
432
478
  The linear transformation to apply to the selected volumes.
433
479
  translation : Vector3Like
434
480
  The translation to apply to the selected volumes.
481
+ keep : bool, default False
482
+ Whether to keep a copy of the original bodies.
435
483
  feature_name : str
436
484
  The name of the feature.
437
485
  """
438
- translation = _to_vector3(translation)
439
486
  self.__create_feature(
440
487
  gpb.Feature(
441
488
  feature_name=feature_name,
442
489
  transform=gpb.Transform(
443
490
  body=self.__volume_ids,
444
491
  matrix=transformationpb.AugmentedMatrix(
445
- affine=transform._to_proto(),
446
- translation=basepb.Vector3(
447
- x=translation.x,
448
- y=translation.y,
449
- z=translation.z,
450
- ),
492
+ affine=transform._to_ad_proto(),
493
+ translation=_to_vector3_ad_proto(translation),
451
494
  ),
495
+ keep=keep,
496
+ ),
497
+ )
498
+ )
499
+
500
+ def stitch(
501
+ self,
502
+ tolerance: float,
503
+ *,
504
+ feature_name: str = "Stitch",
505
+ ) -> None:
506
+ """
507
+ Stitch the selected volumes using a strictly positive tolerance.
508
+
509
+ Parameters
510
+ ----------
511
+ tolerance : float
512
+ Strictly positive length tolerance used for stitching.
513
+ feature_name : str
514
+ The name of the feature.
515
+ """
516
+ if tolerance <= 0:
517
+ raise ValueError("tolerance must be a strictly positive value")
518
+ self.__create_feature(
519
+ gpb.Feature(
520
+ feature_name=feature_name,
521
+ stitch=gpb.Stitch(
522
+ body=self.__volume_ids,
523
+ tolerance=_to_ad_proto(tolerance),
452
524
  ),
453
525
  )
454
526
  )
@@ -526,7 +598,6 @@ class VolumeSelection:
526
598
  feature_name : str
527
599
  The name of the feature.
528
600
  """
529
- vector = _to_vector3(vector)
530
601
  self.__create_feature(
531
602
  gpb.Feature(
532
603
  feature_name=feature_name,
@@ -534,11 +605,7 @@ class VolumeSelection:
534
605
  body=self.__volume_ids,
535
606
  direction=gpb.Pattern.Direction(
536
607
  linear_spacing=transformationpb.Translation(
537
- vector=basepb.Vector3(
538
- x=vector.x,
539
- y=vector.y,
540
- z=vector.z,
541
- ),
608
+ vector=_to_vector3_ad_proto(vector),
542
609
  ),
543
610
  quantity=quantity,
544
611
  ),
@@ -581,6 +648,8 @@ class VolumeSelection:
581
648
  axis: Vector3Like,
582
649
  origin: Vector3Like,
583
650
  quantity: int,
651
+ symmetric: bool = False,
652
+ full_rotation: bool = False,
584
653
  *,
585
654
  feature_name: str = "Circular Pattern",
586
655
  ) -> None:
@@ -590,19 +659,20 @@ class VolumeSelection:
590
659
  Parameters
591
660
  ----------
592
661
  angle : float
593
- The angle of the circular arc, in degrees. If the angle is 360, the volumes are evenly
594
- distributed around a full circle.
662
+ The angle of the circular arc, in degrees.
595
663
  axis : Vector3Like
596
664
  The axis of the circular arc.
597
665
  origin : Vector3Like
598
666
  The origin of the circular arc.
599
667
  quantity : int
600
668
  The number of times to repeat the selected volumes.
669
+ symmetric : bool, default False
670
+ Whether the pattern is symmetric.
671
+ full_rotation : bool, default False
672
+ Whether it's a full rotation: invalidates the angle.
601
673
  feature_name : str
602
674
  The name of the feature.
603
675
  """
604
- axis = _to_vector3(axis)
605
- origin = _to_vector3(origin)
606
676
  self.__create_feature(
607
677
  gpb.Feature(
608
678
  feature_name=feature_name,
@@ -611,23 +681,16 @@ class VolumeSelection:
611
681
  direction=gpb.Pattern.Direction(
612
682
  circular_distribution=gpb.Pattern.Direction.Circular(
613
683
  rotation=transformationpb.Rotation(
614
- angle=angle,
615
- arbitrary=transformationpb.AnchoredVector3(
616
- origin=basepb.Vector3(
617
- x=origin.x,
618
- y=origin.y,
619
- z=origin.z,
620
- ),
621
- direction=basepb.Vector3(
622
- x=axis.x,
623
- y=axis.y,
624
- z=axis.z,
625
- ),
684
+ angle=_to_ad_proto(angle),
685
+ arbitrary=transformationpb.AnchoredAdVector3(
686
+ origin=_to_vector3_ad_proto(origin),
687
+ direction=_to_vector3_ad_proto(axis),
626
688
  ),
627
689
  ),
628
- full=(angle == 360.0), # set to true if angle is exactly 360
690
+ full=full_rotation,
629
691
  ),
630
692
  quantity=quantity,
693
+ symmetric=symmetric,
631
694
  ),
632
695
  ),
633
696
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: luminarycloud
3
- Version: 0.20.0
3
+ Version: 0.22.0
4
4
  Summary: Luminary Cloud SDK
5
5
  Project-URL: Homepage, https://www.luminarycloud.com/
6
6
  Project-URL: Documentation, https://app.luminarycloud.com/docs/api/