def is_known_project_format(format_name: str) -> bool: """Check if a data format is in the project_io registry. Parameters ---------- format_name : str Name of the project io plugin under which it is registered. Returns ------- bool Whether or not the data format is a registered project io plugin. """ return is_registered_plugin(plugin_register_key=format_name, plugin_registry=__PluginRegistry.project_io)
def is_known_model(model_type: str) -> bool: """Check if a model is in the model registry. Parameters ---------- model_type : str Name of the model under which it is registered. Returns ------- bool Whether or not the model is registered. """ return is_registered_plugin( plugin_register_key=model_type, plugin_registry=__PluginRegistry.model )
def is_known_megacomplex(megacomplex_type: str) -> bool: """Check if a megacomplex is in the megacomplex registry. Parameters ---------- megacomplex_type : str Name of the megacomplex under which it is registered. Returns ------- bool Whether or not the megacomplex is registered. """ return is_registered_plugin( plugin_register_key=megacomplex_type, plugin_registry=__PluginRegistry.megacomplex )
def test_is_registered_plugin(): """Registered name in registry""" assert is_registered_plugin("sdt", mock_registry_data_io) assert not is_registered_plugin("not-registered", mock_registry_data_io)