data_sources.metadata.metadata_model
Model for output of general/metadata data, useful for a batch
SpaceTimeLocation Objects
class SpaceTimeLocation(BaseModel)
Location of the example
v_t0_datetime_utc
@validator("t0_datetime_utc")
def v_t0_datetime_utc(cls, t0_datetime_utc)
Make sure t0_datetime_utc is pandas Timestamp
v_id_type
@validator("id_type")
def v_id_type(cls, id_type)
Make sure id_type is either None, 'gsp' or 'pv_system'
Metadata Objects
class Metadata(BaseModel)
Class to store metadata data
t0_datetimes_utc
@property
def t0_datetimes_utc() -> list
Return all the t0
x_centers_osgb
@property
def x_centers_osgb() -> List[float]
List of all the x centers from all the locations
y_centers_osgb
@property
def y_centers_osgb() -> List[float]
List of all the x centers from all the locations
ids
@property
def ids() -> List[float]
List of all the ids from all the locations
save_to_csv
def save_to_csv(path)
Save metadata to a csv file
Arguments:
path
- the path where the file should be save
load_from_csv
def load_from_csv(path: Union[str, Path],
batch_size: int,
batch_idx: Optional[int] = None) -> Metadata
Load metadata from csv
Arguments:
path
- the path which stores the metadata filebatch_idx
- the batch index-
batch_size
- how many examples in each batch -
Returns
- Metadata class
data_sources.metadata
Metadata data model