Skip to content

expfilenames

expfilenames

List of experiment filenames

Classes

AdditionalExperimentFilenames

Bases: str, Enum

Experiment filenames used dataset specific

Functions
get_complete_name
get_complete_name(dataset_name)

Replaces {dataset} with the specific datasetname and returns the string

Source code in niceml/experiments/expfilenames.py
def get_complete_name(self, dataset_name: str) -> str:
    """Replaces {dataset} with the specific datasetname and returns the string"""
    return self.value.format(dataset=dataset_name)
get_formatted_basename
get_formatted_basename(dataset_name)

returns only the basename from the complete_name

Source code in niceml/experiments/expfilenames.py
def get_formatted_basename(self, dataset_name: str) -> str:
    """returns only the basename from the complete_name"""
    return basename(self.get_complete_name(dataset_name))

ExpEvalCopyNames

ExpEvalCopyNames(exclude_files=None)

Class for determining whether a file should be copied during eval job

Class for determining whether a file should be copied during eval job

Source code in niceml/experiments/expfilenames.py
def __init__(self, exclude_files: Optional[List[str]] = None):
    """Class for determining whether a file should be copied during eval job"""

    self.exclude_files = exclude_files or [
        ExperimentFilenames.ANALYSIS_FOLDER,
        ExperimentFilenames.PREDICTION_FOLDER,
    ]
Functions
__contains__
__contains__(key)

The contains function is used to check if a key is in the dictionary. This function will be called when using the 'in' keyword.

Parameters:

  • key (str) –

    str: Check if the key (file) starts with an excluded file

Returns:

  • bool

    False, if the key (file) starts with an excluded file

Source code in niceml/experiments/expfilenames.py
def __contains__(self, key: str) -> bool:
    """
    The __contains__ function is used to check if a key is in the dictionary.
    This function will be called when using the 'in' keyword.

    Args:
        key: str: Check if the key (`file`) starts with an excluded file

    Returns:
        False, if the key (`file`) starts with an excluded file
    """
    for ex_file in self.exclude_files:
        if key.startswith(ex_file):
            return False
    return True

ExperimentFilenames

Available experiment filenames

OpNames

Bases: str, Enum

Names of the ops

Functions

filter_for_exp_info_files

filter_for_exp_info_files(file_list)

Returns all files which are named like the EXP_INFO file

Source code in niceml/experiments/expfilenames.py
def filter_for_exp_info_files(file_list: List[str]) -> List[str]:
    """Returns all files which are named like the EXP_INFO file"""
    return [x for x in file_list if basename(x) in [ExperimentFilenames.EXP_INFO]]

get_load_parq_files

get_load_parq_files()

returns the files which should be loaded

Source code in niceml/experiments/expfilenames.py
def get_load_parq_files() -> List[str]:
    """returns the files which should be loaded"""
    cur_exp_fn: AdditionalExperimentFilenames  # ruff: noqa: F842
    load_parq_files = [
        cur_exp_fn.get_complete_name(y)
        for cur_exp_fn in AdditionalExperimentFilenames
        for y in get_eval_save_names()
    ]
    return load_parq_files