-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ECE EMag twin builder export #413
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #413 +/- ##
=======================================
Coverage 86.39% 86.39%
=======================================
Files 21 21
Lines 2366 2366
=======================================
Hits 2044 2044
Misses 322 322 |
…EMag_Twin_Builder_Export
…EMag_Twin_Builder_Export
…EMag_Twin_Builder_Export
Removed myself as a reviewer |
file_id = open(sml_file, "w") | ||
file_id.write("%6s\r\n" % "MODELDEF ECER_Model1") | ||
file_id.write("%6s\r\n" % "MODELDEF ECE_e8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we get this from the mot file name, instead of hard coding? (Will need to be careful of non-alphanumeric characters in the mot file name, as these may not be valid in the SML, for example spaces, special characters or non-ascii characters)
@@ -554,7 +718,7 @@ def read_parameters(json_file): | |||
file_id.write( | |||
"%6s\r\n" | |||
% ( | |||
"INTERN NDSRC PECER_Model1 N0:=GND," | |||
"INTERN NDSRC PECE_e8 N0:=GND," |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, could PECE_e8 be made less hard coded?
@@ -563,7 +727,7 @@ def read_parameters(json_file): | |||
"%6s\r\n" % " ( QUANT:={ AM0.I, AM1.I, AM2.I }," | |||
' SRC:={ isrc, isrc, isrc, isrc }, TableData:="\ ' | |||
) | |||
file_id.write("%6s" % ".MODEL ECER_Model1_table pwl TABLE=(") | |||
file_id.write("%6s" % ".MODEL ECE_e8_table pwl TABLE=(") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, could this be less hard coded?
…EMag_Twin_Builder_Export
and get the number of torque points per cycle from the JSON file.
Usability updates and additional detail added, restructuring of the example