RAMjET

ramjet.photometric_database.sql_metadata_light_curve_collection

Code for a light curve collection that stores its metadata in the SQL database.

Module Contents

Classes

SqlMetadataLightCurveCollection Class for a light curve collection that stores its metadata in the SQL database.
class SqlMetadataLightCurveCollection[source]

Bases: ramjet.photometric_database.light_curve_collection.LightCurveCollection

Class for a light curve collection that stores its metadata in the SQL database.

__init__(self)[source]

Initialize self. See help(type(self)) for accurate signature.

get_sql_query(self)[source]

Gets the SQL query for the database models for the light curve collection.

Returns:The SQL query.
sql_count(self)[source]

Gets the count of the rows returned by the SQL query.

Returns:The count.
get_path_from_model(self, model: MetadatabaseModel)[source]

Gets the light curve path from the SQL database model.

Returns:The path to the light curve.
get_paths(self)[source]

Gets the paths for the light curves in the collection.

Returns:An iterable of the light curve paths.
static order_by_uuid_with_random_start(select_query: Select, uuid_field: Field)[source]

Applies an “order by” on a query using a passed UUID field. The “order by” starts at a random UUID and then loops back to the minimum UUID include all entities.

Parameters:
  • select_query – The query to add the “order by” to.
  • uuid_field – The UUID field to order on.
Returns:

The query updated to include the “order by”.

static order_by_dataset_split_with_random_start(select_query: Select, dataset_split_field: Field, available_dataset_splits: Union[List[int], None])[source]

Applies an “order by” on a query using a passed dataset_split field. The “order by” starts at a random dataset_split out of the passed available options, then loops back to the minimum dataset_split to include all entities.

Parameters:
  • select_query – The query to add the “order by” to.
  • dataset_split_field – The dataset_split field to order on.
  • available_dataset_splits – The available dataset_splits to start on.
Returns:

The query updated to include the “order by”.