Source code for

from typing import TYPE_CHECKING, List, Optional, Tuple

from rastervision.pipeline.config import (Config, register_config, Field,
from import RasterTransformerConfig

    from import (RasterSource, SceneConfig)
    from rastervision.core.rv_pipeline import RVPipelineConfig

def rs_config_upgrader(cfg_dict: dict, version: int) -> dict:
    if version == 6:
        # removed in version 7
        if cfg_dict.get('extent_crop') is not None:
            raise ConfigError('RasterSourceConfig.extent_crop is deprecated.')
            del cfg_dict['extent_crop']
        except KeyError:
    elif version == 9:
        # renamed in version 10
        cfg_dict['bbox'] = cfg_dict.get('extent')
            del cfg_dict['extent']
        except KeyError:
    return cfg_dict

[docs]@register_config('raster_source', upgrader=rs_config_upgrader) class RasterSourceConfig(Config): """Configure a :class:`.RasterSource`.""" channel_order: Optional[List[int]] = Field( None, description= 'The sequence of channel indices to use when reading imagery.') transformers: List[RasterTransformerConfig] = [] bbox: Optional[Tuple[int, int, int, int]] = Field( None, description='User-specified bbox in pixel coords in the form ' '(ymin, xmin, ymax, xmax). Useful for cropping the raster source so ' 'that only part of the raster is read from.')
[docs] def build(self, tmp_dir: Optional[str] = None, use_transformers: bool = True) -> 'RasterSource': raise NotImplementedError()
[docs] def update(self, pipeline: Optional['RVPipelineConfig'] = None, scene: Optional['SceneConfig'] = None) -> None: for t in self.transformers: t.update(pipeline, scene)