SEMAFORInformatik / femagtools

Python API for FEMAG
BSD 2-Clause "Simplified" License
19 stars 13 forks source link

Replace ValueError by KeyError in SynchronousMachineLdq #87

Closed fboige closed 2 months ago

fboige commented 3 months ago

In the SynchronousMachineLdq.init() code, if the losses key is missing in the eecpars dict, a KeyError is raised and not a ValueError. The ValueError in line 744 of machine/sm.py need to replaced with a KeyError. This was fixed in all other Machine classes.

Side note, the class name is misleading as one can think that the class will expect Ld/Lq/psim maps as an argument while the class needs psid/psiq maps. The only difference in the 2 classes (SynchronousMachineLdq and SynchronousMachinePsidq) are the map coordinates. Maybe rename the classes as SynchronousMachineI1Beta and SynchronousMachineIdIq.

EDIT: in sm.py, in the characteristics() method, the self.betarange var is used while it does not exists in the SynchronousMachinePsidq class object.

Thanks,

Francois

dapu commented 2 months ago

fixed in the dev branch.