tools/combine_HDFs.py
def write_ts_properties_to_csv(ts_properties_dict : dict) -> None:
    """
    Writes the training set properties in `ts_properties_dict` to a CSV file.
    """
    dict_path = f"data/{dataset}/train.csv"

    with open(dict_path, "w") as csv_file:

        csv_writer = csv.writer(csv_file, delimiter=";")
        for key, value in ts_properties_dict.items():
            if "validity_tensor" in key:
                continue  # skip writing the validity tensor because it is really long
            elif type(value) == np.ndarray:
                csv_writer.writerow([key, list(value)])
            elif type(value) == torch.Tensor:
                try:
                    csv_writer.writerow([key, float(value)])
                except ValueError:
                    csv_writer.writerow([key, [float(i) for i in value]])
            else:
                csv_writer.writerow([key, value])

    Writes the training set properties in `ts_properties_dict` to a CSV file.
    
Writes the training set properties in `ts_properties_dict` to a CSV file.
Writes the training set properties in ` ts_properties_dict ` to a CSV file .
def write_ts_properties_to_csv(ts_properties_dict : dict) -> None:
    dict_path = f"data/{dataset}/train.csv"
    with open(dict_path, "w") as csv_file:
        csv_writer = csv.writer(csv_file, delimiter=";")
        for key, value in ts_properties_dict.items():
            if "validity_tensor" in key:
                continue  
            elif type(value) == np.ndarray:
                csv_writer.writerow([key, list(value)])
            elif type(value) == torch.Tensor:
                try:
                    csv_writer.writerow([key, float(value)])
                except ValueError:
                    csv_writer.writerow([key, [float(i) for i in value]])
            else:
                csv_writer.writerow([key, value])
def write_ts_properties_to_csv ( ts_properties_dict : dict ) -> None : dict_path = f"data/{dataset}/train.csv" with open ( dict_path , "w" ) as csv_file : csv_writer = csv . writer ( csv_file , delimiter = ";" ) for key , value in ts_properties_dict . items ( ) : if "validity_tensor" in key : continue elif type ( value ) == np . ndarray : csv_writer . writerow ( [ key , list ( value ) ] ) elif type ( value ) == torch . Tensor : try : csv_writer . writerow ( [ key , float ( value ) ] ) except ValueError : csv_writer . writerow ( [ key , [ float ( i ) for i in value ] ] ) else : csv_writer . writerow ( [ key , value ] )
Writes the training set properties in `ts_properties_dict` to a CSV file.
Writes the training set properties in ` ts_properties_dict ` to a CSV file .
"""
    Writes the training set properties in `ts_properties_dict` to a CSV file.
    """ # skip writing the validity tensor because it is really long
ts_properties_dict
dict