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

576 get cmd class factories #644

Open evrose54 opened 1 week ago

evrose54 commented 1 week ago

Reviewer Checklist

Related Issues

fixes NRLMMD-GEOIPS/geoips#573 fixes NRLMMD-GEOIPS/geoips#576

Testing Instructions

Run pytest -v ./tests/unit_tests/commandline/

Summary

This branch refactors commands which use the form of geoips get <interface_name> to make use of class factories. Before, we had to run commands such as:

The aforementioned commands were overly verbose and needed some refactoring to reduce the levels required to execute a certain command. In this branch, we refactored GeoipsGetInterface to be a base command for get <interface_name>, get <interface_name> family <family_name>, and get <interface_name> <plugin_name>. This resulted in the removal of GeoipsGetFamily and GeoipsGetPlugin and the refactoring of GeoipsGetInterface to include the functionality of those other commands. We can use class factories for each interface to execute these commands now.

On top of this, we implemented aliases for a variety of CLI commands. For an exact listing of aliases available for each command, see geoips/commandline/ancillary_info/alias_mapping.yaml, which includes aliases supported for each command. Now, we can run a verbose command such as:

and replace it with

This also reduces the verbosity of certain CLI commands. Note, the unit tests have been modified to reflect these changes.

modified: .gitignore
modified: pyproject.toml
modified: docs/source/_templates/conf_PKG.py
modified: docs/source/userguide/command_line.rst
modified: geoips/commandline/ancillary_info/cmd_instructions.yaml
modified: geoips/commandline/cmd_instructions.py
modified: geoips/commandline/commandline_interface.py
modified: geoips/commandline/geoips_command.py
modified: geoips/commandline/geoips_get.py
modified: tests/unit_tests/commandline/cli_top_level_tester.py
modified: tests/unit_tests/commandline/test_geoips_get_family.py
modified: tests/unit_tests/commandline/test_geoips_get_interface.py
modified: tests/unit_tests/commandline/test_geoips_get_package.py
modified: tests/unit_tests/commandline/test_geoips_get_plugin.py
modified: tests/unit_tests/commandline/test_geoips_list_interface.py
modified: tests/unit_tests/commandline/test_geoips_list_interfaces.py
modified: tests/unit_tests/commandline/test_geoips_list_packages.py
modified: tests/unit_tests/commandline/test_geoips_list_plugins.py
modified: tests/unit_tests/commandline/test_geoips_list_scripts.py
modified: tests/unit_tests/commandline/test_geoips_list_test_datasets.py
modified: tests/unit_tests/commandline/test_geoips_list_unit_tests.py
modified: tests/unit_tests/commandline/test_get_commandline_instructions.py
added: geoips/commandline/ancillary_info/alias_mapping.yaml