Skip to content

Draft: Release 2.0

Vincent Delbar requested to merge develop into master

Refacs:

Features:

  • Add summarize options to control extended filenames stripping !73 (merged)
  • Add support for remote and / or compressed files as input !74 (merged)
  • Allow dotted parameters in kwargs using underscores #65 (closed)
  • Enhanced metadata management #49 (closed)
  • Add to_xarray #64
  • Fix #80 - may be this can wait another release

Tests:

  • Pass tests with otb8 + py37 on win11
  • Add missing tests for Operator
  • Add missing tests for functions.py #59

Packaging, style and various updates :

Renaming (!65 (merged) ):

  • get_infos --> get_info
  • key_output_image --> output_image_key
  • key_input_image --> input_image_key
  • read_values_at_coords --> get_values_at_coords
  • xy_to_rowcol --> get_rowcol_from_xy
  • write() arg filename_extension --> ext_fname
  • logicalOperation --> LogicalOperation
  • otbObject --> RasterInterface --> OTBObject
  • App.save_objects() --> App.__sync_parameters()

New class tree

classDiagram
  class App {
    app
    data : dict
    elapsed_time
    exports_dic
    frozen : bool
    input_image_key
    input_key
    name
    output_image_key
    output_key
    outputs : dict
    parameters
    parameters_keys : tuple
    quiet : bool
    execute()
    flush()
    get_first_key() str
    propagate_dtype(target_key: str, dtype: int)
    set_parameters()
    write() bool
  }
  class Input {
    filepath : Path
  }
  class LogicalOperation {
    logical_exp : str
    logical_exp_bands : list
    logical_fake_exp_bands : list
    build_fake_expressions(operator: str, inputs: list[OTBObject | str | int | float], nb_bands: int)
  }
  class OTBObject {
    abstract name
    abstract app
    abstract exports_dic
    abstract output_image_key
    dtype
    shape
    transform
    metadata
    channels_list_from_slice(bands: slice) list[int]
    export(key: str, preserve_dtype: bool) dict[str, dict[str, np.ndarray]]
    get_info() dict[str, (str, float, list[float])]
    get_rowcol_from_xy(x: float, y: float) tuple[int, int]
    get_statistics() dict[str, (str, float, list[float])]
    get_values_at_coords(row: int, col: int, bands: int) list[int | float] | int | float
    to_numpy(key: str, preserve_dtype: bool, copy: bool) np.ndarray
    to_rasterio() tuple[np.ndarray, dict[str, Any]]
  }
  class OTBTFApp {
    set_nb_sources()
  }
  class Operation {
    exp : str
    exp_bands : list
    fake_exp_bands : list
    im_count : int
    im_dic : dict
    inputs : list
    nb_channels : dict
    operator : str
    unique_inputs
    build_fake_expressions(operator: str, inputs: list[OTBObject | str | int | float], nb_bands: int)
    get_real_exp(fake_exp_bands: str) tuple[list[str], str]
    make_fake_exp(x: OTBObject | str, band: int, keep_logical: bool) tuple[str, list[OTBObject], int]
  }
  class Output {
    app
    exports_dic
    filepath : Optional[str]
    name
    output_image_key
    param_key : Optional[str]
    parent_pyotb_app
    exists() bool
    make_parent_dirs()
    write(filepath: None | str | Path) bool
  }
  class Slicer {
    cols
    input
    one_band_sliced
    rows
  }
  OTBTFApp --|> App
  App --|> OTBObject
  Input --|> App
  LogicalOperation --|> Operation
  Operation --|> App
  Output --|> OTBObject
  Slicer --|> App
  App --* Output : parent_pyotb_app
Edited by Vincent Delbar

Merge request reports