Skip to content

Commit

Permalink
[CC] various cleaning + scidatatool version update
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileDvs committed Dec 3, 2021
1 parent d52a506 commit 1d0259c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 23 deletions.
10 changes: 5 additions & 5 deletions pyleecan/Classes/Class_Dict.json
Original file line number Diff line number Diff line change
Expand Up @@ -13611,7 +13611,7 @@
"path": "pyleecan/Generator/ClassesRef/Simulation/VarLoad.csv",
"properties": [
{
"desc": "Operating point matrix (N0,I0,Phi0,T,P) or (N0,Id,Iq,T,P) ",
"desc": "Operating point matrix (N0,I0,Phi0,T,P) or (N0,Id,Iq,T,P) or (N0,U0,s,T,P)",
"max": "",
"min": "",
"name": "OP_matrix",
Expand All @@ -13620,8 +13620,8 @@
"value": null
},
{
"desc": "Select which kind of OP_matrix is used 0: (N0,I0,Phi0,T,P), 1:(N0,Id,Iq,T,P) ",
"max": "1",
"desc": "Select which kind of OP_matrix is used 0: (N0,I0,Phi0,T,P), 1:(N0,Id,Iq,T,P), 2:(N0,U0,s,T,P)",
"max": "2",
"min": "0",
"name": "type_OP_matrix",
"type": "int",
Expand All @@ -13635,7 +13635,7 @@
"name": "is_torque",
"type": "bool",
"unit": "-",
"value": false
"value": 0
},
{
"desc": "True if the Power is defined in OP_matrix",
Expand All @@ -13644,7 +13644,7 @@
"name": "is_power",
"type": "bool",
"unit": "",
"value": false
"value": 0
}
]
},
Expand Down
8 changes: 4 additions & 4 deletions pyleecan/Classes/VarLoad.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def _set_OP_matrix(self, value):
OP_matrix = property(
fget=_get_OP_matrix,
fset=_set_OP_matrix,
doc=u"""Operating point matrix (N0,I0,Phi0,T,P) or (N0,Id,Iq,T,P)
doc=u"""Operating point matrix (N0,I0,Phi0,T,P) or (N0,Id,Iq,T,P) or (N0,U0,s,T,P)
:Type: ndarray
""",
Expand All @@ -293,17 +293,17 @@ def _get_type_OP_matrix(self):

def _set_type_OP_matrix(self, value):
"""setter of type_OP_matrix"""
check_var("type_OP_matrix", value, "int", Vmin=0, Vmax=1)
check_var("type_OP_matrix", value, "int", Vmin=0, Vmax=2)
self._type_OP_matrix = value

type_OP_matrix = property(
fget=_get_type_OP_matrix,
fset=_set_type_OP_matrix,
doc=u"""Select which kind of OP_matrix is used 0: (N0,I0,Phi0,T,P), 1:(N0,Id,Iq,T,P)
doc=u"""Select which kind of OP_matrix is used 0: (N0,I0,Phi0,T,P), 1:(N0,Id,Iq,T,P), 2:(N0,U0,s,T,P)
:Type: int
:min: 0
:max: 1
:max: 2
""",
)

Expand Down
8 changes: 4 additions & 4 deletions pyleecan/Generator/ClassesRef/Simulation/VarLoad.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Variable name,Unit,Description (EN),Size,Type,Default value,Minimum value,Maximum value,,Package,Inherit,Methods,Constant Name,Constant Value,Class description
OP_matrix,-,"Operating point matrix (N0,I0,Phi0,T,P) or (N0,Id,Iq,T,P) ","(Nsimu, 5)",ndarray,None,,,,Simulation,VarSimu,get_ref_simu_index,VERSION,1,Abstract class to generate multi-simulation by changing the operating point
type_OP_matrix,-,"Select which kind of OP_matrix is used 0: (N0,I0,Phi0,T,P), 1:(N0,Id,Iq,T,P) ",,int,0,0,1,,,,,NAME,"""Variable Load""",
is_torque,-,True if the Torque is defined in OP_matrix,,bool,False,,,,,,,,,
is_power,,True if the Power is defined in OP_matrix,,bool,False,,,,,,,,,
OP_matrix,-,"Operating point matrix (N0,I0,Phi0,T,P) or (N0,Id,Iq,T,P) or (N0,U0,s,T,P)","(Nsimu, 5)",ndarray,None,,,,Simulation,VarSimu,get_ref_simu_index,VERSION,1,Abstract class to generate multi-simulation by changing the operating point
type_OP_matrix,-,"Select which kind of OP_matrix is used 0: (N0,I0,Phi0,T,P), 1:(N0,Id,Iq,T,P), 2:(N0,U0,s,T,P)",,int,0,0,2,,,,,NAME,"""Variable Load""",
is_torque,-,True if the Torque is defined in OP_matrix,,bool,0,,,,,,,,,
is_power,,True if the Power is defined in OP_matrix,,bool,0,,,,,,,,,
11 changes: 2 additions & 9 deletions pyleecan/Methods/Output/OutMag/store.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from numpy import max as np_max, min as np_min, mean as np_mean

from SciDataTool import DataTime, VectorField, Data1D
from SciDataTool import DataTime, VectorField

from ....Functions.Winding.gen_phase_list import gen_name
from ....Functions.labels import STATOR_LAB


Expand Down Expand Up @@ -103,14 +102,8 @@ def store(self, out_dict, axes_dict):
for key, phi_wind in out_dict["Phi_wind"].items():
# Store stator winding flux
lam = machine.get_lam_by_label(key)
qs = lam.winding.qs

Phase = Data1D(
name="phase",
unit="",
values=gen_name(qs),
is_components=True,
)
Phase = self.parent.elec.axes_dict["phase_" + key]
prefix = "Stator" if lam.is_stator else "Rotor"

# Store winding flux linkage per phase and per slice (in Weber per meter)
Expand Down
5 changes: 5 additions & 0 deletions pyleecan/Methods/Simulation/EEC_PMSM/comp_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def comp_parameters(
):
"""Compute the parameters dict for the equivalent electrical circuit:
resistance, inductance and back electromotive force
Parameters
----------
self : EEC_PMSM
Expand All @@ -18,6 +19,10 @@ def comp_parameters(
Average stator temperature
Trot : float
Average rotor temperature
Id_array : ndarray
Array of Id currents for vectorized calculation
Iq_array : ndarray
Array of Iq currents for vectorized calculation
"""

if self.parameters is None:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pytest-qt>=3.3.0
pyuff>=1.25
pyvista>=0.25.3
quadpy
SciDataTool>=1.4.18
SciDataTool>=1.4.23
scipy>=1.4.1
setuptools
swat_em>=0.6.3
Expand Down

0 comments on commit 1d0259c

Please sign in to comment.