Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not require every plugin recorded in the model bundle to be installed when using it #1916

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions rastervision_pipeline/rastervision/pipeline/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import List, Type, Union, Optional, Callable, Dict, TYPE_CHECKING
import inspect
import logging

from pydantic import ( # noqa
BaseModel, create_model, Field, root_validator, validate_model,
Expand All @@ -14,6 +15,8 @@
if TYPE_CHECKING:
from rastervision.pipeline.pipeline_config import PipelineConfig

log = logging.getLogger(__name__)


class ConfigError(ValueError):
"""Exception raised for invalid configuration."""
Expand Down Expand Up @@ -212,14 +215,16 @@ def upgrade_plugin_versions(plugin_versions: Dict[str, int]) -> Dict[str, int]:

"""
new_plugin_versions = {}
missing_plugins = []
for alias, version in plugin_versions.items():
plugin = registry.get_plugin_from_alias(alias)
if plugin:
new_plugin_versions[plugin] = version
else:
raise ConfigError(
'The plugin_versions field contains an unrecognized '
f'plugin name: {alias}.')
missing_plugins.append(alias)
if len(missing_plugins) > 0:
log.warning('There are plugins listed in the pipeline config that are '
f'not currently installed: {missing_plugins}')
return new_plugin_versions


Expand Down