question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Debian packaging of poliastro 0.10.0/0.11b1

See original GitHub issue

Hi,

as one of the affiliated packages, I am currently trying to package poliastro for Debian (from there it will migrate to Ubuntu, Mint etc.). For this, I have some questions, which don’t fit into your template (so I took the freedom to not use it 😉 )

The Debian package will have its own git repository, which basically has the latest poliastro release, and a debian/ subdirectory containing all Debian specific things (build and install instructions, patches etc.). I already created the first files there for initial tests.

  • Do I really need numba? Numba seems to be a flaky in Debian (has a number of RC bugs), so I would llike to avoid it as a strong dependency. Without numba, I get the following error (both 0.10 and 0.11b1):
_________________________ test_no_numba_emits_warning __________________________

recwarn = WarningsRecorder(record=True)

    def test_no_numba_emits_warning(recwarn):
>       with _fake_numba_import():

poliastro/tests/test_jit.py:54: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.7/contextlib.py:112: in __enter__
    return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    @contextmanager
    def _fake_numba_import():
[…]
>       del sys.modules['numba']
E       KeyError: 'numba'

poliastro/tests/test_jit.py:28: KeyError
  • Do I need jplephem? This is not in Debian yet, and it seems to be used only in test_pertubations.py (indirectly, via astropy.coordinates.solar_system_ephemeris). Removing the solar_system_ephemeris('de432s') calls just results in three failures due to the missing ~Moon~ Pluto (in 0.11b1) in the default approximation (which I could easily disable).

  • I get the following white space failure (both 0.10 and 0.11b1):

____________________ [doctest] poliastro.maneuver.Maneuver _____________________
012 Class to represent a Maneuver.
013 
014     Each ``Maneuver`` consists on a list of impulses \\(\\Delta v_i\\)
015     (changes in velocity) each one applied at a certain instant \\(t_i\\).
016     You can access them directly indexing the ``Maneuver`` object itself.
017 
018     >>> man = Maneuver((0 * u.s, [1, 0, 0] * u.km / u.s),
019     ... (10 * u.s, [1, 0, 0] * u.km / u.s))
020     >>> man[0]
Expected:
    (<Quantity 0 s>, <Quantity [1,0,0] km / s>)
Got:
    (<Quantity 0. s>, <Quantity [1., 0., 0.] km / s>)

/build/poliastro-0.10.0/.pybuild/cpython3_3.7/build/poliastro/maneuver.py:20: DocTestFailure
  • 
    
  • 
    
  • One import statement is missing in a doctest (only in 0.11b1):

__________________ [doctest] poliastro.twobody.angles.M_to_nu __________________
276     delta : float (optional)
277         threshold of near-parabolic regime definition (from Davide Farnocchia et al)
278     Returns
279     -------
280     nu : float
281         True anomaly (rad).
282 
283     Examples
284     --------
285     >>> nu = M_to_nu(np.radians(30.0), 0.06)
UNEXPECTED EXCEPTION: NameError("name 'np' is not defined")
Traceback (most recent call last):

  File "/usr/lib/python3.7/doctest.py", line 1329, in __run
    compileflags, 1), test.globs)

  File "<doctest poliastro.twobody.angles.M_to_nu[0]>", line 1, in <module>

NameError: name 'np' is not defined

/build/poliastro-0.11~b1/.pybuild/cpython3_3.7/build/poliastro/twobody/angles.py:285: UnexpectedException
  • Another missing import (only in 0.11b1):
_____________ [doctest] poliastro.twobody.orbit.Orbit.represent_as _____________
296             (859.07256, -4137.20368, 5295.56871)
297          (has differentials w.r.t.: 's')>
298         >>> iss.represent_as(CartesianRepresentation).xyz
299         <Quantity [  859.07256, -4137.20368,  5295.56871] km>
300         >>> iss.represent_as(CartesianRepresentation).differentials['s']
301         <CartesianDifferential (d_x, d_y, d_z) in km / s
302             (7.37289205, 2.08223573, 0.43999979)>
303         >>> iss.represent_as(CartesianRepresentation).differentials['s'].d_xyz
304         <Quantity [7.37289205, 2.08223573, 0.43999979] km / s>
305         >>> iss.represent_as(SphericalRepresentation)
UNEXPECTED EXCEPTION: NameError("name 'SphericalRepresentation' is not defined")
Traceback (most recent call last):

  File "/usr/lib/python3.7/doctest.py", line 1329, in __run
    compileflags, 1), test.globs)

  File "<doctest poliastro.twobody.orbit.Orbit.represent_as[6]>", line 1, in <module>

NameError: name 'SphericalRepresentation' is not defined

/build/poliastro-0.11~b1/.pybuild/cpython3_3.7/build/poliastro/twobody/orbit.py:305: UnexpectedException
  • And another doctest failure (both 0.10 and 0.11b1):
________________ [doctest] poliastro.twobody.orbit.Orbit.sample ________________
303         -----
304         When specifying a number of points, the initial and final
305         position is present twice inside the result (first and
306         last row). This is more useful for plotting.
307 
308         Examples
309         --------
310         >>> from astropy import units as u
311         >>> from poliastro.examples import iss
312         >>> iss.sample()
Expected nothing
Got:
    (<Time object: scale='utc' format='iso' value=['2013-03-18 11:48' '2013-03-18 11:48' '2013-03-18 11:49'
     '2013-03-18 11:50' '2013-03-18 11:51' '2013-03-18 11:52'
[… more, one entry each minute …]
     '2013-03-18 11:48']>, <CartesianRepresentation (x, y, z) in km
        [(-4136.38403782, -4179.52820669,  3358.86048469),
         (-3804.53435268, -4281.55527653,  3613.04813899),
[… more lines …]
         (-4136.38403782, -4179.52820669,  3358.86048469)]>)

/build/poliastro-0.10.0/.pybuild/cpython3_3.7/build/poliastro/twobody/orbit.py:312: DocTestFailure

Can you help me with that? And/or would you like to co-maintain or take over the packaging (I would gladly help with any problems that may appear)?

The current environment: Python 3.7 (and 3.6), numpy 1.14. [Update] I now upgraded to 0.11b1, and updated the list above accordingly.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
olebolecommented, Sep 19, 2018

I can confirm that the patches work very well. When I also remove the Pluto tests (see #458), all tests pass and the package builds nicely. So, I will just wait for the official release of 0.11 😉

1reaction
olebolecommented, Sep 17, 2018

That sounds like a very good plan to me! Thank you very much for helping me!

Read more comments on GitHub >

github_iconTop Results From Across the Web

DebianAstro/AstropyPackagingTutorial/Packaging - Debian Wiki
This is a tutorial how to create a Debian package Debian Astro. ... The standard git layout for debian packaging consists of three...
Read more >
Quickstart — poliastro 0.17.0 documentation
The core of poliastro are the Orbit objects inside the poliastro.twobody module. They store all the required information to define an orbit:.
Read more >
poliastro - Astrodynamics in Python — poliastro 0.17.0 ...
We are using your poliastro python package in designing and visualizing the trajectory from GEO into asteroid's orbit. Thank you for your work...
Read more >
What's new — poliastro 0.17.0 documentation
New recursive series Kepler solver for elliptical orbits poliastro.twobody.propagation.RecseriesPropagator based on Charls “Recursive solution ...
Read more >
API reference — poliastro 0.17.0 documentation
Among the different sub-packages and modules, we might differentiate two big categories: core utilities and high-level ones.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found