-
Notifications
You must be signed in to change notification settings - Fork 13
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
Allow length greater than 10m #11
Conversation
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.
Hi Pedro!
Thanks for taking the time for testing this package, and fixing a rookie mistake that slipped through the cracks. Your solution is very good, but I would like to suggest a small modification (only if you agree), and then I will merge it right away and update the package on pip.
I would like to preserve the upper limit of 10k points on the x-axis of the plots (which I think is an overkill already), so the code will not take extremely long in case someone picks a beam length of, say, 100m. So I propose changing line 307 in beambending/beam.py
to something like:
x_vec = np.linspace(self._x0, self._x1, int(min((self.length) * 1000 + 1), 1e4))
I can take care of it if you are too busy, but I thought it would be nice to keep your contribution on the record since you took the time for sending it.
Regards,
-Alfredo
Hi @alfredocarella, thanks for the kind words. Now I understand the reason of the limit. However, the suggestion you made is exactly what it was before, will limit to 10m. Could we keep at 100m? I can change to: --- x_vec = np.linspace(self._x0, self._x1, int(min((self.length) * 1000 + 1), 1e4))
+++ x_vec = np.linspace(self._x0, self._x1, min(int((self.length) * 1000 + 1), 1e5)) Would it be ok? I agree that not having a limit is not ideal (as I initially proposed). About the new example, is there something you would like me to change? The numbers were quite random. |
Sorry @PedroBern, I made a mistake with the parenthesis in my suggestion. Let me try to be more precise: ORIGINAL CODE (with bug): MY FIRST (incorrect) PROPOSAL: A POTENTIAL FIX: |
I was misunderstanding the code. Now I see that x_vex is about the resolution, not the actual length! My bad. Thanks for explaining to me. Ok, Already did the changes locally, it is passing the tests, but before I send the PR, about the example 4, would you like me to change something? |
I think example 4 is ok. You can leave it as is, or remove it if you don't believe it adds much information on top of example 1. I can accept both options, so I will leave it up to you. |
Fix #10