class documentation

Minimal model representing a dataset.

This is basically a Django representation of the LyDataset class.

Its DatasetModel.load_dataframe method makes use of the function cached_load_dataframe to load the dataset into a pandas DataFrame. Note that this function uses joblib to cache the results of the function call in a persistent location given by the JOBLIB_CACHE_DIR setting.

Class Meta Meta options for the DatasetModel.
Method __str__ Return the name of the dataset.
Method get_kwargs Assemble kwargs from this model's field.
Method get_lydataset Create a LyDataset from this model.
Method get_repo Return the GitHub repository object.
Method load_dataframe Load the underlying table.
Method save Update the is_private field based on the GitHub repository.
Class Variable institution Undocumented
Class Variable last_saved Undocumented
Class Variable ref Undocumented
Class Variable repo_name Undocumented
Class Variable subsite Undocumented
Class Variable year Undocumented
Instance Variable is_private Undocumented
Instance Variable last_pushed Undocumented
Property name Return the name of the dataset.
def __str__(self):

Return the name of the dataset.

def get_kwargs(self) -> dict[str, int | str]:

Assemble kwargs from this model's field.

These will both be used to call the cached_load_dataframe function as well as initialize a LyDataset object.

def get_lydataset(self) -> LyDataset:

Create a LyDataset from this model.

def get_repo(self) -> Repository:

Return the GitHub repository object.

def load_dataframe(self) -> pd.DataFrame:

Load the underlying table.

This calls the cached_load_dataframe function with the assembled kwargs and returns the resulting pd.DataFrame.

def save(self, *args, **kwargs):

Update the is_private field based on the GitHub repository.

institution: Institution =

Undocumented

Undocumented

ref: str =

Undocumented

repo_name: str =

Undocumented

subsite: str =

Undocumented

year: int =

Undocumented

is_private: bool =

Undocumented

last_pushed: models.DateTimeField =

Undocumented

@property
name: str =

Return the name of the dataset.