Skip to content
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

Improve error message for Orbit.from_body_ephem(Pluto) #612

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@Himanshu-Garg
Copy link
Contributor

commented Mar 18, 2019

as per issue #401
I have changed the error message which appear when Orbit.from_body_ephem(Object) runs with the name of the Object which is not there in the selected Ephemeris

such as pluto is not there in the default ephemeris,
so now it shows the following error message
KeyError - Wrong ephemeris selected, cannot load Pluto data, as Pluto is not a part of selected ephemeris. Do run this command before calling from_body_ephem ------> solar_system_ephemeris.set ('XXXXX') ------> where XXXXX contains the ephemeris having Pluto as one of its objects"

pls review #401

@Himanshu-Garg

This comment has been minimized.

Copy link
Contributor Author

commented Mar 18, 2019

its same as pull request #607
again attaching because by mistake, deleted the whole repo from my ID

@codecov

This comment has been minimized.

Copy link

commented Mar 18, 2019

Codecov Report

Merging #612 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #612      +/-   ##
==========================================
+ Coverage   85.03%   85.05%   +0.01%     
==========================================
  Files          51       51              
  Lines        2386     2388       +2     
  Branches      183      184       +1     
==========================================
+ Hits         2029     2031       +2     
  Misses        308      308              
  Partials       49       49
Impacted Files Coverage Δ
src/poliastro/twobody/orbit.py 90.24% <100%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b457cda...e3e1a27. Read the comment docs.

# TODO: https://github.com/poliastro/poliastro/issues/445

if (
body.name == "Pluto"

This comment has been minimized.

Copy link
@jorgepiloto

jorgepiloto Mar 19, 2019

Member

Thanks for the PR @Himanshu-Garg. As said in #401, for the case of the Moon same happens and therefore some message should be raised. The problem is that 'Moon' is included in both astropy ephemerides: builtin and de432s. So therefore, here is my code suggestion:

Suggested change
body.name == "Pluto"
body.name == "Moon"
or body.name.lower() not in solar_system_ephemeris.bodies
@Juanlu001

This comment has been minimized.

Copy link
Member

commented Mar 29, 2019

@Himanshu-Garg are you still working on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.