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
Fixed warnings in test_utils.py #394
Conversation
It is not much but I noticed it so I just changed it.
Codecov Report
@@ Coverage Diff @@
## master #394 +/- ##
==========================================
- Coverage 89.08% 88.87% -0.21%
==========================================
Files 23 23
Lines 5376 5393 +17
Branches 695 696 +1
==========================================
+ Hits 4789 4793 +4
- Misses 406 415 +9
- Partials 181 185 +4
|
fixed warring in test_utils.py
Hi @Shadow2121 , Thank you for creating this PR. Your changes look good to me. 👍 |
Hi @Shadow2121, Thanks for the update, I will test the tutorial today and come back to you. Thanks |
Hi @skoudoro If we change the equation in tutorial then we also need to update And also need to update:
in this increase |
Updated some values because we changed equation.
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 @Shadow2121,
Thank you for the update. See below for some comments.
As review suggested, changed some code.
Now, the path will update every call back.
Hello @skoudoro, In this last commit I changed the call-back function, now it will update path every call-back. So there no need to update (show) path after certain time. DEMO.mp4 |
Hi @Shadow2121, Thank you for the update. The creator of this tutorial chooses to update (show) path /orbit after a certain time for improving performance and saving memory at the beginning. Could you look at this improvement? Thank you |
As suggested in review, now we are displaying the path/orbit before animation starts.
Hello @Shadow2121! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-04-15 03:54:54 UTC |
Hi @skoudoro, instead of using line actor I used |
Hi @Shadow2121, You can use |
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.
2 more comments to improve the tutorial.
you are close to being done! thank you!
for i in range(2200): | ||
calculate_path(r_mercury, mercury_track, i) | ||
calculate_path(r_venus, venus_track, i) | ||
calculate_path(r_earth, earth_track, i) | ||
calculate_path(r_mars, mars_track, i) | ||
calculate_path(r_jupiter, jupiter_track, i) | ||
calculate_path(r_saturn, saturn_track, i) | ||
calculate_path(r_uranus, uranus_track, i) | ||
calculate_path(r_neptune, neptune_track, i) | ||
|
||
update_track(positions_mercury, mercury_track, mercury_orbit_actor) | ||
|
||
update_track(positions_venus, venus_track, venus_orbit_actor) | ||
|
||
update_track(positions_earth, earth_track, earth_orbit_actor) | ||
|
||
update_track(positions_mars, mars_track, mars_orbit_actor) | ||
|
||
update_track(positions_jupiter, jupiter_track, jupiter_orbit_actor) | ||
|
||
update_track(positions_saturn, saturn_track, saturn_orbit_actor) | ||
|
||
update_track(positions_uranus, uranus_track, uranus_orbit_actor) | ||
|
||
update_track(positions_neptune, neptune_track, neptune_orbit_actor) | ||
|
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.
this block can be reduced with 3-4 lines of code which avoids duplication.
- use
zip
- call
calculate_path
andupdate_track
only once in your loop - pass 2200 in your
calculate_path
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.
If i use line actor then there is no need for update_track
,
@@ -183,7 +183,7 @@ def get_orbit_actor(orbit_points): | |||
# orbit actors into the scene. Also initialize the track variables for each | |||
# planet. | |||
|
|||
orbit_points = np.zeros((2001, 3), dtype='f8') | |||
orbit_points = np.zeros((2200, 3), dtype='f8') |
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.
Can you replace f8
by float
? Thank you.
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.
Done, and sorry about that.
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 @Shadow2121,
thanks for the update.
- Some of my comments are not addressed
- pep8 isssue are not addressed
- the tutorial needs cleaning. many objects are not needed anymore like all orbital actors.
Some changes according reviews.
Hi @skoudoro, Sorry about that, And
|
Made some changes in documentation since changed so many code.
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.
[ Done ] many objects are not needed anymore like all orbital actors.
There are still some useless text or functions like get_orbital_actor
. Please, review completely the tutorial
[ Done ] pep8 isssue are not addressed
There is still some pep8 issue as you can see here.
Please, in general, try to pay more attention to details.
pass 2200 in your calculate_path -> For this I didn't get the point. If I pass 2200 to the function then it is not calculating for all points, it is doing calculation 2200 times for only one point.
Yes, this is why you will have to update calculate_path
function
Oh, that's my bad I really thought that PEP 8 comment will pop at the bottom of our conversation, I will keep that in mind.
Thank you |
change according the review.
On my system(windows 10 64-bit) for different versions of python (3.7.0, 3.7.9, 3.9.1), I always get @Nibba2018 @skoudoro, do you guys still have the visual bug? |
I do not have any the bug. There is still some work to do in this tutorial. But ok, we can merge this second version as it is. We will need to create a third version to reduce code duplication. Thanks @Shadow2121 |
I dont have that visual bug either 👍 |
I did try in multiple Linux distributions (Arch-based and Debian-based) with different python versions (3.7.3, Anaconda 3.7.7, and 3.7.8).
I don't think adjusting the code duplication will take too much time/effort, so, why not do it now? |
Good question and I will let @Shadow2121 answer it |
Ok I will do it. But till now are there any major mistakes that I made that need to be changed. |
Reduced some repetitive code. and some more changes like list name changed.
If there is any changes please let me know.
@skoudoro @guaje @Nibba2018 can you guys help? Are there any more changes that need to be done? |
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 @Shadow2121,
Thank you for the update. See below for some ideas to improve your version.
you are closer to the end of this PR!
Did some changes as per review.
Thank you very much for all your help. Done all the changes you mentioned. |
It was raising the warning.
Changed
|
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.
Thanks, @Shadow2121! The code looks way better. I just added a couple of suggestions to improve the readability of the tutorial.
Some more changes according to review.
@guaje, Thank you very much. |
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.
These new changes look good to me! Thanks, @Shadow2121
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 @Shadow2121,
Everything looks almost good. See below my comments. I think they are the last ones. When it is fixed, I can approve and merge this PR.
Thanks again!
Final touch to tutorial.
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.
Good job on the hard work. merging
Thank you :) |
fixed warning in test_utils.py.
warning was: #317
It is not much but I noticed it so I just changed it.
The equation looks like this in tutorial of solar system visualization,
link - https://en.wikipedia.org/wiki/Orbital_period