ansys-fluent-core 0.28.dev0__py3-none-any.whl → 0.28.1__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.

Potentially problematic release.


This version of ansys-fluent-core might be problematic. Click here for more details.

Files changed (63) hide show
  1. ansys/fluent/core/__init__.py +15 -16
  2. ansys/fluent/core/_version.py +1 -1
  3. ansys/fluent/core/codegen/allapigen.py +0 -3
  4. ansys/fluent/core/codegen/builtin_settingsgen.py +5 -20
  5. ansys/fluent/core/codegen/print_fluent_version.py +9 -14
  6. ansys/fluent/core/codegen/walk_api.py +57 -0
  7. ansys/fluent/core/fluent_connection.py +26 -22
  8. ansys/fluent/core/generated/api_tree/api_objects.json +1 -1
  9. ansys/fluent/core/generated/datamodel_252/meshing.py +21 -0
  10. ansys/fluent/core/generated/datamodel_252/preferences.py +7 -0
  11. ansys/fluent/core/generated/fluent_version_252.py +3 -3
  12. ansys/fluent/core/generated/meshing/tui_252.py +1183 -1133
  13. ansys/fluent/core/generated/solver/settings_252.py +8944 -6572
  14. ansys/fluent/core/generated/solver/settings_252.pyi +6357 -5352
  15. ansys/fluent/core/generated/solver/tui_252.py +3039 -2473
  16. ansys/fluent/core/journaling.py +4 -4
  17. ansys/fluent/core/launcher/fluent_container.py +31 -7
  18. ansys/fluent/core/launcher/launcher.py +3 -2
  19. ansys/fluent/core/launcher/launcher_utils.py +9 -0
  20. ansys/fluent/core/launcher/process_launch_string.py +8 -6
  21. ansys/fluent/core/launcher/pyfluent_enums.py +6 -3
  22. ansys/fluent/core/launcher/server_info.py +25 -2
  23. ansys/fluent/core/launcher/slurm_launcher.py +6 -3
  24. ansys/fluent/core/launcher/standalone_launcher.py +11 -9
  25. ansys/fluent/core/post_objects/post_helper.py +16 -10
  26. ansys/fluent/core/services/__init__.py +2 -0
  27. ansys/fluent/core/services/api_upgrade.py +11 -9
  28. ansys/fluent/core/services/app_utilities.py +408 -0
  29. ansys/fluent/core/services/datamodel_se.py +42 -5
  30. ansys/fluent/core/services/datamodel_tui.py +5 -2
  31. ansys/fluent/core/services/field_data.py +1 -0
  32. ansys/fluent/core/services/reduction.py +2 -0
  33. ansys/fluent/core/services/settings.py +5 -2
  34. ansys/fluent/core/session.py +27 -4
  35. ansys/fluent/core/session_pure_meshing.py +1 -1
  36. ansys/fluent/core/session_solver.py +0 -1
  37. ansys/fluent/core/solver/__init__.py +6 -0
  38. ansys/fluent/core/solver/flobject.py +15 -27
  39. ansys/fluent/core/solver/function/reduction.py +3 -0
  40. ansys/fluent/core/solver/settings_builtin_data.py +1 -1
  41. ansys/fluent/core/streaming_services/datamodel_event_streaming.py +5 -5
  42. ansys/fluent/core/streaming_services/events_streaming.py +336 -52
  43. ansys/fluent/tests/conftest.py +30 -0
  44. ansys/fluent/tests/test_builtin_settings.py +1 -1
  45. ansys/fluent/tests/test_codegen.py +0 -410
  46. ansys/fluent/tests/test_datamodel_api.py +449 -0
  47. ansys/fluent/tests/test_datamodel_service.py +64 -64
  48. ansys/fluent/tests/test_events_manager.py +24 -6
  49. ansys/fluent/tests/test_field_data.py +32 -0
  50. ansys/fluent/tests/test_launcher.py +30 -2
  51. ansys/fluent/tests/test_mapped_api.py +774 -0
  52. ansys/fluent/tests/test_reduction.py +30 -0
  53. ansys/fluent/tests/test_session.py +16 -1
  54. ansys/fluent/tests/test_settings_api.py +21 -0
  55. ansys/fluent/tests/test_solution_variables.py +27 -0
  56. ansys/fluent/tests/util/__init__.py +36 -0
  57. {ansys_fluent_core-0.28.dev0.dist-info → ansys_fluent_core-0.28.1.dist-info}/METADATA +4 -3
  58. {ansys_fluent_core-0.28.dev0.dist-info → ansys_fluent_core-0.28.1.dist-info}/RECORD +61 -58
  59. {ansys_fluent_core-0.28.dev0.dist-info → ansys_fluent_core-0.28.1.dist-info}/WHEEL +1 -1
  60. ansys/fluent/core/codegen/settingsgen_old.py +0 -535
  61. ansys/fluent/tests/fluent/test_version/test.py +0 -2
  62. {ansys_fluent_core-0.28.dev0.dist-info → ansys_fluent_core-0.28.1.dist-info}/AUTHORS +0 -0
  63. {ansys_fluent_core-0.28.dev0.dist-info → ansys_fluent_core-0.28.1.dist-info}/LICENSE +0 -0
@@ -430,416 +430,6 @@ _settings_static_info = {
430
430
  }
431
431
 
432
432
 
433
- _expected_init_settings_api_output = '''#
434
- # This is an auto-generated file. DO NOT EDIT!
435
- #
436
-
437
- """A package providing Fluent's Settings Objects in Python."""
438
- from ansys.fluent.core.solver.flobject import *
439
-
440
- SHASH = "3e6d76a4601701388ea8258912d145b7b7c436699a50b6c7fe9a29f41eeff194"
441
- from .root import root'''
442
-
443
-
444
- _expected_root_settings_api_output = '''#
445
- # This is an auto-generated file. DO NOT EDIT!
446
- #
447
-
448
- from ansys.fluent.core.solver.flobject import *
449
-
450
- from ansys.fluent.core.solver.flobject import (
451
- _ChildNamedObjectAccessorMixin,
452
- CreatableNamedObjectMixin,
453
- _NonCreatableNamedObjectMixin,
454
- AllowedValuesMixin,
455
- _InputFile,
456
- _OutputFile,
457
- _InOutFile,
458
- )
459
-
460
- from .G1 import G1 as G1_cls
461
- from .P1 import P1 as P1_cls
462
- from .N1 import N1 as N1_cls
463
- from .C1 import C1 as C1_cls
464
- from .Q1 import Q1 as Q1_cls
465
-
466
- class root(Group):
467
- """
468
- 'root' object.
469
- """
470
-
471
- fluent_name = ""
472
- version = "251"
473
-
474
- child_names = \\
475
- ['G1', 'P1', 'N1']
476
-
477
- command_names = \\
478
- ['C1']
479
-
480
- query_names = \\
481
- ['Q1']
482
-
483
- _child_classes = dict(
484
- G1=G1_cls,
485
- P1=P1_cls,
486
- N1=N1_cls,
487
- C1=C1_cls,
488
- Q1=Q1_cls,
489
- )'''
490
-
491
-
492
- _expected_A1_settings_api_output = '''#
493
- # This is an auto-generated file. DO NOT EDIT!
494
- #
495
-
496
- from ansys.fluent.core.solver.flobject import *
497
-
498
- from ansys.fluent.core.solver.flobject import (
499
- _ChildNamedObjectAccessorMixin,
500
- CreatableNamedObjectMixin,
501
- _NonCreatableNamedObjectMixin,
502
- AllowedValuesMixin,
503
- _InputFile,
504
- _OutputFile,
505
- _InOutFile,
506
- )
507
-
508
-
509
- class A1(String):
510
- """
511
- A1 help.
512
- """
513
-
514
- fluent_name = "A1"
515
- version = "251"'''
516
-
517
-
518
- _expected_C1_settings_api_output = '''#
519
- # This is an auto-generated file. DO NOT EDIT!
520
- #
521
-
522
- from ansys.fluent.core.solver.flobject import *
523
-
524
- from ansys.fluent.core.solver.flobject import (
525
- _ChildNamedObjectAccessorMixin,
526
- CreatableNamedObjectMixin,
527
- _NonCreatableNamedObjectMixin,
528
- AllowedValuesMixin,
529
- _InputFile,
530
- _OutputFile,
531
- _InOutFile,
532
- )
533
-
534
- from .A1 import A1 as A1_cls
535
-
536
- class C1(Command):
537
- """
538
- C1 help.
539
-
540
- Parameters
541
- ----------
542
- A1 : str
543
- A1 help.
544
-
545
- """
546
-
547
- fluent_name = "C1"
548
- version = "251"
549
-
550
- argument_names = \\
551
- ['A1']
552
-
553
- _child_classes = dict(
554
- A1=A1_cls,
555
- )''' # noqa: W293
556
-
557
-
558
- _expected_G1_settings_api_output = '''#
559
- # This is an auto-generated file. DO NOT EDIT!
560
- #
561
-
562
- from ansys.fluent.core.solver.flobject import *
563
-
564
- from ansys.fluent.core.solver.flobject import (
565
- _ChildNamedObjectAccessorMixin,
566
- CreatableNamedObjectMixin,
567
- _NonCreatableNamedObjectMixin,
568
- AllowedValuesMixin,
569
- _InputFile,
570
- _OutputFile,
571
- _InOutFile,
572
- )
573
-
574
- from .G2 import G2 as G2_cls
575
- from .P2 import P2 as P2_cls
576
- from .C2 import C2 as C2_cls
577
- from .Q2 import Q2 as Q2_cls
578
-
579
- class G1(Group):
580
- """
581
- G1 help.
582
- """
583
-
584
- fluent_name = "G1"
585
- version = "251"
586
-
587
- child_names = \\
588
- ['G2', 'P2']
589
-
590
- command_names = \\
591
- ['C2']
592
-
593
- query_names = \\
594
- ['Q2']
595
-
596
- _child_classes = dict(
597
- G2=G2_cls,
598
- P2=P2_cls,
599
- C2=C2_cls,
600
- Q2=Q2_cls,
601
- )'''
602
-
603
-
604
- _expected_N1_settings_api_output = '''#
605
- # This is an auto-generated file. DO NOT EDIT!
606
- #
607
-
608
- from ansys.fluent.core.solver.flobject import *
609
-
610
- from ansys.fluent.core.solver.flobject import (
611
- _ChildNamedObjectAccessorMixin,
612
- CreatableNamedObjectMixin,
613
- _NonCreatableNamedObjectMixin,
614
- AllowedValuesMixin,
615
- _InputFile,
616
- _OutputFile,
617
- _InOutFile,
618
- )
619
-
620
- from .P4 import P4 as P4_cls
621
- from .N1_child import N1_child
622
-
623
-
624
- class N1(NamedObject[N1_child], _NonCreatableNamedObjectMixin[N1_child]):
625
- """
626
- N1 help.
627
- """
628
-
629
- fluent_name = "N1"
630
- version = "251"
631
-
632
- child_names = \\
633
- ['P4']
634
-
635
- _child_classes = dict(
636
- P4=P4_cls,
637
- )
638
-
639
- child_object_type: N1_child = N1_child
640
- """
641
- child_object_type of N1.
642
- """'''
643
-
644
-
645
- _expected_N1_child_settings_api_output = '''#
646
- # This is an auto-generated file. DO NOT EDIT!
647
- #
648
-
649
- from ansys.fluent.core.solver.flobject import *
650
-
651
- from ansys.fluent.core.solver.flobject import (
652
- _ChildNamedObjectAccessorMixin,
653
- CreatableNamedObjectMixin,
654
- _NonCreatableNamedObjectMixin,
655
- AllowedValuesMixin,
656
- _InputFile,
657
- _OutputFile,
658
- _InOutFile,
659
- )
660
-
661
-
662
- class N1_child(Group):
663
- """
664
- 'child_object_type' of N1.
665
- """
666
-
667
- fluent_name = "child-object-type"
668
- version = "251"'''
669
-
670
-
671
- _expected_P1_settings_api_output = '''#
672
- # This is an auto-generated file. DO NOT EDIT!
673
- #
674
-
675
- from ansys.fluent.core.solver.flobject import *
676
-
677
- from ansys.fluent.core.solver.flobject import (
678
- _ChildNamedObjectAccessorMixin,
679
- CreatableNamedObjectMixin,
680
- _NonCreatableNamedObjectMixin,
681
- AllowedValuesMixin,
682
- _InputFile,
683
- _OutputFile,
684
- _InOutFile,
685
- )
686
-
687
-
688
- class P1(String):
689
- """
690
- P1 help.
691
- """
692
-
693
- fluent_name = "P1"
694
- version = "251"'''
695
-
696
-
697
- _expected_Q1_settings_api_output = '''#
698
- # This is an auto-generated file. DO NOT EDIT!
699
- #
700
-
701
- from ansys.fluent.core.solver.flobject import *
702
-
703
- from ansys.fluent.core.solver.flobject import (
704
- _ChildNamedObjectAccessorMixin,
705
- CreatableNamedObjectMixin,
706
- _NonCreatableNamedObjectMixin,
707
- AllowedValuesMixin,
708
- _InputFile,
709
- _OutputFile,
710
- _InOutFile,
711
- )
712
-
713
- from .A1 import A1 as A1_cls
714
-
715
- class Q1(Query):
716
- """
717
- Q1 help.
718
-
719
- Parameters
720
- ----------
721
- A1 : str
722
- A1 help.
723
-
724
- """
725
-
726
- fluent_name = "Q1"
727
- version = "251"
728
-
729
- argument_names = \\
730
- ['A1']
731
-
732
- _child_classes = dict(
733
- A1=A1_cls,
734
- )''' # noqa: W293
735
-
736
-
737
- def test_codegen_old_with_settings_static_info(monkeypatch):
738
- monkeypatch.setenv("PYFLUENT_USE_OLD_SETTINGSGEN", "1")
739
- codegen_outdir = Path(tempfile.mkdtemp())
740
- monkeypatch.setattr(pyfluent, "CODEGEN_OUTDIR", codegen_outdir)
741
- version = "251"
742
- static_infos = {}
743
- static_infos[StaticInfoType.SETTINGS] = _settings_static_info
744
- allapigen.generate(version, static_infos)
745
- generated_paths = list(codegen_outdir.iterdir())
746
- assert len(generated_paths) == 2
747
- assert set(p.name for p in generated_paths) == {
748
- f"api_tree_{version}.pickle",
749
- "solver",
750
- }
751
- solver_paths = list((codegen_outdir / "solver").iterdir())
752
- assert len(solver_paths) == 1
753
- assert set(p.name for p in solver_paths) == {f"settings_{version}"}
754
- settings_paths = list((codegen_outdir / "solver" / f"settings_{version}").iterdir())
755
- filenames = [
756
- "root",
757
- "A1",
758
- "A2",
759
- "C1",
760
- "C2",
761
- "G1",
762
- "G2",
763
- "N1",
764
- "N1_child",
765
- "P1",
766
- "P2",
767
- "P3",
768
- "P4",
769
- "Q1",
770
- "Q2",
771
- ]
772
- filenames = (
773
- ["__init__.py"]
774
- + [f"{f}.py" for f in filenames]
775
- + [f"{f}.pyi" for f in filenames]
776
- )
777
- assert set(p.name for p in settings_paths) == set(filenames)
778
- with open(
779
- codegen_outdir / "solver" / f"settings_{version}" / "__init__.py", "r"
780
- ) as f:
781
- assert f.read().strip() == _expected_init_settings_api_output
782
- with open(codegen_outdir / "solver" / f"settings_{version}" / "root.py", "r") as f:
783
- assert f.read().strip() == _expected_root_settings_api_output
784
- with open(codegen_outdir / "solver" / f"settings_{version}" / "A1.py", "r") as f:
785
- assert f.read().strip() == _expected_A1_settings_api_output
786
- with open(codegen_outdir / "solver" / f"settings_{version}" / "C1.py", "r") as f:
787
- assert f.read().strip() == _expected_C1_settings_api_output
788
- with open(codegen_outdir / "solver" / f"settings_{version}" / "G1.py", "r") as f:
789
- assert f.read().strip() == _expected_G1_settings_api_output
790
- with open(codegen_outdir / "solver" / f"settings_{version}" / "N1.py", "r") as f:
791
- assert f.read().strip() == _expected_N1_settings_api_output
792
- with open(
793
- codegen_outdir / "solver" / f"settings_{version}" / "N1_child.py", "r"
794
- ) as f:
795
- assert f.read().strip() == _expected_N1_child_settings_api_output
796
- with open(codegen_outdir / "solver" / f"settings_{version}" / "P1.py", "r") as f:
797
- assert f.read().strip() == _expected_P1_settings_api_output
798
- with open(codegen_outdir / "solver" / f"settings_{version}" / "Q1.py", "r") as f:
799
- assert f.read().strip() == _expected_Q1_settings_api_output
800
- api_tree_file = get_api_tree_file_name(version)
801
- with open(api_tree_file, "rb") as f:
802
- api_tree = pickle.load(f)
803
- settings_tree = {
804
- "C1": "Command",
805
- "G1": {
806
- "C2": "Command",
807
- "G2": {"P3": "Parameter"},
808
- "P2": "Parameter",
809
- "Q2": "Query",
810
- },
811
- "N1:<name>": {"P4": "Parameter"},
812
- "P1": "Parameter",
813
- "Q1": "Query",
814
- }
815
- api_tree_expected = {}
816
- api_tree_expected["<meshing_session>"] = {}
817
- api_tree_expected["<solver_session>"] = settings_tree
818
- assert api_tree == api_tree_expected
819
- shutil.rmtree(str(codegen_outdir))
820
-
821
-
822
- def test_codegen_old_with_zipped_settings_static_info(monkeypatch):
823
- monkeypatch.setenv("PYFLUENT_USE_OLD_SETTINGSGEN", "1")
824
- codegen_outdir = Path(tempfile.mkdtemp())
825
- monkeypatch.setattr(pyfluent, "CODEGEN_OUTDIR", codegen_outdir)
826
- monkeypatch.setattr(pyfluent, "CODEGEN_ZIP_SETTINGS", True)
827
- version = "251"
828
- static_infos = {}
829
- static_infos[StaticInfoType.SETTINGS] = _settings_static_info
830
- allapigen.generate(version, static_infos)
831
- generated_paths = list(codegen_outdir.iterdir())
832
- assert len(generated_paths) == 2
833
- assert set(p.name for p in generated_paths) == {
834
- f"api_tree_{version}.pickle",
835
- "solver",
836
- }
837
- solver_paths = list((codegen_outdir / "solver").iterdir())
838
- assert len(solver_paths) == 1
839
- assert set(p.name for p in solver_paths) == {f"settings_{version}.zip"}
840
- shutil.rmtree(str(codegen_outdir))
841
-
842
-
843
433
  _expected_settings_api_output = '''#
844
434
  # This is an auto-generated file. DO NOT EDIT!
845
435
  #