NRLMMD-GEOIPS / geoips

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

274 Expose All GeoIPS Commands #528

Open evrose54 opened 2 months ago

evrose54 commented 2 months ago

Reviewer Checklist

Related Issues

fixes NRLMMD-GEOIPS/geoips#274

Summary

The aforementioned issue requested that we add functionality to expose all commands available in the GeoIPS environment. Rather than adding this functionality to setup.sh, I've decided to add another function to geoips_utils.py which will expose all GeoIPS commands in a tabular format. This will work for any new command added in the future as well. This function adds two new dependencies, toml and tabulate, though tabulate is added as a dependency to the CLI PRs anyways.

To use this new function, reinstall GeoIPS via pip install -e ., and run the command expose.

modified: pyproject.toml
modified: geoips/errors.py
modified: geoips/geoips_utils.py
added: tests/unit_tests/commandline/test_expose.py

Output

Here is the output of the new expose command.

(geoips) [evan@spring geoips]$ expose
-------------------------
Available GeoIPS Commands
-------------------------
╭───────────────────────────┬───────────────────────────────────────────────────╮
│ Command Name              │ Command Path                                      │
├───────────────────────────┼───────────────────────────────────────────────────┤
│ convert_trackfile_to_yaml │ geoips.commandline.convert_trackfile_to_yaml:main │
├───────────────────────────┼───────────────────────────────────────────────────┤
│ create_sector_image       │ geoips.commandline.create_sector_image:main       │
├───────────────────────────┼───────────────────────────────────────────────────┤
│ list_available_plugins    │ geoips.commandline.list_available_plugins:main    │
├───────────────────────────┼───────────────────────────────────────────────────┤
│ run_procflow              │ geoips.commandline.run_procflow:main              │
├───────────────────────────┼───────────────────────────────────────────────────┤
│ test_interfaces           │ geoips.commandline.test_interfaces:main           │
├───────────────────────────┼───────────────────────────────────────────────────┤
│ update_tc_tracks_database │ geoips.commandline.update_tc_tracks_database:main │
├───────────────────────────┼───────────────────────────────────────────────────┤
│ xml_to_yaml_sector        │ geoips.commandline.xml_to_yaml_sector:main        │
├───────────────────────────┼───────────────────────────────────────────────────┤
│ create_plugin_registries  │ geoips.create_plugin_registries:main              │
├───────────────────────────┼───────────────────────────────────────────────────┤
│ expose                    │ geoips.geoips_utils:expose_geoips_commands        │
╰───────────────────────────┴───────────────────────────────────────────────────╯
(geoips) [evan@spring geoips]$ expose -p data_fusion
------------------------------
Available Data_Fusion Commands
------------------------------
╭──────────────────────┬───────────────────────────────────────────────╮
│ Command Name         │ Command Path                                  │
├──────────────────────┼───────────────────────────────────────────────┤
│ data_fusion_procflow │ geoips.commandline.commandline_interface:main │
╰──────────────────────┴───────────────────────────────────────────────╯
(geoips) [evan@spring geoips]$ expose -p recenter_tc
No 'Recenter_Tc' Commands were found.
(geoips) [evan@spring geoips]$ expose -h
usage: expose command [-h] [--package_name {recenter_tc,geoips_glm,my_package,geoips,my_fusion_package,geoips_plugin_example,data_fusion,geoips_clavrx}]

options:
  -h, --help            show this help message and exit
  --package_name {recenter_tc,geoips_glm,my_package,geoips,my_fusion_package,geoips_plugin_example,data_fusion,geoips_clavrx}, -p {recenter_tc,geoips_glm,my_package,geoips,my_fusion_package,geoips_plugin_example,data_fusion,geoips_clavrx}
                        GeoIPS Plugin package to expose.
evrose54 commented 2 months ago

NOTE: This can likely be consolidated into the CLI in a future PR if we'd prefer that. Probably under geoips list console_scripts <-p> package_name.

biosafetylvl5 commented 2 months ago

All is working well for me! Here's my output on a clean docker build:

geoips_user@b3cbe9fb610e:/app/geoips_packages/geoips$ expose
-------------------------
Available Geoips Commands
-------------------------
╭───────────────────────────┬──────────────────────────────────────────╮
│ Command Name              │ Command Path                             │
├───────────────────────────┼──────────────────────────────────────────┤
│ convert_trackfile_to_yaml │ geoips.commandline.convert_trackfile_to_ │
│                           │ yaml:main                                │
├───────────────────────────┼──────────────────────────────────────────┤
│ create_sector_image       │ geoips.commandline.create_sector_image:m │
│                           │ ain                                      │
├───────────────────────────┼──────────────────────────────────────────┤
│ list_available_plugins    │ geoips.commandline.list_available_plugin │
│                           │ s:main                                   │
├───────────────────────────┼──────────────────────────────────────────┤
│ run_procflow              │ geoips.commandline.run_procflow:main     │
├───────────────────────────┼──────────────────────────────────────────┤
│ test_interfaces           │ geoips.commandline.test_interfaces:main  │
├───────────────────────────┼──────────────────────────────────────────┤
│ update_tc_tracks_database │ geoips.commandline.update_tc_tracks_data │
│                           │ base:main                                │
├───────────────────────────┼──────────────────────────────────────────┤
│ xml_to_yaml_sector        │ geoips.commandline.xml_to_yaml_sector:ma │
│                           │ in                                       │
├───────────────────────────┼──────────────────────────────────────────┤
│ create_plugin_registries  │ geoips.create_plugin_registries:main     │
├───────────────────────────┼──────────────────────────────────────────┤
│ expose                    │ geoips.geoips_utils:expose_geoips_comman │
│                           │ ds                                       │
╰───────────────────────────┴──────────────────────────────────────────╯
geoips_user@b3cbe9fb610e:/app/geoips_packages/geoips$