From 9cc5a4d3f697fa974af17865b31b28d981550070 Mon Sep 17 00:00:00 2001 From: Yash-10 Date: Mon, 29 Nov 2021 15:16:34 +0530 Subject: [PATCH 1/2] Change id_type default to None --- src/poliastro/ephem.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/poliastro/ephem.py b/src/poliastro/ephem.py index 38c7309ca..628682fdc 100644 --- a/src/poliastro/ephem.py +++ b/src/poliastro/ephem.py @@ -247,13 +247,13 @@ def from_horizons( *, attractor=None, plane=Planes.EARTH_EQUATOR, - id_type="smallbody", + id_type=None, ): """Return `Ephem` for an object using JPLHorizons module of Astroquery. Parameters ---------- - name : string + name : str Name of the body to query for. epochs: ~astropy.time.Time Epochs to sample the body positions. @@ -262,9 +262,9 @@ def from_horizons( if not given the Solar System Barycenter will be used. plane : ~poliastro.frames.Planes, optional Fundamental plane of the frame, default to Earth Equator. - id_type : str, optional - Use "smallbody" for Asteroids and Comets (default), and "majorbody" - for Planets and Satellites. + id_type : NoneType or str, optional + Use "smallbody" for Asteroids and Comets and None (default) to first + search for Planets and Satellites. """ if epochs.isscalar: From 581cc7cc72e58c8a2c20ca1983bcd2a9c27e3f92 Mon Sep 17 00:00:00 2001 From: Yash-10 Date: Mon, 29 Nov 2021 15:16:53 +0530 Subject: [PATCH 2/2] Use None id_type --- tests/tests_twobody/test_orbit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests_twobody/test_orbit.py b/tests/tests_twobody/test_orbit.py index 92e319c59..2dbb56a7f 100644 --- a/tests/tests_twobody/test_orbit.py +++ b/tests/tests_twobody/test_orbit.py @@ -1245,7 +1245,7 @@ def test_can_set_iss_attractor_to_earth(): # See https://github.com/poliastro/poliastro/issues/798 epoch = Time("2019-11-10 12:00:00") ephem = Ephem.from_horizons( - "International Space Station", epochs=epoch, attractor=Sun, id_type="majorbody" + "International Space Station", epochs=epoch, attractor=Sun, id_type=None ) iss = Orbit.from_ephem(Sun, ephem, epoch) iss = iss.change_attractor(Earth)