Skip to content

Commit

Permalink
Merge pull request #480 from EOMYS-Public/Debug
Browse files Browse the repository at this point in the history
[CC] Updating Tutorials for release 1.3.7
  • Loading branch information
BonneelP authored Nov 26, 2021
2 parents f322b81 + 9176028 commit 8fc2bb0
Show file tree
Hide file tree
Showing 18 changed files with 333,636 additions and 1,497 deletions.
4,112 changes: 2,902 additions & 1,210 deletions Tutorials/tuto_Machine.ipynb

Large diffs are not rendered by default.

4,201 changes: 4,163 additions & 38 deletions Tutorials/tuto_MagnetostrictiveForces.ipynb

Large diffs are not rendered by default.

308 changes: 260 additions & 48 deletions Tutorials/tuto_MeshSolution.ipynb

Large diffs are not rendered by default.

18,968 changes: 18,911 additions & 57 deletions Tutorials/tuto_MultiSim.ipynb

Large diffs are not rendered by default.

8,431 changes: 8,396 additions & 35 deletions Tutorials/tuto_Operating_point.ipynb

Large diffs are not rendered by default.

2,264 changes: 2,247 additions & 17 deletions Tutorials/tuto_Optimization.ipynb

Large diffs are not rendered by default.

25,129 changes: 25,075 additions & 54 deletions Tutorials/tuto_Plots.ipynb

Large diffs are not rendered by default.

271,627 changes: 271,600 additions & 27 deletions Tutorials/tuto_Simulation_FEMM.ipynb

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions Tutorials/tuto_Skew.ipynb

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion pyleecan/Classes/Class_Dict.json
Original file line number Diff line number Diff line change
Expand Up @@ -7656,6 +7656,7 @@
"get_slip",
"get_Ud_Uq",
"set_Id_Iq",
"set_I0_Phi0",
"get_I0_Phi0"
],
"mother": "OP",
Expand Down Expand Up @@ -7718,7 +7719,8 @@
"get_Ud_Uq",
"set_Id_Iq",
"get_I0_Phi0",
"get_slip"
"get_slip",
"set_I0_Phi0"
],
"mother": "OP",
"name": "OPslip",
Expand Down
14 changes: 14 additions & 0 deletions pyleecan/Classes/OPdq.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
except ImportError as error:
set_Id_Iq = error

try:
from ..Methods.Simulation.OPdq.set_I0_Phi0 import set_I0_Phi0
except ImportError as error:
set_I0_Phi0 = error

try:
from ..Methods.Simulation.OPdq.get_I0_Phi0 import get_I0_Phi0
except ImportError as error:
Expand Down Expand Up @@ -116,6 +121,15 @@ class OPdq(OP):
)
else:
set_Id_Iq = set_Id_Iq
# cf Methods.Simulation.OPdq.set_I0_Phi0
if isinstance(set_I0_Phi0, ImportError):
set_I0_Phi0 = property(
fget=lambda x: raise_(
ImportError("Can't use OPdq method set_I0_Phi0: " + str(set_I0_Phi0))
)
)
else:
set_I0_Phi0 = set_I0_Phi0
# cf Methods.Simulation.OPdq.get_I0_Phi0
if isinstance(get_I0_Phi0, ImportError):
get_I0_Phi0 = property(
Expand Down
14 changes: 14 additions & 0 deletions pyleecan/Classes/OPslip.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
except ImportError as error:
get_slip = error

try:
from ..Methods.Simulation.OPslip.set_I0_Phi0 import set_I0_Phi0
except ImportError as error:
set_I0_Phi0 = error


from ._check import InitUnKnowClassError

Expand Down Expand Up @@ -125,6 +130,15 @@ class OPslip(OP):
)
else:
get_slip = get_slip
# cf Methods.Simulation.OPslip.set_I0_Phi0
if isinstance(set_I0_Phi0, ImportError):
set_I0_Phi0 = property(
fget=lambda x: raise_(
ImportError("Can't use OPslip method set_I0_Phi0: " + str(set_I0_Phi0))
)
)
else:
set_I0_Phi0 = set_I0_Phi0
# save and copy methods are available in all object
save = save
copy = copy
Expand Down
1 change: 1 addition & 0 deletions pyleecan/Generator/ClassesRef/Simulation/OPdq.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ Ud_ref,Vrms,d-axis voltage rms value,1,float,None,,,,,,get_N0,,,
Uq_ref,Vrms,q-axis voltage rms value,1,float,None,,,,,,get_slip,,,
,,,,,,,,,,,get_Ud_Uq,,,
,,,,,,,,,,,set_Id_Iq,,,
,,,,,,,,,,,set_I0_Phi0,,,
,,,,,,,,,,,get_I0_Phi0,,,
1 change: 1 addition & 0 deletions pyleecan/Generator/ClassesRef/Simulation/OPslip.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ U0_ref,Vrms,stator voltage (phase to neutral),,float,None,,,,,,get_Ud_Uq,,,
UPhi0_ref,rad,Voltage phase,,float,None,,,,,,set_Id_Iq,,,
,,,,,,,,,,,get_I0_Phi0,,,
,,,,,,,,,,,get_slip,,,
,,,,,,,,,,,set_I0_Phi0,,,
23 changes: 23 additions & 0 deletions pyleecan/Methods/Simulation/OPdq/set_I0_Phi0.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from numpy import exp


def set_I0_Phi0(self, I0, Phi0):
"""Set the value for I0 and IPhi0
Parameters
----------
self : OPdq
An OPdq object
I0 : float
I0 value to set [Arms]
Phi0 : float
IPhi0 value to set [rad]
"""

if I0 == 0:
self.Id_ref = 0
self.Iq_ref = 0
else:
Z = I0 * exp(1j * Phi0)
self.Id_ref = Z.real
self.Iq_ref = Z.imag
18 changes: 18 additions & 0 deletions pyleecan/Methods/Simulation/OPslip/set_I0_Phi0.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from numpy import exp


def set_I0_Phi0(self, I0, Phi0):
"""Set the value for I0 and IPhi0
Parameters
----------
self : OPslip
An OPslip object
I0 : float
I0 value to set [Arms]
Phi0 : float
IPhi0 value to set [rad]
"""

self.I0_ref = I0
self.IPhi0_ref = Phi0
2 changes: 1 addition & 1 deletion pyleecan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
else:
USER_DIR = os.environ["HOME"] + "/.local/share/" + PACKAGE_NAME

__version__ = "1.3.6"
__version__ = "1.3.7"

init_default_log()
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Release 1.1.0 : 1.1.0
# First post release of the release 1.1.0 : 1.1.0.post1

PYLEECAN_VERSION = "1.3.6"
PYLEECAN_VERSION = "1.3.7"


with open("README.md", "r") as fh:
Expand All @@ -43,7 +43,7 @@
"xlrd>=1.2.0",
"xlwt>=1.3.0",
"deap>=1.3.1",
"SciDataTool>=1.4.9",
"SciDataTool>=1.4.22",
"pyvista>=0.25.3",
"meshio>=4.0.15",
"h5py>=3.2.1",
Expand Down

0 comments on commit 8fc2bb0

Please sign in to comment.