rail.projects.catalog_factory module
- class rail.projects.catalog_factory.RailCatalogFactory[source]
Bases:
RailFactoryMixinFactory class to make catalogs
Expected usage is that user will define a yaml file with the various datasets that they wish to use with the following example syntax:
Catalogs: - CatalogTemplate name: truth path_template: "{catalogs_dir}/{project}_{sim_version}/{healpix}/part-0.parquet" iteration_vars: ['healpix'] - CatalogTemplate name: reduced path_template: "{catalogs_dir}/{project}_{sim_version}_{selection}/{healpix}/part-0.pq" iteration_vars: ['healpix']
Or the used can specifiy particular catalog instances where everything except the interation_vars are resolved
Catalogs: - CatalogTemplate name: truth_roman_rubin_v1.1.3_gold path_template: "full_path_to_catalog/{healpix}/part-0.parquet" iteration_vars: ['healpix']
- classmethod add_catalog_instance(catalog_instance)[source]
Add a particular catalog instance to the factory
- Return type:
None- Parameters:
catalog_instance (RailProjectCatalogInstance)
- classmethod add_catalog_template(catalog_template)[source]
Add a particular catalog template to the factory
- Return type:
None- Parameters:
catalog_template (RailProjectCatalogTemplate)
- property catalog_instances: dict[str, RailProjectCatalogInstance]
Return the dictionary of catalog instances
- property catalog_templates: dict[str, RailProjectCatalogTemplate]
Return the dictionary of catalog templates
- client_classes: list[type[Configurable]] = [<class 'rail.projects.catalog_template.RailProjectCatalogTemplate'>, <class 'rail.projects.catalog_template.RailProjectCatalogInstance'>]
- classmethod get_catalog_instance(name)[source]
Get a catalog instance by its assigned name
- Return type:
- Parameters:
name (str)
- classmethod get_catalog_instance_names()[source]
Return the names of the catalog instances lists
- Return type:
list[str]
- classmethod get_catalog_instances()[source]
Return the dict of all the catalog instances
- Return type:
dict[str,RailProjectCatalogInstance]
- classmethod get_catalog_template(name)[source]
Get catalog templates by it’s assigned name
- Return type:
- Parameters:
name (str)
- classmethod get_catalog_template_names()[source]
Return the names of the catalog templates
- Return type:
list[str]
- classmethod get_catalog_templates()[source]
Return the dict of all the catalog templates
- Return type:
dict[str,RailProjectCatalogTemplate]
- yaml_tag: str = 'Catalogs'