Skip to content

Commit e38bb84

Browse files
author
abujazar
committed
fixing pycodestyle
1 parent f0ddd9e commit e38bb84

11 files changed

Lines changed: 225 additions & 303 deletions

femmt/component.py

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3000,7 +3000,8 @@ def get_inductance_from_reluctance(self):
30003000
def get_capacitance_of_inductor_component(self, freq_for_mesh: float = 0.0, show_visual_outputs: bool = False, plot_interpolation: bool = False,
30013001
show_fem_simulation_results: bool = False, benchmark: bool = False, save_to_excel: bool = False):
30023002
"""
3003-
Function for finding parasitic capacitance of an inductor. A represent the first turn, B represents the last turn. e represents the core.
3003+
Needed for finding parasitic capacitance of an inductor. A represent the first turn, B represents the last turn. e represents the core.
3004+
30043005
A--.------.---A
30053006
| |
30063007
| |
@@ -3073,14 +3074,24 @@ def get_capacitance_of_inductor_component(self, freq_for_mesh: float = 0.0, show
30733074
return c_vec
30743075

30753076
def get_stray_capacitance_of_inductor_component(self, freq_for_mesh: float = 0.0, show_visual_outputs: bool = False, plot_interpolation: bool = False,
3076-
show_fem_simulation_results: bool = True,
3077-
benchmark: bool = False,
3078-
save_to_excel: bool = False):
3077+
show_fem_simulation_results: bool = True, benchmark: bool = False, save_to_excel: bool = False):
30793078
"""
30803079
Compute the stray (parasitic) capacitance of an inductor via a single electrostatic simulation.
3081-
Assumes a 1V potential applied across the windings. The effect of the core is ignored.
3082-
"""
30833080
3081+
Assumes a 1V potential applied across the windings. The effect of the core is ignored.
3082+
:param freq_for_mesh: the frequency is used here for generating the mesh
3083+
:type freq_for_mesh: float = 0.0
3084+
:param show_visual_outputs: show the electrostatic model before simulation
3085+
:type show_visual_outputs: bool, optional
3086+
:param plot_interpolation: if True, plot the interpolation between the provided values for the material.
3087+
:type plot_interpolation: bool
3088+
:param show_fem_simulation_results: if True, show the simulation results after the simulation has finished
3089+
:type show_fem_simulation_results: bool
3090+
:param benchmark: Benchmark simulation (stop time). Defaults to False.
3091+
:type benchmark: bool
3092+
:param save_to_excel: save the result to exel file.
3093+
:type save_to_excel: bool
3094+
"""
30843095
# Define terminal voltages for the simulation
30853096
v_a = 1
30863097
v_b = 0
@@ -3126,10 +3137,11 @@ def get_stray_capacitance_of_inductor_component(self, freq_for_mesh: float = 0.0
31263137
return c_ab_stray
31273138

31283139
def get_capacitance_of_transformer(self, freq_for_mesh: float = 0.0, c_meas_open: float | None = None,
3129-
c_meas_short: float | None = None, measured_capacitances: tuple | list | None = None, flip_the_sec_terminal: bool = False,
3130-
show_visual_outputs: bool = False, plot_interpolation: bool = False, show_fem_simulation_results: bool = False,
3131-
benchmark: bool = False, save_to_excel: bool = False, show_plot_comparison: bool = True):
3132-
"""
3140+
c_meas_short: float | None = None, measured_capacitances: tuple | list | None = None,
3141+
flip_the_sec_terminal: bool = False, show_visual_outputs: bool = False, plot_interpolation: bool = False,
3142+
show_fem_simulation_results: bool = False, benchmark: bool = False, save_to_excel: bool = False,
3143+
show_plot_comparison: bool = True):
3144+
r"""
31333145
Get 10 parasitic capacitance of a transformer.
31343146
31353147
Perform 10 electrostatic simulations and calculate the 10 parasitic capacitance through W = 0.5 CV^2.
@@ -3156,8 +3168,8 @@ def get_capacitance_of_transformer(self, freq_for_mesh: float = 0.0, c_meas_open
31563168
:type c_meas_short: float
31573169
:param measured_capacitances: measured 10 capacitances provided by the user.
31583170
:type measured_capacitances: float
3159-
:param flag_cd: flip the terminal C and D of the secondary.
3160-
:type flag_cd: bool
3171+
:param flip_the_sec_terminal: flip the terminal C and D of the secondary.
3172+
:type flip_the_sec_terminal: bool
31613173
:param show_visual_outputs: show the electrostatic model before simulation
31623174
:type show_visual_outputs: bool, optional
31633175
:param plot_interpolation: if True, plot the interpolation between the provided values for the material.
@@ -3657,11 +3669,8 @@ def write_electro_magnetic_parameter_pro(self):
36573669
if self.v_core is not None:
36583670
text_file.write("v_core = {};\n".format(self.v_core))
36593671
text_file.write("Flag_excite_core = 1;\n")
3660-
# text_file.write("Flag_ground_core = 0;\n")
36613672
else:
3662-
text_file.write("Flag_ground_core = 1;\n")
3663-
# text_file.write("v_ground_core = 0;\n")
3664-
text_file.write("Flag_excite_core = 0;\n")
3673+
text_file.write("Flag_excite_core = 0;\n")
36653674

36663675
if self.v_ground_out_boundary == 0:
36673676
text_file.write("Flag_ground_OutBoundary = 1;\n")
@@ -3692,7 +3701,7 @@ def write_electro_magnetic_parameter_pro(self):
36923701
if self.insulation.er_layer_insulation is not None:
36933702
text_file.write(f"er_layer_insulation = {self.insulation.er_layer_insulation};\n")
36943703
else:
3695-
text_file.write(f"er_layer_insulation = 1.0;\n")
3704+
text_file.write("er_layer_insulation = 1.0;\n")
36963705
text_file.write(f"er_bobbin = {self.insulation.er_bobbin};\n")
36973706

36983707
# Material Properties
@@ -6585,7 +6594,6 @@ def femm_thermal_validation(self, thermal_conductivity_dict: dict, boundary_temp
65856594
input() # So the window stays open
65866595
# femm.closefemm()
65876596

6588-
65896597
@staticmethod
65906598
def encode_settings(o) -> dict:
65916599
"""Encode the magnetic component in a dictionary.

0 commit comments

Comments
 (0)