Utils
check_file(path)
¶
Checks if file present on local
Source code in openqdc/utils/io.py
111 112 113 |
|
create_hdf5_file(hdf5_file_path)
¶
Creates hdf5 file with fsspec
Source code in openqdc/utils/io.py
167 168 169 170 171 172 |
|
get_conversion(in_unit, out_unit)
¶
Utility function to get the conversion function between two units.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
in_unit
|
The input unit |
required | |
out_unit
|
The output unit |
required |
Returns:
Type | Description |
---|---|
Callable[[float], float]
|
The conversion function |
Source code in openqdc/utils/units.py
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
get_local_cache()
¶
Returns the local cache directory. It creates it if it does not exist.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
path to the local cache directory |
Source code in openqdc/utils/io.py
47 48 49 50 51 52 53 54 55 56 |
|
get_remote_cache(write_access=False)
¶
Returns the entry point based on the write access.
Source code in openqdc/utils/io.py
59 60 61 62 63 64 65 66 67 |
|
load_hdf5_file(hdf5_file_path)
¶
Loads hdf5 file with fsspec
Source code in openqdc/utils/io.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
load_json(path)
¶
Loads json file
Source code in openqdc/utils/io.py
175 176 177 178 |
|
load_pkl(path, check=True)
¶
Load pkl file
Source code in openqdc/utils/io.py
139 140 141 142 143 144 145 146 |
|
makedirs(path, exist_ok=True)
¶
Creates directory
Source code in openqdc/utils/io.py
106 107 108 |
|
read_qc_archive_h5(raw_path, subset, energy_target_names, force_target_names=None)
¶
Extracts data from the HDF5 archive file.
Source code in openqdc/utils/io.py
276 277 278 279 280 281 282 283 284 285 |
|
save_pkl(file, path)
¶
Saves pkl file
Source code in openqdc/utils/io.py
122 123 124 125 126 |
|
set_cache_dir(d)
¶
Optionally set the _OPENQDC_CACHE_DIR directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
d
|
str
|
path to a local folder. |
required |
Source code in openqdc/utils/io.py
34 35 36 37 38 39 40 41 42 43 44 |
|