fiqus 2024.6.0__py3-none-any.whl → 2024.7.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.
- fiqus/data/DataFiQuSConductorAC_Strand.py +3 -3
- fiqus/plotters/PlotPythonConductorAC.py +28 -13
- {fiqus-2024.6.0.dist-info → fiqus-2024.7.0.dist-info}/METADATA +1 -1
- {fiqus-2024.6.0.dist-info → fiqus-2024.7.0.dist-info}/RECORD +6 -6
- {fiqus-2024.6.0.dist-info → fiqus-2024.7.0.dist-info}/WHEEL +0 -0
- {fiqus-2024.6.0.dist-info → fiqus-2024.7.0.dist-info}/top_level.txt +0 -0
|
@@ -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.
|
|
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.
|
|
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 '
|
|
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
|
-
|
|
465
|
-
|
|
466
|
-
|
|
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
|
-
|
|
598
|
-
|
|
599
|
-
|
|
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
|
-
|
|
717
|
-
|
|
718
|
-
|
|
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])
|
|
@@ -4,7 +4,7 @@ fiqus/data/DataConductor.py,sha256=iBtmUOfz68yPqTq_5-dprigb4BgP_BCbFzSMSKoqN_c,1
|
|
|
4
4
|
fiqus/data/DataFiQuS.py,sha256=-lxp98aU3f-sHdbLYlBipBVr1w6zQi0kK7pWZQM3D5Y,6599
|
|
5
5
|
fiqus/data/DataFiQuSCCT.py,sha256=j3K9ODSwOuP-tkie0o4fvkouEyDHhlX3Y2DH1zO58Eo,7287
|
|
6
6
|
fiqus/data/DataFiQuSConductor.py,sha256=uxPR3cN38Kf93EN339JegM5GCg5wBtbfzCI-qeByMAQ,2710
|
|
7
|
-
fiqus/data/DataFiQuSConductorAC_Strand.py,sha256=
|
|
7
|
+
fiqus/data/DataFiQuSConductorAC_Strand.py,sha256=dKfhrlQFQTRjwGc57hwZgir6YshO4bttQQyJRwi1EoE,28474
|
|
8
8
|
fiqus/data/DataFiQuSMultipole.py,sha256=cKa4JTzYUfUcbruoyALE1tgIDTy8zYhRFJuKZnnFuhc,2403
|
|
9
9
|
fiqus/data/DataFiQuSPancake3D.py,sha256=-xW4neYKIf9_10kRM1h9Vq1GQcrTQV1ABxiHw4ZT3tk,115543
|
|
10
10
|
fiqus/data/DataMultipole.py,sha256=Ai-z_Ux2iLxZPnHvCDneeUWxeOlfQEbVa74r_Il9ym0,2304
|
|
@@ -40,7 +40,7 @@ fiqus/parsers/ParserPOS.py,sha256=hO4mLneIuSvX-Gaqeke27OLgnCfzNvg4E_9r6nFr6Wg,10
|
|
|
40
40
|
fiqus/parsers/ParserRES.py,sha256=782GouJaw0j5u1RLGag6FauSUTuKV7gKa1G4EowSKBE,5984
|
|
41
41
|
fiqus/parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
42
|
fiqus/plotters/PlotPythonCCT.py,sha256=YgphOuiTk0klqZh4d4u81hahtiDp-tx149EpBjyKH-Y,6333
|
|
43
|
-
fiqus/plotters/PlotPythonConductorAC.py,sha256=
|
|
43
|
+
fiqus/plotters/PlotPythonConductorAC.py,sha256=Vk4_Cdq7coL1moJWGYxHn9eGDfDdXL1la90x0-Inzus,46320
|
|
44
44
|
fiqus/plotters/PlotPythonMultipole.py,sha256=SjJQKHX5mUoMW3yli97W6Kja0Hux8C16YE1U22hQRHY,481
|
|
45
45
|
fiqus/plotters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
46
46
|
fiqus/post_processors/PostProcessCCT.py,sha256=-lao2mxHRJNuLSqP2pdiXAIvLxdAw0e5NNEbTfhDQs0,28443
|
|
@@ -73,7 +73,7 @@ tests/utils/fiqus_test_classes.py,sha256=Il8T-Bz1WNJhOrTBFHNoRRr_QXQzzprZu9Y8SXR
|
|
|
73
73
|
tests/utils/generate_reference_files_ConductorAC.py,sha256=_jEE6xcqiz52bnmY6Is11QmG-bZ2vdH0k99p733t4N4,1676
|
|
74
74
|
tests/utils/generate_reference_files_Pancake3D.py,sha256=ufELeL8WMoWZFcOkVxR7w5OHCgIQ4Z3cLcXM-LtgvmM,3314
|
|
75
75
|
tests/utils/helpers.py,sha256=BQxdHr8N4rGXc2C_YNEeOXxTIDJSUeRyyxLkvWfhiJY,4149
|
|
76
|
-
fiqus-2024.
|
|
77
|
-
fiqus-2024.
|
|
78
|
-
fiqus-2024.
|
|
79
|
-
fiqus-2024.
|
|
76
|
+
fiqus-2024.7.0.dist-info/METADATA,sha256=n5SENlrvP0jQQaWKzwYqS5WXRPzFziT8CxzCP8t-9cY,4914
|
|
77
|
+
fiqus-2024.7.0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
78
|
+
fiqus-2024.7.0.dist-info/top_level.txt,sha256=oGzSIyoVc1zYg14o67zI3QFwWsJvqNzNT0-te9WbUQc,12
|
|
79
|
+
fiqus-2024.7.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|