Skip to content

Commit

Permalink
Upgrade to quivr v0.6.2 (#33)
Browse files Browse the repository at this point in the history
* Columns are non-nullable by default

* Upgrade to quivr v0.6.2
  • Loading branch information
spenczar authored Aug 9, 2023
1 parent d22f90e commit 774fcd7
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion adam_core/coordinates/cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CartesianCoordinates(Table):
vz = Float64Column(nullable=True)
time = Times.as_column(nullable=True)
covariance = CoordinateCovariances.as_column(nullable=True)
origin = Origin.as_column(nullable=False)
origin = Origin.as_column()
frame = StringAttribute()

@property
Expand Down
14 changes: 7 additions & 7 deletions adam_core/coordinates/cometary.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ class CometaryCoordinates(Table):
# grab the MJD column. That said, we would want to force it
# the time scale to be in TDB..

q = Float64Column(nullable=False)
e = Float64Column(nullable=False)
i = Float64Column(nullable=False)
raan = Float64Column(nullable=False)
ap = Float64Column(nullable=False)
tp = Float64Column(nullable=False)
q = Float64Column()
e = Float64Column()
i = Float64Column()
raan = Float64Column()
ap = Float64Column()
tp = Float64Column()
time = Times.as_column(nullable=True)
covariance = CoordinateCovariances.as_column(nullable=True)
origin = Origin.as_column(nullable=False)
origin = Origin.as_column()
frame = StringAttribute()

@property
Expand Down
2 changes: 1 addition & 1 deletion adam_core/coordinates/covariances.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class CoordinateCovariances(Table):

# This is temporary while we await the implementation of
# https://github.com/apache/arrow/issues/35599
values = FixedSizeListColumn(pa.float64(), list_size=36)
values = FixedSizeListColumn(pa.float64(), list_size=36, nullable=True)
# When fixed, we should revert to:
# values = Column(pa.fixed_shape_tensor(pa.float64(), (6, 6)))

Expand Down
14 changes: 7 additions & 7 deletions adam_core/coordinates/keplerian.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@

class KeplerianCoordinates(Table):

a = Float64Column(nullable=False)
e = Float64Column(nullable=False)
i = Float64Column(nullable=False)
raan = Float64Column(nullable=False)
ap = Float64Column(nullable=False)
M = Float64Column(nullable=False)
a = Float64Column()
e = Float64Column()
i = Float64Column()
raan = Float64Column()
ap = Float64Column()
M = Float64Column()
time = Times.as_column(nullable=True)
covariance = CoordinateCovariances.as_column(nullable=True)
origin = Origin.as_column(nullable=False)
origin = Origin.as_column()
frame = StringAttribute()

@property
Expand Down
2 changes: 1 addition & 1 deletion adam_core/coordinates/origin.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class OriginGravitationalParameters(float, Enum):
# Investigate whether this class is even necessary
class Origin(Table):

code = StringColumn(nullable=False)
code = StringColumn()

def __init__(self, table: pa.Table, mu: Optional[float] = None):
super().__init__(table)
Expand Down
2 changes: 1 addition & 1 deletion adam_core/coordinates/spherical.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SphericalCoordinates(Table):
vlat = Float64Column(nullable=True)
time = Times.as_column(nullable=True)
covariance = CoordinateCovariances.as_column(nullable=True)
origin = Origin.as_column(nullable=False)
origin = Origin.as_column()
frame = StringAttribute()

@property
Expand Down
6 changes: 3 additions & 3 deletions adam_core/coordinates/times.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class Times(Table):
# Stores the time as a pair of float64 values in the same style as erfa/astropy:
# The first one is the day-part of a Julian date, and the second is
# the fractional day-part.
jd1 = Float64Column(nullable=False)
jd2 = Float64Column(nullable=False)
scale = StringAttribute()
jd1 = Float64Column()
jd2 = Float64Column()
scale = StringAttribute(default="utc")

@classmethod
def from_astropy(cls, time: Time):
Expand Down
2 changes: 1 addition & 1 deletion adam_core/orbits/orbits.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Orbits(Table):

orbit_id = StringColumn(nullable=True)
object_id = StringColumn(nullable=True)
coordinates = CartesianCoordinates.as_column(nullable=False)
coordinates = CartesianCoordinates.as_column()

def to_dataframe(self, sigmas: bool = False, covariances: bool = True):
"""
Expand Down
2 changes: 1 addition & 1 deletion adam_core/propagator/tests/test_propagator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def _propagate_orbits(self, orbits: Orbits, times: Time) -> Orbits:
repeated_time = Time([t] * len(orbits))
orbits.coordinates.time = coordinates.Times.from_astropy(
repeated_time
).to_structarray()
)
all_times.append(orbits)

return quivr.concatenate(all_times)
Expand Down
2 changes: 1 addition & 1 deletion adam_core/propagator/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class SampleTable(Table):
a = Float64Column(nullable=False)
a = Float64Column()


def test__iterate_chunks():
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ install_requires =
requests
scipy
spiceypy
quivr>=0.5.0
quivr>=0.6.2
mpc-obscodes
naif-de440
naif-leapseconds
Expand Down

0 comments on commit 774fcd7

Please sign in to comment.