-
Notifications
You must be signed in to change notification settings - Fork 111
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
Dev poisson ratio warning #26
Conversation
We changed the np.float in the code to np.float64 since numpy will stop using np.float in future relases.
This commit fixes some of the Elastica test function warnings. Previously we named a dummy rod as a TestRod, which was assumed by pytests as a test function and a warninig is raised. We rename the class as DummyTestRod.
…ear modulus This commit changes the elastica rod initialization such that if user does not pass shear modulus as an argument during the initialization of rod then a warning message raised. We also changed the necessary test functions according to new warning and add more test functions.
With this commit during the initialization step of cosserat rods, we remove the poisson ratio and use shear modulus.
…ved to other function. This commit adds a new function which contains the warning functions of the shear modulus and poisson ratio, since allocate function was very complex previously.
Codecov Report
@@ Coverage Diff @@
## master #26 +/- ##
==========================================
+ Coverage 90.57% 90.63% +0.05%
==========================================
Files 58 58
Lines 3131 3150 +19
Branches 227 337 +110
==========================================
+ Hits 2836 2855 +19
Misses 272 272
Partials 23 23
Continue to review full report at Codecov.
|
elastica/rod/factory_function.py
Outdated
|
||
message = ( | ||
"Shear modulus cannot be found in kwargs. \n" | ||
"Poisson ratio " |
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.
I would suggest the warning being:
"The given Poisson ratio of "+ str(poisson_ratio) + " is used only to compute a shear modulus of " + str(shear_modulus) + ", " "using the equation: shear_modulus = youngs_modulus / (poisson_ratio + 1.0). Use of a Poisson ratio will be depreciated in a future release. It is encouraged that you discontinue using a Poisson ratio and instead directly provide the shear_modulus"
elastica/rod/factory_function.py
Outdated
if kwargs.__contains__("poisson_ratio"): | ||
poisson_ratio = kwargs.get("poisson_ratio") | ||
message = ( | ||
" Poisson ratio ( " |
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.
I would suggest:
"Both a Poisson ratio and a shear modulus are provided. The Poisson ratio is only used to compute a shear modulus so the provided Poisson ratio of ( "+ str(poisson_ratio)+ " ) is being ignored in favor of the provided shear modulus ( "+ str(shear_modulus)+ " ) \n"
@armantekinalp I made two suggestions to changing the warnings to hopefully make them a bit more clear. Let me know what you think. |
This commit updates the warning messages for `get_shear_modulus` function.
I made the changes and merging to the master. |
shear modulus
then warning messages will be raised andshear modulus
will be computed based onPoisson Ratio
.