Skip to content

Commit

Permalink
Use large strings to possibly avoid apache/arrow#36295
Browse files Browse the repository at this point in the history
  • Loading branch information
akoumjian committed Dec 27, 2023
1 parent 16b5d1e commit ef8ee48
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion adam_core/coordinates/origin.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def SOLAR_SYSTEM_BARYCENTER(cls) -> float:
# TODO: Replace with DictionaryColumn or similar
# Investigate whether this class is even necessary
class Origin(qv.Table):
code = qv.StringColumn()
code = qv.LargeStringColumn()

def __eq__(self, other: object) -> np.ndarray:
if isinstance(other, (str, np.ndarray)):
Expand Down
6 changes: 3 additions & 3 deletions adam_core/observations/associations.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

class Associations(qv.Table):

detection_id = qv.StringColumn()
object_id = qv.StringColumn(nullable=True)
detection_id = qv.LargeStringColumn()
object_id = qv.LargeStringColumn(nullable=True)

# TODO: We may want to create a derivative class called "ProbabilisticAssociations" that
# includes residuals with respect to an orbit
# orbit_id = qv.StringColumn(nullable=True)
# orbit_id = qv.LargeStringColumn(nullable=True)
# residuals = Residuals.as_column(nullable=True) # from adam_core.coordinates.residuals import Residuals

def group_by_object(self) -> Iterator["Associations"]:
Expand Down
4 changes: 2 additions & 2 deletions adam_core/observations/detections.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class PointSourceDetections(qv.Table):
"""

id = qv.StringColumn()
id = qv.LargeStringColumn()

exposure_id = qv.StringColumn(nullable=True)
exposure_id = qv.LargeStringColumn(nullable=True)

# Some, but not all, point source data may include times for
# individual observations within an exposure.
Expand Down
4 changes: 2 additions & 2 deletions adam_core/observations/exposures.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class Exposures(qv.Table):
Exposures is a table of data about exposures that provide point source observations.
"""

id = qv.StringColumn()
id = qv.LargeStringColumn()
start_time = Timestamp.as_column()
duration = qv.Float64Column(validator=and_(ge(0), le(3600)))
filter = qv.DictionaryColumn(index_type=pa.int32(), value_type=pa.string())

observatory_code = qv.StringColumn()
observatory_code = qv.LargeStringColumn()

def group_by_observatory_code(self) -> Iterator[tuple[str, Exposures]]:
"""
Expand Down
6 changes: 3 additions & 3 deletions adam_core/observers/observers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@


class ObservatoryGeodetics(qv.Table):
code = qv.StringColumn()
code = qv.LargeStringColumn()
longitude = qv.Float64Column()
cos_phi = qv.Float64Column()
sin_phi = qv.Float64Column()
name = qv.StringColumn()
name = qv.LargeStringColumn()


# Read MPC extended observatory codes file
Expand Down Expand Up @@ -49,7 +49,7 @@ class ObservatoryGeodetics(qv.Table):


class Observers(qv.Table):
code = qv.StringColumn(nullable=False)
code = qv.LargeStringColumn(nullable=False)
coordinates = CartesianCoordinates.as_column()

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions adam_core/orbits/ephemeris.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

class Ephemeris(qv.Table):

orbit_id = qv.StringColumn()
object_id = qv.StringColumn(nullable=True)
orbit_id = qv.LargeStringColumn()
object_id = qv.LargeStringColumn(nullable=True)
coordinates = SphericalCoordinates.as_column()

# The coordinates as observed by the observer will be the result of
Expand Down
4 changes: 2 additions & 2 deletions adam_core/orbits/orbits.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

class Orbits(qv.Table):

orbit_id = qv.StringColumn(default=lambda: uuid.uuid4().hex)
object_id = qv.StringColumn(nullable=True)
orbit_id = qv.LargeStringColumn(default=lambda: uuid.uuid4().hex)
object_id = qv.LargeStringColumn(nullable=True)
coordinates = CartesianCoordinates.as_column()

def group_by_orbit_id(self) -> Iterable[Tuple[str, "Orbits"]]:
Expand Down
8 changes: 4 additions & 4 deletions adam_core/orbits/variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

class VariantOrbits(qv.Table):

orbit_id = qv.StringColumn(default=lambda: uuid.uuid4().hex)
object_id = qv.StringColumn(nullable=True)
orbit_id = qv.LargeStringColumn(default=lambda: uuid.uuid4().hex)
object_id = qv.LargeStringColumn(nullable=True)
weights = qv.Float64Column(nullable=True)
weights_cov = qv.Float64Column(nullable=True)
coordinates = CartesianCoordinates.as_column()
Expand Down Expand Up @@ -164,8 +164,8 @@ def collapse(self, orbits: Orbits) -> Orbits:

class VariantEphemeris(qv.Table):

orbit_id = qv.StringColumn(default=lambda: uuid.uuid4().hex)
object_id = qv.StringColumn(nullable=True)
orbit_id = qv.LargeStringColumn(default=lambda: uuid.uuid4().hex)
object_id = qv.LargeStringColumn(nullable=True)
weights = qv.Float64Column(nullable=True)
weights_cov = qv.Float64Column(nullable=True)
coordinates = SphericalCoordinates.as_column()
Expand Down
2 changes: 1 addition & 1 deletion adam_core/time/tests/test_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


class Wrapper(qv.Table):
id = qv.StringColumn()
id = qv.LargeStringColumn()
times = Timestamp.as_column(nullable=True)


Expand Down

0 comments on commit ef8ee48

Please sign in to comment.