NRLMMD-GEOIPS / geoips

Main Geolocated Information Processing System code base with basic functionality enabled.
https://nrlmmd-geoips.github.io/geoips/
Other
14 stars 11 forks source link

Need to Address Text-Based Plugins #492

Open evrose54 opened 5 months ago

evrose54 commented 5 months ago

Requested Update

Description

GeoIPS currently implements three plugin types, those being Module-Based, Text-Based, and Yaml-Based. In reality, only Module and Yaml based plugins are fully implemented, whereas text-based plugins exist in an unfinished state. There currently is no interface built for text-based plugins (specifically ascii-palettes), and we should consider either creating an interface or creating a process which can dynamically convert text-based ascii palette plugins to a colormapper plugin on the fly.

Background and Motivation

This stems from PR #437, which adds a function to interfaces.__init__.py called list_available_interfaces. This method parses through the interface directory structure and uses importlib to retrieve implemented interfaces that have been created as a python module. Since there is no python module for the text-based ascii palette interface, this function will not list ascii palettes as an available interface. This is why we either need to create a new interface for these, or create a converter which will transform these ascii palettes into color mappers on the fly.

Alternative Solutions

The way I see it, we have three choices.

  1. Create a text-based ascii palette interface (python module)
  2. Convert these ascii palettes to a colormapper at runtime
  3. (My preferred choice) During create_plugin_registries, create colormapper plugins for each ascii palette. To do so, we'd need to find all ascii palettes, read each file to retrieve information needed to create a colormapper, and generate static colormapper plugins that can be used in place of the ascii palettes. They'd implement the same colormap, but when a text-based ascii palette is selected to be used, we'd alias to the corresponding colormapper and use that instead.

I'm more than happy to hear peoples' thoughts on this. Just comment and let me know what you're thinking if you have any ideas on this one.