Skip to content
This repository was archived by the owner on Oct 14, 2023. It is now read-only.
This repository was archived by the owner on Oct 14, 2023. It is now read-only.

0.13.0: Test failure due to a unit problem #761

@olebole

Description

@olebole

🐞 Problem

When running the tests during build time, I get the following error:

_____________________ [doctest] poliastro.core.util.cross ______________________
143     b : ndarray
144         3 Dimension vector.
145 
146     Examples
147     --------
148     >>> from poliastro.core.util import cross
149     >>> from astropy import units as u
150     >>> i = [1, 0, 0] * u.m
151     >>> j = [0, 1, 0] * u.m
152     >>> cross(i, j)
UNEXPECTED EXCEPTION: TypeError('only dimensionless scalar quantities can be converted to Python scalars')
Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/astropy/units/quantity.py", line 715, in to_value
    scale = self.unit._to(unit)

  File "/usr/lib/python3/dist-packages/astropy/units/core.py", line 953, in _to
    "'{0!r}' is not a scaled version of '{1!r}'".format(self, other))

astropy.units.core.UnitConversionError: 'Unit("m2")' is not a scaled version of 'Unit(dimensionless)'

and similarly

/build/poliastro-0.13.0/.pybuild/cpython3_3.7/build/poliastro/core/util.py:152: UnexpectedException
______________________ [doctest] poliastro.core.util.norm ______________________
103     vec: ndarray
104         Dimension 3 vector.
105 
106 
107     Examples
108     --------
109     >>> from poliastro.core.util import norm
110     >>> from astropy import units as u
111     >>> vec = [1, 1, 1] * u.m
112     >>> norm(vec)
Expected:
    1.7320508075688772
Got:
    <Quantity 1.73205081 m>

/build/poliastro-0.13.0/.pybuild/cpython3_3.7/build/poliastro/core/util.py:112: DocTestFailure

Any idea here? Astropy version is 3.2.1.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions