hyrax 0.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. hyrax/__init__.py +11 -0
  2. hyrax/_version.py +21 -0
  3. hyrax/config_utils.py +515 -0
  4. hyrax/data_sets/__init__.py +13 -0
  5. hyrax/data_sets/data_set_registry.py +248 -0
  6. hyrax/data_sets/hsc_data_set.py +1045 -0
  7. hyrax/data_sets/hyrax_cifar_data_set.py +32 -0
  8. hyrax/data_sets/inference_dataset.py +316 -0
  9. hyrax/download.py +526 -0
  10. hyrax/downloadCutout/LINCC_README.md +4 -0
  11. hyrax/downloadCutout/README.md +137 -0
  12. hyrax/downloadCutout/downloadCutout.py +1572 -0
  13. hyrax/download_stats.py +393 -0
  14. hyrax/example_benchmarks.py +14 -0
  15. hyrax/gpu_monitor.py +117 -0
  16. hyrax/hyrax.py +214 -0
  17. hyrax/hyrax_default_config.toml +236 -0
  18. hyrax/infer.py +138 -0
  19. hyrax/model_exporters.py +92 -0
  20. hyrax/models/__init__.py +16 -0
  21. hyrax/models/hsc_autoencoder.py +68 -0
  22. hyrax/models/hsc_dcae.py +103 -0
  23. hyrax/models/hsc_dcae_v2.py +137 -0
  24. hyrax/models/hyrax_autoencoder.py +136 -0
  25. hyrax/models/hyrax_cnn.py +67 -0
  26. hyrax/models/model_registry.py +139 -0
  27. hyrax/plugin_utils.py +112 -0
  28. hyrax/prepare.py +21 -0
  29. hyrax/pytorch_ignite.py +497 -0
  30. hyrax/rebuild_manifest.py +31 -0
  31. hyrax/train.py +124 -0
  32. hyrax/vector_dbs/chromadb_impl.py +263 -0
  33. hyrax/vector_dbs/vector_db_factory.py +19 -0
  34. hyrax/vector_dbs/vector_db_interface.py +86 -0
  35. hyrax/verbs/__init__.py +15 -0
  36. hyrax/verbs/lookup.py +104 -0
  37. hyrax/verbs/search.py +49 -0
  38. hyrax/verbs/umap.py +161 -0
  39. hyrax/verbs/verb_registry.py +82 -0
  40. hyrax/verbs/visualize.py +351 -0
  41. hyrax-0.3.dist-info/METADATA +118 -0
  42. hyrax-0.3.dist-info/RECORD +47 -0
  43. hyrax-0.3.dist-info/WHEEL +5 -0
  44. hyrax-0.3.dist-info/entry_points.txt +2 -0
  45. hyrax-0.3.dist-info/licenses/LICENSE +21 -0
  46. hyrax-0.3.dist-info/top_level.txt +2 -0
  47. hyrax_cli/main.py +70 -0
hyrax/__init__.py ADDED
@@ -0,0 +1,11 @@
1
+ from .config_utils import log_runtime_config
2
+ from .hyrax import Hyrax
3
+ from .plugin_utils import get_or_load_class, import_module_from_string, update_registry
4
+
5
+ __all__ = [
6
+ "log_runtime_config",
7
+ "get_or_load_class",
8
+ "import_module_from_string",
9
+ "update_registry",
10
+ "Hyrax",
11
+ ]
hyrax/_version.py ADDED
@@ -0,0 +1,21 @@
1
+ # file generated by setuptools-scm
2
+ # don't change, don't track in version control
3
+
4
+ __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5
+
6
+ TYPE_CHECKING = False
7
+ if TYPE_CHECKING:
8
+ from typing import Tuple
9
+ from typing import Union
10
+
11
+ VERSION_TUPLE = Tuple[Union[int, str], ...]
12
+ else:
13
+ VERSION_TUPLE = object
14
+
15
+ version: str
16
+ __version__: str
17
+ __version_tuple__: VERSION_TUPLE
18
+ version_tuple: VERSION_TUPLE
19
+
20
+ __version__ = version = '0.3'
21
+ __version_tuple__ = version_tuple = (0, 3)
hyrax/config_utils.py ADDED
@@ -0,0 +1,515 @@
1
+ import base64
2
+ import datetime
3
+ import importlib
4
+ import logging
5
+ import random
6
+ import re
7
+ from importlib import util as importlib_util
8
+ from pathlib import Path
9
+ from typing import Any, Optional, Union
10
+
11
+ import tomlkit
12
+ from tomlkit.toml_document import TOMLDocument
13
+
14
+ DEFAULT_CONFIG_FILEPATH = Path(__file__).parent.resolve() / "hyrax_default_config.toml"
15
+ DEFAULT_USER_CONFIG_FILEPATH = Path.cwd() / "hyrax_config.toml"
16
+
17
+ logger = logging.getLogger(__name__)
18
+
19
+
20
+ class ConfigDict(dict):
21
+ """The purpose of this class is to ensure key errors on config dictionaries return something helpful.
22
+ and to discourage mutation actions on config dictionaries that should not happen at runtime.
23
+ """
24
+
25
+ # TODO: Should there be some sort of "bake" method which occurs after config processing, and
26
+ # percolates down to nested ConfigDicts and prevents __setitem__ and other mutations of dictionary
27
+ # values? i.e. a method to make a config dictionary fully immutable (or very difficult/annoying to
28
+ # mutate) before we pass control to possibly external module code that is relying on the dictionary
29
+ # to be static throughout the run.
30
+ #
31
+ # Note that we currently modify configdict objects in HSCDataSet as a matter of course
32
+ # This is to serialize the config used to create them, so it can be kept around in InferenceDatasets
33
+ # and re-constituted for visualization purposes
34
+
35
+ __slots__ = () # we don't need __dict__ on this object at all.
36
+
37
+ def __init__(self, *args, **kwargs):
38
+ super().__init__(*args, **kwargs)
39
+
40
+ # Replace all dictionary keys with values recursively.
41
+ for key, val in self.items():
42
+ if isinstance(val, dict) and not isinstance(val, ConfigDict):
43
+ self[key] = ConfigDict(val)
44
+
45
+ def __missing__(self, key):
46
+ msg = f"Accessed configuration key/section {key} which has not been defined. "
47
+ msg += f"All configuration keys and sections must be defined in {DEFAULT_CONFIG_FILEPATH}"
48
+ logger.fatal(msg)
49
+ raise RuntimeError(msg)
50
+
51
+ def get(self, key, default=None):
52
+ """Nonfunctional stub of dict.get() which errors always. Overriding this
53
+ prevents the possibility of defining default values in code that conflict
54
+ with default values defined in the config file."""
55
+ msg = f"ConfigDict.get({key},{default}) called. "
56
+ msg += "Please index config dictionaries with [] or __getitem__() only. "
57
+ msg += f"Configuration keys and sections must be defined in {DEFAULT_CONFIG_FILEPATH}"
58
+ logger.fatal(msg)
59
+ raise RuntimeError(msg)
60
+
61
+ def __delitem__(self, key):
62
+ raise RuntimeError("Removing keys or sections from a ConfigDict using del is not supported")
63
+
64
+ def pop(self, key, default):
65
+ """Nonfunctional stub of dict.pop() which errors always"""
66
+ raise RuntimeError("Removing keys or sections from a ConfigDict using pop() is not supported")
67
+
68
+ def popitem(self):
69
+ """Nonfunctional stub of dict.popitem() which errors always"""
70
+ raise RuntimeError("Removing keys or sections from a ConfigDict using popitem() is not supported")
71
+
72
+ def clear(self):
73
+ """Nonfunctional stub of dict.clear() which errors always"""
74
+ raise RuntimeError("Removing keys or sections from a ConfigDict using clear() is not supported")
75
+
76
+
77
+ def config_help(config: TOMLDocument, *args):
78
+ """
79
+ A simple config help function. It's a bit difficult to parse through
80
+ the Tomlkit Table to print just one item such that it would include the comments
81
+ preceding it.
82
+
83
+ For now, we support the following cases, and generally print out the entire
84
+ table for the given key.
85
+
86
+ Cases:
87
+ - if no args, prints the whole config.
88
+ - if args[0] is a table name, print the whole table
89
+ - if args[0] is not a table, assume it's a key and search
90
+ -- print each one of the tables that it is found in.
91
+
92
+ Parameters
93
+ ----------
94
+ config : TOMLDocument
95
+ A configuration dictionary that will be used to search for specified tables
96
+ and keys.
97
+
98
+ args : str
99
+ A variable number of string arguments that specify the table name or key
100
+ to search for in the configuration dictionary.
101
+ """
102
+
103
+ # Get the config as a dictionary
104
+ config_dict = config.value
105
+
106
+ # No tables provided, print the whole config
107
+ if not args:
108
+ print(config.as_string())
109
+
110
+ # Table name provided as args[0], print that config table
111
+ if len(args) == 1 and args[0] in config_dict:
112
+ print(f"[{args[0]}]")
113
+ print(config[args[0]].as_string())
114
+
115
+ # One arg provided, but it's not a table name.
116
+ # Assume it's a config key and search the config for it.
117
+ # Print each table that it is found in.
118
+ if len(args) == 1 and args[0] not in config_dict:
119
+ matching = find_keys(config_dict, args[0])
120
+ if len(matching):
121
+ tables = [m.split(".")[0] for m in matching]
122
+ print(f"Found '{args[0]}' in the following config sections: [{'], ['.join(tables)}]")
123
+ for t in tables:
124
+ config_help(config, t)
125
+ else:
126
+ print(f"Could not find '{args[0]}' in the config")
127
+
128
+ if len(args) == 2:
129
+ if args[0] in config_dict and args[1] in config_dict[args[0]]:
130
+ print(f"[{args[0]}]")
131
+ print(config[args[0]].as_string())
132
+ else:
133
+ print(f"Cannot find ['{args[0]}']['{args[1]}'] in the current configuration.")
134
+
135
+ if len(args) > 2:
136
+ print("Too many arguments provided. Expecting 0, 1, or 2 arguments.")
137
+ print("Usage: config.help(['table_name'|'key_name']), config.help('table_name', 'key_name')")
138
+
139
+
140
+ def find_keys(config: dict[str, Any], key_name: str):
141
+ """
142
+ Recursively find all keys in a nested dictionary that match the given key name.
143
+
144
+ Parameters
145
+ ----------
146
+ config : dict
147
+ The nested dictionary to search.
148
+ key_name : str
149
+ The name of the key to find.
150
+
151
+ Returns
152
+ -------
153
+ list
154
+ A list of matching keys.
155
+ """
156
+ matching_keys = []
157
+
158
+ def _find_keys(d, parent_key=""):
159
+ if isinstance(d, dict):
160
+ for k, v in d.items():
161
+ if k == key_name:
162
+ matching_keys.append((parent_key + "." + k).strip("."))
163
+ _find_keys(v, parent_key + "." + k)
164
+
165
+ _find_keys(config)
166
+ return matching_keys
167
+
168
+
169
+ # Here we patch the TOMLDocument functions to use the ConfigDict functions so that
170
+ # we get the behavior that we desire - i.e. errors on missing default keys, no
171
+ # use of config.get(..., <default>), etc.
172
+ TOMLDocument.__missing__ = ConfigDict.__missing__ # type: ignore[attr-defined]
173
+ TOMLDocument.get = ConfigDict.get # type: ignore[assignment, method-assign]
174
+ TOMLDocument.__delitem__ = ConfigDict.__delitem__ # type: ignore[assignment, method-assign]
175
+ TOMLDocument.pop = ConfigDict.pop # type: ignore[assignment, method-assign]
176
+ TOMLDocument.popitem = ConfigDict.popitem # type: ignore[assignment, method-assign]
177
+ TOMLDocument.clear = ConfigDict.clear # type: ignore[assignment, method-assign]
178
+ TOMLDocument.help = config_help # type: ignore
179
+
180
+
181
+ class ConfigManager:
182
+ """A class to manage the runtime configuration for a Hyrax object. This class
183
+ will contain all the logic and methods for reading, merging, and validating
184
+ the runtime configuration.
185
+ """
186
+
187
+ """
188
+ Hardcoded set of config keys which definitionally contain paths, and we resolve to global paths
189
+ during initialization in ConfigManager._resolve_config_paths().
190
+ """
191
+ PATH_CONFIG_KEYS = [
192
+ # TODO: external library config defaults
193
+ # However we define config defaults from external libraries ought allow them to designate config keys
194
+ # which contain relative paths. ultimately these should end up on the list and be resolved.
195
+ ["data_set", "filter_catalog"],
196
+ ["general", "data_dir"],
197
+ ]
198
+
199
+ def __init__(
200
+ self,
201
+ runtime_config_filepath: Optional[Union[Path, str]] = None,
202
+ default_config_filepath: Union[Path, str] = DEFAULT_CONFIG_FILEPATH,
203
+ ):
204
+ self.hyrax_default_config: TOMLDocument = ConfigManager._read_runtime_config(default_config_filepath)
205
+
206
+ self.runtime_config_filepath = ConfigManager.resolve_runtime_config(runtime_config_filepath)
207
+ if self.runtime_config_filepath is DEFAULT_CONFIG_FILEPATH:
208
+ self.user_specific_config = TOMLDocument()
209
+ else:
210
+ self.user_specific_config = ConfigManager._read_runtime_config(self.runtime_config_filepath)
211
+
212
+ self.external_library_config_paths = ConfigManager._find_external_library_default_config_paths(
213
+ self.user_specific_config
214
+ )
215
+
216
+ self.overall_default_config = TOMLDocument()
217
+ self._merge_defaults()
218
+ self.config = self.merge_configs(self.overall_default_config, self.user_specific_config)
219
+
220
+ ConfigManager._resolve_config_paths(self.config)
221
+ if not self.config["general"]["dev_mode"]:
222
+ ConfigManager._validate_runtime_config(self.config, self.overall_default_config)
223
+
224
+ @staticmethod
225
+ def _read_runtime_config(config_filepath: Union[Path, str] = DEFAULT_CONFIG_FILEPATH) -> TOMLDocument:
226
+ """Read a single toml file and return a ConfigDict
227
+
228
+ Parameters
229
+ ----------
230
+ config_filepath : Union[Path, str], optional
231
+ The path to the config file, by default DEFAULT_CONFIG_FILEPATH
232
+
233
+ Returns
234
+ -------
235
+ TOMLDocument
236
+ The contents of the toml file as a tomlkit.TOMLDocument
237
+ """
238
+ config_filepath = Path(config_filepath)
239
+ parsed_dict: TOMLDocument = TOMLDocument()
240
+ if config_filepath.exists():
241
+ with open(config_filepath, "r") as f:
242
+ parsed_dict = tomlkit.load(f)
243
+
244
+ return parsed_dict
245
+
246
+ @staticmethod
247
+ def _find_external_library_default_config_paths(runtime_config: dict) -> set:
248
+ """Search for external libraries in the runtime configuration and gather the
249
+ libpath specifications so that we can load the default configs for the libraries.
250
+
251
+ Parameters
252
+ ----------
253
+ runtime_config : dict
254
+ The runtime configuration as a tomlkit.TOMLDocument.
255
+ Returns
256
+ -------
257
+ set
258
+ A tuple containing the default configuration Paths for the external
259
+ libraries that are requested in the users configuration file.
260
+ """
261
+
262
+ default_config_paths = set()
263
+ for key, value in runtime_config.items():
264
+ if isinstance(value, dict):
265
+ default_config_paths |= ConfigManager._find_external_library_default_config_paths(value)
266
+ else:
267
+ if key == "name" and "." in value:
268
+ external_library = value.split(".")[0]
269
+ if importlib_util.find_spec(external_library) is not None:
270
+ try:
271
+ lib = importlib.import_module(external_library)
272
+ if lib.__file__ is None:
273
+ raise RuntimeError()
274
+ lib_default_config_path = Path(lib.__file__).parent / "default_config.toml"
275
+ if lib_default_config_path.exists():
276
+ default_config_paths.add(lib_default_config_path)
277
+ else:
278
+ logger.warning(f"Cannot find default_config.toml for {external_library}.")
279
+ except ModuleNotFoundError:
280
+ logger.error(
281
+ f"External library {lib} not found. Please install it before running."
282
+ )
283
+ raise
284
+ else:
285
+ raise ModuleNotFoundError(
286
+ f"External library {external_library} not found. Check installation."
287
+ )
288
+
289
+ return default_config_paths
290
+
291
+ def _merge_defaults(self):
292
+ """Merge the default configurations from the hyrax and external libraries."""
293
+
294
+ # Merge all external library default configurations first
295
+ for path in self.external_library_config_paths:
296
+ external_library_config = self._read_runtime_config(path)
297
+ self.overall_default_config = self.merge_configs(
298
+ self.overall_default_config, external_library_config
299
+ )
300
+
301
+ # Merge the external library default configurations with the hyrax default configuration
302
+ self.overall_default_config = self.merge_configs(
303
+ self.hyrax_default_config, self.overall_default_config
304
+ )
305
+
306
+ @staticmethod
307
+ def merge_configs(default_config: dict, overriding_config: dict) -> dict:
308
+ """Merge two ConfigDicts with the overriding_config values overriding
309
+ the default_config values.
310
+
311
+ Parameters
312
+ ----------
313
+ default_config : dict
314
+ The default configuration.
315
+ overriding_config : dict
316
+ The new configuration values to be merged into default_config.
317
+
318
+ Returns
319
+ -------
320
+ dict
321
+ The merged configuration.
322
+ """
323
+
324
+ final_config = default_config.copy()
325
+ for k, v in overriding_config.items():
326
+ if k in final_config and isinstance(final_config[k], dict) and isinstance(v, dict):
327
+ final_config[k] = ConfigManager.merge_configs(default_config[k], v)
328
+ else:
329
+ final_config[k] = v
330
+
331
+ return final_config
332
+
333
+ @staticmethod
334
+ def _validate_runtime_config(runtime_config: dict, default_config: dict):
335
+ """Recursive helper to check that all keys in runtime_config have a default
336
+ in the merged default_config.
337
+
338
+ The two arguments passed in must represent the same nesting level of the
339
+ runtime config and all default config parameters respectively.
340
+
341
+ Parameters
342
+ ----------
343
+ runtime_config : ConfigDict
344
+ Nested config dictionary representing the runtime config.
345
+ default_config : ConfigDict
346
+ Nested config dictionary representing the defaults
347
+
348
+ Raises
349
+ ------
350
+ RuntimeError
351
+ Raised if any config that exists in the runtime config does not have a default defined in
352
+ default_config
353
+ """
354
+ for key in runtime_config:
355
+ if key not in default_config:
356
+ msg = f"Runtime config contains key or section {key} which has no default defined. "
357
+ msg += f"All configuration keys and sections must be defined in {DEFAULT_CONFIG_FILEPATH}"
358
+ raise RuntimeError(msg)
359
+
360
+ if isinstance(runtime_config[key], dict):
361
+ if not isinstance(default_config[key], dict):
362
+ msg = (
363
+ f"Runtime config contains a section named {key} which is the name of a value in the "
364
+ )
365
+ msg += "default config. Please choose another name for this section."
366
+ raise RuntimeError(msg)
367
+ ConfigManager._validate_runtime_config(runtime_config[key], default_config[key])
368
+
369
+ @staticmethod
370
+ def _resolve_config_paths(runtime_config: dict) -> None:
371
+ """Convert all paths in a runntime config to global paths in the current environment.
372
+ Uses the hardcoded list of paths in ConfigManager.PATH_CONFIG_KEYS
373
+
374
+ This mutates the config dictionary passed.
375
+
376
+ Parameters
377
+ ----------
378
+ runtime_config : dict
379
+ Current runtime config nested dictionary
380
+ """
381
+ for key_spec in ConfigManager.PATH_CONFIG_KEYS:
382
+ # Recursively look up a list of keys.
383
+ current_dict = runtime_config
384
+ current_key = None
385
+ current_val = None
386
+ # At the end of each loop current_* are always the dict, key, and value of the
387
+ # last lookup.
388
+ for key in key_spec:
389
+ current_key = key
390
+ try:
391
+ current_val = current_dict[key]
392
+ except KeyError:
393
+ break
394
+
395
+ if isinstance(current_val, dict):
396
+ current_dict = current_val
397
+
398
+ # On the non-break end of the loop we do path resolution, preserving falsy values
399
+ # as false.
400
+ else:
401
+ new_val = str(Path(current_val).resolve()) if current_val else False
402
+ current_dict[current_key] = new_val
403
+
404
+ @staticmethod
405
+ def resolve_runtime_config(runtime_config_filepath: Union[Path, str, None] = None) -> Path:
406
+ """Resolve a user-supplied runtime config to where we will actually pull config from.
407
+
408
+ 1) If a runtime config file is specified, we will use that file.
409
+ 2) If no file is specified and there is a file named "hyrax_config.toml" in the cwd we will use it.
410
+ 3) If no file is specified and there is no file named "hyrax_config.toml" in the cwd we will
411
+ exclusively work off the configuration defaults in the packaged "hyrax_default_config.toml" file.
412
+
413
+ Parameters
414
+ ----------
415
+ runtime_config_filepath : Union[Path, str, None], optional
416
+ Location of the supplied config file, by default None
417
+
418
+ Returns
419
+ -------
420
+ Path
421
+ Path to the configuration file ultimately used for config resolution. When we fall back to the
422
+ package supplied default config file, the Path to that file is returned.
423
+ """
424
+ if isinstance(runtime_config_filepath, str):
425
+ runtime_config_filepath = Path(runtime_config_filepath)
426
+
427
+ # If a named config exists in cwd, and no config specified on cmdline, use cwd.
428
+ if runtime_config_filepath is None and DEFAULT_USER_CONFIG_FILEPATH.exists():
429
+ runtime_config_filepath = DEFAULT_USER_CONFIG_FILEPATH
430
+
431
+ if runtime_config_filepath is None:
432
+ runtime_config_filepath = DEFAULT_CONFIG_FILEPATH
433
+
434
+ return runtime_config_filepath
435
+
436
+
437
+ def create_results_dir(config: ConfigDict, postfix: str) -> Path:
438
+ """Creates a results directory for this run.
439
+
440
+ Postfix is the verb name of the run e.g. (infer, train, etc)
441
+
442
+ The directory is created within the results dir (set with config results_dir)
443
+ and follows the pattern <timestamp>-<postfix>
444
+
445
+ The resulting directory is returned.
446
+
447
+ Parameters
448
+ ----------
449
+ config : ConfigDict
450
+ The full runtime configuration for this run
451
+ postfix : str
452
+ The verb name of the run.
453
+
454
+ Returns
455
+ -------
456
+ Path
457
+ The path created by this function
458
+ """
459
+ results_root = Path(config["general"]["results_dir"]).resolve()
460
+ # This date format is chosen specifically to create a lexical search order
461
+ # which matches the date order.
462
+ timestamp = datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
463
+ # Generate 4 random ascii characters to avoid collisions from multiple hyrax processes
464
+ # started in a shared filesystem environment.
465
+ random_str = base64.urlsafe_b64encode(random.randbytes(3)).decode("ascii")
466
+ directory = results_root / f"{timestamp}-{postfix}-{random_str}"
467
+ directory.mkdir(parents=True, exist_ok=False)
468
+ return directory
469
+
470
+
471
+ def find_most_recent_results_dir(config: ConfigDict, verb: str) -> Optional[Path]:
472
+ """Find the most recent results directory corresponding to a particular verb
473
+ This is a best effort search in the currently configured results root.
474
+
475
+ If result directories are created within 1 second of one another this function
476
+ will return one of the directories but it is undefined which one it will return.
477
+
478
+ This function may return None indicating it could not find a directory matching
479
+ the query verb
480
+ """
481
+ results_root = Path(config["general"]["results_dir"]).resolve()
482
+
483
+ max_timestamp = 0
484
+ best_path = None
485
+
486
+ for path in results_root.glob(f"*-{verb}-*"):
487
+ if path.is_dir():
488
+ regex = r"([0-9]{8})-([0-9]{6})-.*"
489
+ m = re.match(regex, path.name)
490
+
491
+ if m is None:
492
+ continue
493
+
494
+ timestamp = int(m[1] + m[2])
495
+ if timestamp > max_timestamp:
496
+ max_timestamp = timestamp
497
+ best_path = path
498
+
499
+ return best_path
500
+
501
+
502
+ def log_runtime_config(runtime_config: ConfigDict, output_path: Path, file_name: str = "runtime_config.toml"):
503
+ """Log a runtime configuration.
504
+
505
+ Parameters
506
+ ----------
507
+ runtime_config : ConfigDict
508
+ A ConfigDict object containing runtime configuration values.
509
+ output_path : str
510
+ The path to put the config file
511
+ file_name : str, Optional
512
+ Optional name for the config file, defaults to "runtime_config.toml"
513
+ """
514
+ with open(output_path / file_name, "w") as f:
515
+ f.write(tomlkit.dumps(runtime_config))
@@ -0,0 +1,13 @@
1
+ from .data_set_registry import DATA_SET_REGISTRY, HyraxDataset
2
+ from .hsc_data_set import HSCDataSet
3
+ from .hyrax_cifar_data_set import HyraxCifarDataSet
4
+ from .inference_dataset import InferenceDataSet
5
+
6
+ __all__ = [
7
+ "DATA_SET_REGISTRY",
8
+ "HyraxCifarDataSet",
9
+ "HSCDataSet",
10
+ "InferenceDataSet",
11
+ "Dataset",
12
+ "HyraxDataset",
13
+ ]