tools/combine_HDFs.py
def load_ts_properties_from_csv(csv_path : str) -> dict:
    """
    Loads CSV file containing training set properties and returns contents as a dictionary.
    """
    print("* Loading training set properties.", flush=True)

    # read dictionaries from csv
    with open(csv_path, "r") as csv_file:
        reader   = csv.reader(csv_file, delimiter=";")
        csv_dict = dict(reader)

    # fix file types within dict in going from `csv_dict` --> `properties_dict`
    properties_dict = {}
    for key, value in csv_dict.items():

        # first determine if key is a tuple
        key = eval(key)
        if len(key) > 1:
            tuple_key = (str(key[0]), str(key[1]))
        else:
            tuple_key = key

        # then convert the values to the correct data type
        try:
            properties_dict[tuple_key] = eval(value)
        except (SyntaxError, NameError):
            properties_dict[tuple_key] = value

        # convert any `list`s to `torch.Tensor`s (for consistency)
        if type(properties_dict[tuple_key]) == list:
            properties_dict[tuple_key] = torch.Tensor(properties_dict[tuple_key])

    return properties_dict

    Loads CSV file containing training set properties and returns contents as a dictionary.
    
Loads CSV file containing training set properties and returns contents as a dictionary.
Loads CSV file containing training set properties and returns contents as a dictionary .
def load_ts_properties_from_csv(csv_path : str) -> dict:
    print("* Loading training set properties.", flush=True)
    with open(csv_path, "r") as csv_file:
        reader   = csv.reader(csv_file, delimiter=";")
        csv_dict = dict(reader)
    properties_dict = {}
    for key, value in csv_dict.items():
        key = eval(key)
        if len(key) > 1:
            tuple_key = (str(key[0]), str(key[1]))
        else:
            tuple_key = key
        try:
            properties_dict[tuple_key] = eval(value)
        except (SyntaxError, NameError):
            properties_dict[tuple_key] = value
        if type(properties_dict[tuple_key]) == list:
            properties_dict[tuple_key] = torch.Tensor(properties_dict[tuple_key])
    return properties_dict
def load_ts_properties_from_csv ( csv_path : str ) -> dict : print ( "* Loading training set properties." , flush = True ) with open ( csv_path , "r" ) as csv_file : reader = csv . reader ( csv_file , delimiter = ";" ) csv_dict = dict ( reader ) properties_dict = { } for key , value in csv_dict . items ( ) : key = eval ( key ) if len ( key ) > 1 : tuple_key = ( str ( key [ 0 ] ) , str ( key [ 1 ] ) ) else : tuple_key = key try : properties_dict [ tuple_key ] = eval ( value ) except ( SyntaxError , NameError ) : properties_dict [ tuple_key ] = value if type ( properties_dict [ tuple_key ] ) == list : properties_dict [ tuple_key ] = torch . Tensor ( properties_dict [ tuple_key ] ) return properties_dict
Loads CSV file containing training set properties and returns contents as a dictionary.
Loads CSV file containing training set properties and returns contents as a dictionary .
"""
    Loads CSV file containing training set properties and returns contents as a dictionary.
    """ # read dictionaries from csv # fix file types within dict in going from `csv_dict` --> `properties_dict` # first determine if key is a tuple # then convert the values to the correct data type # convert any `list`s to `torch.Tensor`s (for consistency)
csv_path
str