trying to u.Quantity with a string, for example, u.Quantity([m42.ra, '']),
yields a TypeError:
print(u.Quantity([m42.ra, '']))
File "~/.local/lib/python3.8/site-packages/astropy/units/quantity.py", line 382, in __new__
raise TypeError("The value must be a valid Python or "
TypeError: The value must be a valid Python or Numpy numeric type.
this is exactly what happens in to_table() with transitions or unused slots
shown, because of the append append('') in scheduling.py.
so instead, do the u.Quantity conversion earlier where we know the type is
(should be!) a Numpy numeric (or other appropriate type).
this is, in a way, a rewrite of #370: really just moves the change there up a few lines. i tested that it works by hand on a table with TransitionBlock; what would yield the aforementioned TypeError on master now produces a table that can be printed:
trying to
u.Quantity
with a string, for example,u.Quantity([m42.ra, ''])
, yields aTypeError
:this is exactly what happens in
to_table()
with transitions or unused slots shown, because of the appendappend('')
inscheduling.py
.so instead, do the
u.Quantity
conversion earlier where we know the type is (should be!) a Numpy numeric (or other appropriate type).this is, in a way, a rewrite of #370: really just moves the change there up a few lines. i tested that it works by hand on a table with
TransitionBlock
; what would yield the aforementionedTypeError
onmaster
now produces a table that can be printed:i'm not sure how to run the tests here, or i'd go ahead and add a test that
to_table
should work with examples from the docs :D