fiqus 2024.6.0__tar.gz → 2024.7.0__tar.gz

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 (84) hide show
  1. {fiqus-2024.6.0 → fiqus-2024.7.0}/PKG-INFO +1 -1
  2. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/data/DataFiQuSConductorAC_Strand.py +3 -3
  3. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/plotters/PlotPythonConductorAC.py +28 -13
  4. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus.egg-info/PKG-INFO +1 -1
  5. {fiqus-2024.6.0 → fiqus-2024.7.0}/setup.py +1 -1
  6. {fiqus-2024.6.0 → fiqus-2024.7.0}/README.md +0 -0
  7. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/MainFiQuS.py +0 -0
  8. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/__init__.py +0 -0
  9. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/data/DataConductor.py +0 -0
  10. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/data/DataFiQuS.py +0 -0
  11. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/data/DataFiQuSCCT.py +0 -0
  12. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/data/DataFiQuSConductor.py +0 -0
  13. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/data/DataFiQuSMultipole.py +0 -0
  14. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/data/DataFiQuSPancake3D.py +0 -0
  15. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/data/DataMultipole.py +0 -0
  16. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/data/DataRoxieParser.py +0 -0
  17. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/data/DataWindingsCCT.py +0 -0
  18. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/data/RegionsModelFiQuS.py +0 -0
  19. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/data/__init__.py +0 -0
  20. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/geom_generators/GeometryCCT.py +0 -0
  21. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/geom_generators/GeometryConductorAC_Strand.py +0 -0
  22. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/geom_generators/GeometryMultipole.py +0 -0
  23. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/geom_generators/GeometryPancake3D.py +0 -0
  24. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/geom_generators/__init__.py +0 -0
  25. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/getdp_runners/RunGetdpCCT.py +0 -0
  26. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/getdp_runners/RunGetdpConductorAC_Strand.py +0 -0
  27. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/getdp_runners/RunGetdpMultipole.py +0 -0
  28. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/getdp_runners/RunGetdpPancake3D.py +0 -0
  29. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/getdp_runners/__init__.py +0 -0
  30. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/mains/MainCCT.py +0 -0
  31. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/mains/MainConductorAC_Strand.py +0 -0
  32. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/mains/MainMultipole.py +0 -0
  33. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/mains/MainPancake3D.py +0 -0
  34. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/mains/__init__.py +0 -0
  35. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/mesh_generators/MeshCCT.py +0 -0
  36. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/mesh_generators/MeshConductorAC_Strand.py +0 -0
  37. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/mesh_generators/MeshMultipole.py +0 -0
  38. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/mesh_generators/MeshPancake3D.py +0 -0
  39. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/mesh_generators/__init__.py +0 -0
  40. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/parsers/ParserDAT.py +0 -0
  41. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/parsers/ParserGetDPOnSection.py +0 -0
  42. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/parsers/ParserGetDPTimeTable.py +0 -0
  43. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/parsers/ParserMSH.py +0 -0
  44. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/parsers/ParserPOS.py +0 -0
  45. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/parsers/ParserRES.py +0 -0
  46. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/parsers/__init__.py +0 -0
  47. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/plotters/PlotPythonCCT.py +0 -0
  48. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/plotters/PlotPythonMultipole.py +0 -0
  49. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/plotters/__init__.py +0 -0
  50. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/post_processors/PostProcessCCT.py +0 -0
  51. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/post_processors/PostProcessConductorAC.py +0 -0
  52. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/post_processors/PostProcessMultipole.py +0 -0
  53. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/post_processors/PostProcessPancake3D.py +0 -0
  54. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/post_processors/__init__.py +0 -0
  55. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/pre_processors/PreProcessCCT.py +0 -0
  56. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/pre_processors/__init__.py +0 -0
  57. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/pro_assemblers/ProAssembler.py +0 -0
  58. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/pro_assemblers/__init__.py +0 -0
  59. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/pro_material_functions/ironBHcurves.pro +0 -0
  60. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/pro_templates/__init__.py +0 -0
  61. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/pro_templates/combined/CCT_template.pro +0 -0
  62. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/pro_templates/combined/ConductorAC_template.pro +0 -0
  63. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/pro_templates/combined/Multipole_template.pro +0 -0
  64. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/pro_templates/combined/Pancake3D_template.pro +0 -0
  65. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/pro_templates/combined/__init__.py +0 -0
  66. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/pro_templates/combined/materials.pro +0 -0
  67. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/pro_templates/separated/__init__.py +0 -0
  68. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/utils/Utils.py +0 -0
  69. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus/utils/__init__.py +0 -0
  70. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus.egg-info/SOURCES.txt +0 -0
  71. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus.egg-info/dependency_links.txt +0 -0
  72. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus.egg-info/requires.txt +0 -0
  73. {fiqus-2024.6.0 → fiqus-2024.7.0}/fiqus.egg-info/top_level.txt +0 -0
  74. {fiqus-2024.6.0 → fiqus-2024.7.0}/setup.cfg +0 -0
  75. {fiqus-2024.6.0 → fiqus-2024.7.0}/tests/__init__.py +0 -0
  76. {fiqus-2024.6.0 → fiqus-2024.7.0}/tests/test_FiQuS.py +0 -0
  77. {fiqus-2024.6.0 → fiqus-2024.7.0}/tests/test_geometry_generators.py +0 -0
  78. {fiqus-2024.6.0 → fiqus-2024.7.0}/tests/test_mesh_generators.py +0 -0
  79. {fiqus-2024.6.0 → fiqus-2024.7.0}/tests/test_solvers.py +0 -0
  80. {fiqus-2024.6.0 → fiqus-2024.7.0}/tests/utils/__init__.py +0 -0
  81. {fiqus-2024.6.0 → fiqus-2024.7.0}/tests/utils/fiqus_test_classes.py +0 -0
  82. {fiqus-2024.6.0 → fiqus-2024.7.0}/tests/utils/generate_reference_files_ConductorAC.py +0 -0
  83. {fiqus-2024.6.0 → fiqus-2024.7.0}/tests/utils/generate_reference_files_Pancake3D.py +0 -0
  84. {fiqus-2024.6.0 → fiqus-2024.7.0}/tests/utils/helpers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fiqus
3
- Version: 2024.6.0
3
+ Version: 2024.7.0
4
4
  Summary: Source code for STEAM FiQuS tool
5
5
  Home-page: https://gitlab.cern.ch/steam/fiqus
6
6
  Author: STEAM Team
@@ -426,10 +426,10 @@ class CACStrandPostprocBatchpostprocPlot2d(BaseModel):
426
426
  save_plot: bool = Field(default=False, description="Set True to save the plot.")
427
427
  filename: str = Field(default="plot2d", description="Name of the plot file.")
428
428
  x_val: Optional[str] = Field(
429
- default=None, description="Value to be plotted on the x-axis. This field corresponds to a parameter in the input YAML-file. E.g. 'solve.source_parameters.sine.frequency' will create a 2D plot with frequency on the x-axis."
429
+ default=None, description="Value to be plotted on the x-axis. Parameters in the input YAML-file and class-variables from the plotter 'SimulationData' class can be accessed trough the notation << . >>. E.g. '<<solve.source_parameters.sine.frequency>>' will create a 2D plot with frequency on the x-axis. '<<time>>' will create a plot with time on the x-axis."
430
430
  )
431
431
  y_vals: Optional[List[str]] = Field(
432
- default=None, description=" List of values to be plotted on the y-axis. Total AC-loss per cycle can be accessed as ['total_power_per_cycle['TotalLoss_dyn']']."
432
+ default=None, description=" List of values to be plotted on the y-axis. Parameters in the input YAML-file and class-variables from the plotter 'SimulationData' class can be accessed trough the notation << . >>. E.g. total AC-loss per cycle can be accessed as ['<<total_power_per_cycle['TotalLoss_dyn']>>']."
433
433
  )
434
434
  labels: Optional[List[str]] = Field(
435
435
  default=None,
@@ -457,7 +457,7 @@ class CACStrandPostprocBatchpostprocFilter(BaseModel):
457
457
  )
458
458
  filter_criterion: Optional[str] = Field(
459
459
  default=None,
460
- description="Criterion used to filter simulations based on simulation parameters. For example will 'solve.source_parameters.sine.frequency > 100' disregard simulations done with frequencies lower than 100Hz.",
460
+ description="Criterion used to filter simulations based on simulation parameters. For example will '<<solve.source_parameters.sine.frequency>> > 100' disregard simulations done with frequencies lower than 100Hz.",
461
461
  )
462
462
 
463
463
 
@@ -7,6 +7,7 @@ from matplotlib.animation import FuncAnimation
7
7
  import pandas as pd
8
8
  from scipy import integrate, interpolate
9
9
  from ruamel.yaml import YAML
10
+ import subprocess
10
11
 
11
12
  # from fiqus.utils.Utils import FilesAndFolders as Util
12
13
  # from fiqus.data.DataFiQuSConductorAC_Strand import CACStrandSolve, CACStrandPostproc, CACStrandMesh, CACStrandGeometry
@@ -70,6 +71,17 @@ def load_yaml(file_path):
70
71
  data = yaml.load(file)
71
72
  return YamlWrapper(data)
72
73
 
74
+ def is_latex_installed():
75
+ """
76
+ Check if LaTeX is installed on the system.
77
+ """
78
+ try:
79
+ subprocess.run(['pdflatex', '--version'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
80
+ return True
81
+ except subprocess.CalledProcessError:
82
+ return False
83
+ except FileNotFoundError:
84
+ return False
73
85
 
74
86
  class SimulationData:
75
87
  """
@@ -300,7 +312,7 @@ class PlotPython:
300
312
  def sort_simulationCollection(self, simulationCollection):
301
313
  """
302
314
  This function is used to sort the simulationCollection based on the sort key specified in the yaml input file.
303
- An example of a sort key is 'sd.fdm.solve.source_parameters.sine.frequency', which will sort the simulations based on frequency.
315
+ An example of a sort key is 'solve.source_parameters.sine.frequency', which will sort the simulations based on frequency.
304
316
  """
305
317
  if self.fdm.magnet.postproc.batch_postproc.sort.apply_sort:
306
318
  sorting_function = eval(f'lambda sd: sd.{self.fdm.magnet.postproc.batch_postproc.sort.sort_key}')
@@ -460,10 +472,10 @@ class PlotPython:
460
472
  This function calls the lossMap_crossSection function and plots the data it returns, which is the loss for all values of one axis, given a constant value of the other axis.
461
473
  """
462
474
 
463
-
464
- plt.rcParams['text.usetex'] = True
465
- plt.rcParams['font.family'] = 'times'
466
- plt.rcParams['font.size'] = 20
475
+ if is_latex_installed():
476
+ plt.rcParams['text.usetex'] = True
477
+ plt.rcParams['font.family'] = 'times'
478
+ plt.rcParams['font.size'] = 20
467
479
 
468
480
  lm = self.fdm.magnet.postproc.batch_postproc.loss_map
469
481
  slice_value = lm.cross_section.cut_value
@@ -594,9 +606,10 @@ class PlotPython:
594
606
  else:
595
607
  X, Y, V = self.totalLoss_gridData
596
608
 
597
- plt.rcParams['text.usetex'] = True
598
- plt.rcParams['font.family'] = 'times'
599
- plt.rcParams['font.size'] = 20
609
+ if is_latex_installed():
610
+ plt.rcParams['text.usetex'] = True
611
+ plt.rcParams['font.family'] = 'times'
612
+ plt.rcParams['font.size'] = 20
600
613
 
601
614
  fig, ax = plt.subplots(figsize=(10,8))
602
615
 
@@ -713,9 +726,10 @@ class PlotPython:
713
726
  """
714
727
  This function is used to create a 2d plot. It is supposed to be flexible and work for various kinds of plots one may want to create.
715
728
  """
716
- plt.rcParams['text.usetex'] = True
717
- plt.rcParams['font.family'] = 'times'
718
- # plt.rcParams['font.size'] = 20
729
+ if is_latex_installed():
730
+ plt.rcParams['text.usetex'] = True
731
+ plt.rcParams['font.family'] = 'times'
732
+ # plt.rcParams['font.size'] = 20
719
733
 
720
734
  # Create the title (or titles if combined_plot is False)
721
735
  title = self.fdm.magnet.postproc.batch_postproc.plot2d.title
@@ -746,7 +760,8 @@ class PlotPython:
746
760
  simulation_labels.append(l)
747
761
  labels[i, :] = simulation_labels
748
762
 
749
- colors = plt.cm.get_cmap('magma').resampled(len(self.simulation_collection)).colors
763
+ # colors = plt.cm.get_cmap('magma').resampled(len(self.simulation_collection)).colors
764
+ colors = plt.cm.get_cmap('viridis').resampled(len(self.simulation_collection)).colors
750
765
 
751
766
  # Load the x-values:
752
767
  x_val = self.fdm.magnet.postproc.batch_postproc.plot2d.x_val
@@ -780,7 +795,7 @@ class PlotPython:
780
795
 
781
796
  # Check if the y-values are all floats:
782
797
  y_is_float = np.all(np.apply_along_axis(lambda arr: np.all(np.vectorize(isinstance)(arr, float)), axis=1, arr=y_arr))
783
- # If they are all floats, we can make a single plot, spanning all simulations, instead of one plot per simulation.
798
+ # If they are all floats (not arrays), we can make a single plot, spanning all simulations, instead of one plot per simulation.
784
799
  if y_is_float:
785
800
  for column in range(y_arr.shape[1]):
786
801
  plt.plot(x_arr, y_arr[:, column], label=label_list[column])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fiqus
3
- Version: 2024.6.0
3
+ Version: 2024.7.0
4
4
  Summary: Source code for STEAM FiQuS tool
5
5
  Home-page: https://gitlab.cern.ch/steam/fiqus
6
6
  Author: STEAM Team
@@ -35,7 +35,7 @@ all_requirements = required + docs_require + tests_require + build_require
35
35
 
36
36
  setup(
37
37
  name="fiqus",
38
- version="2024.6.0",
38
+ version="2024.7.0",
39
39
  author="STEAM Team",
40
40
  author_email="steam-team@cern.ch",
41
41
  description="Source code for STEAM FiQuS tool",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes