Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

55 rewrite interface to enable non ai plugins #58

Merged
merged 24 commits into from
Oct 25, 2023

Conversation

Evana13G
Copy link
Contributor

No description provided.

@Evana13G Evana13G marked this pull request as draft October 11, 2023 19:44
@Evana13G Evana13G force-pushed the 55-rewrite-interface-to-enable-nonAI-plugins branch from b5a6a50 to f5dc9cc Compare October 12, 2023 15:16
Evana Gizzi and others added 11 commits October 12, 2023 22:26
…ion between regular AI plugins and complex reasoning plug ins
Some isolation issues exist with new function parse_plugins_list
parse_plugins_list is untested still
  has errors
    config_filepath does not exist in this function
    is still called from other tests, but does not cause failures
Config files
  changes reflect the location and name changes
  using __init__.py files to locate modules
Example Plugin modules removed _plugin from directory/module name
<module_name>_plugin.py contains the Plugin Class for that module
Full unit test coverage on _plugin.py files and plugin_import
  Note: plugin_import test contains a new testing concept
  mocking __import__ builtin method intereferes with test fail output
  mocker.stop is used to remove mocking before most test results
  the __import__ checks remain but are done first before stop
  after stop, test error output is intact, prior to stop INTERNALERROR
    will occur and indicates problems with the __import__ only
    this provides for testing with minimal output disruption
Added all arg plugins
Added fake headers and tests as separate fakes
Assert now in order of operations
@asgibson asgibson linked an issue Oct 19, 2023 that may be closed by this pull request
@cfirth-nasa cfirth-nasa marked this pull request as ready for review October 19, 2023 17:55
Plugin lists are now dicts
  term list was used to describe objects that are dicts
  removed list and replaced with dict
ExecutionEngine
  Moved RUN_FLAGS access into try block
   lack of RUN_FLAGS in config raises KeyError
   this now catches that and reports full config info like DEFAULT
   still labeled as optional because missing flags result in False
  Commented Plugins as required data
    allowed to be empty dict
    keywords must still be in config
  KeyError no longer possible in parse_plugins_dict (formerly _list)
    removed try block in function
  Updated error messages in parse_plugins_dict for clarity
test_execution_engine
  Updated tests for changes and full coverage+
Copy link
Contributor

@the-other-james the-other-james left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good, and I'm really liking the direction we are going!

The big thing that this merge needs is an update to the README which includes a diagram that shows:

  • How the four plugin types fit in
  • The flow of low level and high level
  • How vehicle representation fits into this

Maybe that is big enough to be its own issue/merge... but we need something to help newcomers understand the system.

onair/src/ai_components/learners_interface.py Show resolved Hide resolved
onair/src/ai_components/planners_interface.py Show resolved Hide resolved
onair/src/reasoning/agent.py Show resolved Hide resolved
onair/src/run_scripts/execution_engine.py Show resolved Hide resolved
onair/src/run_scripts/execution_engine.py Show resolved Hide resolved
onair/src/util/plugin_import.py Show resolved Hide resolved
@the-other-james
Copy link
Contributor

I'm also happy to make a diagram with mermaid if you send me a sketch.

@codecov-commenter
Copy link

codecov-commenter commented Oct 20, 2023

Codecov Report

Merging #58 (4d955ce) into main (aa27888) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #58   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        24    +2     
  Lines          942       986   +44     
  Branches       131       134    +3     
=========================================
+ Hits           942       986   +44     
Files Coverage Δ
onair/src/ai_components/ai_plugin_abstract/core.py 100.00% <100.00%> (ø)
onair/src/ai_components/learners_interface.py 100.00% <100.00%> (ø)
onair/src/ai_components/planners_interface.py 100.00% <100.00%> (ø)
onair/src/reasoning/agent.py 100.00% <100.00%> (ø)
onair/src/reasoning/complex_reasoning_interface.py 100.00% <100.00%> (ø)
onair/src/run_scripts/execution_engine.py 100.00% <100.00%> (ø)
onair/src/run_scripts/sim.py 100.00% <100.00%> (ø)
onair/src/systems/vehicle_rep.py 100.00% <100.00%> (ø)
onair/src/util/plugin_import.py 100.00% <100.00%> (ø)

test_salient_event_does_nothing in learners_interface
  missing LearnersInterface
  now test_LearnersInterface_salient_event_does_nothing
test_planners_interface.py
  added missing test section comments
  removed unnecessary imports
@Evana13G
Copy link
Contributor Author

I'm also happy to make a diagram with mermaid if you send me a sketch.

I sent you the link to the original one, but I wont be able to update with the new interfaces until next week

update function
  test was randomly missing coverage with a 0 length argument
  led to discovery that updates were not passing correct data
  vehicle data now updated first with frame
    now a separate function
  then tests are run and status updated with results
  then constructs updated with curr_data
     now in its own function
unit tests updated for changes and full coverage
Agent reason function
  was not properly sending curr_data to learning systems
  now updating data and using curr_data
  no more sending arguments to render_resoning (was not used in func)
Simplified empty subsystems test
Added test for all empty labels
Simplified success test
  used index 'i' for label keys to ensure unique keys
  reduced arrange phase setup
Copy link
Contributor

@cfirth-nasa cfirth-nasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested at this commit and able to replicate demo functionality!

Copy link
Contributor

@the-other-james the-other-james left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I'm glad the vehicle representation got more scrutiny thanks to the unit test issue.

@asgibson asgibson merged commit dcf8207 into main Oct 25, 2023
2 checks passed
@asgibson asgibson deleted the 55-rewrite-interface-to-enable-nonAI-plugins branch November 3, 2023 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-write interface to enable non-AI plugins
6 participants