-
Notifications
You must be signed in to change notification settings - Fork 17
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
Check if normal gravity is computed on internal point #83
Conversation
Fixed f-string is missing placeholders
Check if normal gravity is computed on internal point #44. Use np.linalg.norm(height) because height can be an array.
Hi! I am back. I just wanted to make a pull request for my last commit, but I couldn't erase the past commits. This time I tried to follow more carefully the Contributing Guidelines. I ran checks format, check, lint and test. All of them appear successful. However, I am dubious about the solution I implemented using the norm. Maybe is a condition that is always true by definition of "norm"... so, I'll wait for your review. Thank you! |
HI @MGomezN! Thanks again for your contributions.
I'm not sure if I'm following you here. Have you tried to commit to your
I'm not entirely sure why are you checking if the norm of the height is greater than zero. Raising the warning if On #66 you also added the same check for the |
Thank you @santisoler
No. I didn't try to commit to my internal_point branch. I worked with internal_point branch almost six months ago, and by that time, I had a lot of trouble with the environment, and also I made a reset of my PC. Therefore It seemed easier to start everything from zero last week when I resume my work on this issue. So, I closed my pull request related to the internal_point branch, and actually, I erased my fork of the Boule repository, and I started everything from the beginning: clone, fork, Install environment, and so on. I incorporated comments from Leonardo made on the internal_point branch, and as a result, I created commit 9b71364. But… I forgot to run make format, make check, make linnet, so I did it. I discovered one error, I repaired that error, and then I created commit bd0dcd7.
Again, I forgot to ran the make test, I did it, and there was a new error saying height <0 is not ok because height could be an array, not just a scalar, so I tried to use the norm of the array “height,” and that was mi final commit a0a2239 So, I wanted to erase commits 9b71364 and bd0dcd7 because I know (now) they were incomplete. The most complete is commit a0a2239.
Ups, see? Not too much focus in my head. Yes, I want to change the Sphere class also. |
No big deal then! Just wanted to know if you were experiencing technical issues or if you willingly started again from scratch.
You are absolutely right! We cannot use
We virtually never delete a commit, as I said before, the best practice is to add a new commit that fixes the mistakes of the previous ones. Think of git as a journey: you know where you started and you know where you are right now, but you cannot erase all the points in the middle, because they took you where you are right now.
No problem! Feel free to finish the warning on |
Use np.any(height) instead of np.linalg.norm(height)
Use np.any(height < 0)
Hello @santisoler. I tried your suggestion in commit 8b48925
I understand. Looking forward to squash and merge all my mistakes jeje
I think it works now. I only feel insecure about the place where I wrote the warning (under de def of normal_gravity). I don't know if it must be written before, for example, after line 97, where are those bunch of |
😂
The warning is coded in the perfect spot. The requirement of Would you like to start writing a test function that checks if the warning is raised after passing a negative height? boule/boule/tests/test_ellipsoid.py Lines 59 to 67 in 145384d
If you need any help, please feel free to ask! |
Thank you @santisoler . I added the test and the warning for boule.Sphere.normal_gravity() in commit 1f6f555. Fingers cross! |
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 is looking awesome! I think we can merge it after a few minor changes.
I left a minor suggestion to remove the empty line on the method. Feel free to commit that suggestion (you can do that by pressing the Commit button on the comment).
Since you had to change the height < 0
check for the np.any(height < 0)
in order to support height
as an array, would you like to add a similar check on the same test function but now passing latitude
and height
as Numpy arrays?
I've also copied the TODO list on the PR description so we don't forget to do some things that are required before merging. I think you just need to add your name to the AUTHORS.md
file in case you want your name to appear on every Zenodo release (this is optional). Read our AUTORSHIP.md
file if you want to know more about how we handle authorship in Fatiando.
Co-authored-by: Santiago Soler <[email protected]>
Co-authored-by: Santiago Soler <[email protected]>
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 @MGomezN thank you so much for implementing this! I'm sorry this took so long. I just fixed a very minor typo in the warning message ("major" -> "greater than"; it's the same in portuguese so I always got these wrong as well 🙂).
Merging this in as soon as the CI tests pass!
Please feel free to open a new PR adding yourself to the AUTHORS.md file! You've more than earned it 🙂
And a big thank you to @santisoler for providing brilliant guidance here (as always) 🎉 |
🎉🎉🎉 Congrats on merging your first pull request and welcome to the team! 🎉🎉🎉 If you would like to be added as a author on the Zenodo archive of the next release, make sure that you have added your full name, affiliation, and ORCID (optional) to the We hope that this was a good experience for you. Let us know if there is any way that the contributing process could be improved. |
Thanks, @santisoler @leouieda, for such an amazing demonstration of patience with me. I can't believe this pull request has been approved... |
Thank you for the patience with us (me mostly) 🙂 Again, I'm really sorry for letting this stall for so long. |
Fixes #44
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
and the base__init__.py
file for the package.AUTHORS.md
file (if you haven't already) in case you'd like to be listed as an author on the Zenodo archive of the next release.