-
Notifications
You must be signed in to change notification settings - Fork 11
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
Update comp_function() to take in separate inputs #222
Conversation
Great! Like we expected, the laminate plate code is still failing. I think this should be an easy fix though; take a look at Line 412 of plane_laminate.py: Function(
lambda X: uniaxial_stress_limit(X),
make_names(Theta_nom),
list(itertools.chain.from_iterable([
["g_11_tension_{}".format(i),
"g_22_tension_{}".format(i),
"g_11_compression_{}".format(i),
"g_22_compression_{}".format(i),
"g_12_shear_{}".format(i)] for i in range(k)
])),
"limit states",
0
) We should be able to fix this by using a splat in the lambda function Function(
lambda *X: uniaxial_stress_limit(X),
make_names(Theta_nom),
list(itertools.chain.from_iterable([
["g_11_tension_{}".format(i),
"g_22_tension_{}".format(i),
"g_11_compression_{}".format(i),
"g_22_compression_{}".format(i),
"g_12_shear_{}".format(i)] for i in range(k)
])),
"limit states",
0
) This also suggests we can preserve old functionality if users define a lambda function using the * operator (which is something we can note in the docstring). Can you give this edit a try and re-push? |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #222 +/- ##
==========================================
- Coverage 76.83% 76.83% -0.01%
==========================================
Files 87 87
Lines 6740 6739 -1
==========================================
- Hits 5179 5178 -1
Misses 1561 1561
☔ View full report in Codecov by Sentry. |
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.
Great contribution! Some small changes necessary, and let's talk about updating the docstring for cp_function()
.
Found two methods of declaring multiple inputs in the functions of comp_function(), and have adjusted the test suite to only support one method. Going forward, each input must be declared as its own individual variable (not a single list to be iterated through). Updated docstrings still needed.
Ex.