-
Notifications
You must be signed in to change notification settings - Fork 72
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
Refactoring, StateObserver and Python Tooling #229
Conversation
_default_nominal_values = dict(omega=300, torque=16.0, i=97, i_a=97, i_e=97, u=60, u_a=60, u_e=60) | ||
_default_limits = dict(omega=400, torque=38.0, i=210, i_a=210, i_e=210, u=60, u_a=60, u_e=60) |
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.
Should one specify all these values as floats by putting ".0" behind them?
(Applies to several files)
[ | ||
0, | ||
-mp["r_s"] / sigma, | ||
0, | ||
mp["l_m"] * mp["r_e"] / (sigma * mp["l_e"]), | ||
1 / sigma, | ||
0, | ||
-mp["l_m"] / (sigma * mp["l_e"]), | ||
0, | ||
mp["l_q"] * mp["p"] / sigma, | ||
0, | ||
], | ||
[ | ||
0, | ||
0, | ||
-mp["r_s"], | ||
0, | ||
0, | ||
1, | ||
0, | ||
-mp["l_d"] * mp["p"], | ||
0, | ||
-mp["p"] * mp["l_m"], | ||
], | ||
[ | ||
0, | ||
mp["l_m"] * mp["r_s"] / (sigma * mp["l_d"]), | ||
0, | ||
-mp["r_e"] / sigma, | ||
-mp["l_m"] / (sigma * mp["l_d"]), | ||
0, | ||
1 / sigma, | ||
0, | ||
-mp["p"] * mp["l_m"] * mp["l_q"] / (sigma * mp["l_d"]), | ||
0, | ||
], | ||
[mp["p"], 0, 0, 0, 0, 0, 0, 0, 0, 0], |
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.
On the one hand, I get that the formatter prefers this shape of code.
On the other hand, the matrix calculations involved have been more intuitive the way it was before refactoring.
I guess this needs further discussion.
(Applies to several files)
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.
Yea, formating should definitely be disabled for this kind of calucations.
Leaving this here for future reference:
# fmt: off
def my_unformatted_function():
do_something()
# fmt: on
_t23 = 2 / 3 * np.array([ | ||
[1, -0.5, -0.5], | ||
[0, 0.5 * np.sqrt(3), -0.5 * np.sqrt(3)] | ||
]) | ||
_t23 = 2 / 3 * np.array([[1, -0.5, -0.5], [0, 0.5 * np.sqrt(3), -0.5 * np.sqrt(3)]]) |
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.
Same issue. The formatter made the code less understandable (in my opinion).
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.
No further objections apart from my earlier minor remarks.
An execution test will follow.
I was not successful to run the unit tests locally: Did I miss an optional install or is something missing from the requirements? |
I will look into it on Thursday. |
Integration test still fails on my machine, all other tests seems successful. Also, GitHub still reports Version 3.8 to have failing tests. Formatting issues persist and make it hard to read coded matrices. |
Important files:
[2.0.1] - Unreleased
Added
Changed
Fixed