Registry#
- class Registry[source]#
Bases:
object
A registry for resources that are built-in or contributed by plugins.
Methods
__init__
()add_config
(type_hint, config, plugin[, upgrader])Add a Config.
add_file_system
(file_system)Add a FileSystem.
add_plugin_command
(cmd)Add a click command contributed by a plugin.
add_runner
(runner_name, runner)Add a Runner.
add_rv_config_schema
(config_section, ...)Add section of schema used by RVConfig.
Discover all raster vision plugins.
get_config
(type_hint)Get a Config class associated with a type_hint.
get_file_system
(uri[, mode])Get a FileSystem used to handle the file type of a URI.
get_plugin
(type_hint)Get module path of plugin when Config class with type_hint is defined.
Get the click commands contributed by plugins.
get_plugin_from_alias
(alias)get_plugin_version
(plugin)Get latest version of plugin.
get_runner
(runner_name)Return a Runner class based on its name.
Return RVConfig schema.
get_type_hint_lineage
(type_hint)Get the lineage for a type hint.
get_upgrader
(type_hint)Get function that upgrades config dicts for type_hint.
Add all builtin resources.
load_plugins
([plugin_names])Load plugins and register their resources.
register_renamed_type_hints
(type_hint_old, ...)Register renamed type_hints.
set_plugin_aliases
(plugin, aliases)set_plugin_version
(plugin, version)Set the latest version of a plugin.
- add_config(type_hint: str, config: type['Config'], plugin: str, upgrader=None)[source]#
Add a Config.
- add_file_system(file_system: FileSystem)[source]#
Add a FileSystem.
- Parameters:
file_system (FileSystem) – the FileSystem class to add
- add_plugin_command(cmd: Command)[source]#
Add a click command contributed by a plugin.
- Parameters:
cmd (Command) –
- add_rv_config_schema(config_section: str, config_fields: list[str])[source]#
Add section of schema used by RVConfig.
- get_file_system(uri: str, mode: str = 'r') type['FileSystem'] [source]#
Get a FileSystem used to handle the file type of a URI.
- get_plugin(type_hint: str) str [source]#
Get module path of plugin when Config class with type_hint is defined.
- get_plugin_commands() list[click.core.Command] [source]#
Get the click commands contributed by plugins.
- Return type:
list[click.core.Command]
- get_upgrader(type_hint: str) collections.abc.Callable[[dict, int], dict] | None [source]#
Get function that upgrades config dicts for type_hint.
- Parameters:
type_hint (str) –
- Return type:
collections.abc.Callable[[dict, int], dict] | None
- load_plugins(plugin_names: Optional[Iterable[str]] = None) None [source]#
Load plugins and register their resources.
Import each Python module within the rastervision namespace package and call the register_plugin function at its root (if it exists).
- register_renamed_type_hints(type_hint_old: str, type_hint_new: str)[source]#
Register renamed type_hints.