-
Notifications
You must be signed in to change notification settings - Fork 32
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
Python script runner api #1282
Python script runner api #1282
Conversation
|
||
|
||
# Require an additional python file | ||
def load_utility(procedure_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
load_utility and require_utility need to work differently in Python.
If I require_utility or load_utility I should expect to have new methods to call. (like the collect() utility method from collect.py)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supported not support
@@ -45,8 +45,6 @@ def load_utility(procedure_name): | |||
return False | |||
|
|||
|
|||
require_utility = load_utility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is breaking. There is no harm in supporting both require_utility and load_utility.
# not_cached = require(procedure_name) | ||
pass | ||
else: | ||
raise RuntimeError("load_utility not support outside of Script Runner") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supported not support
@@ -1339,7 +1335,6 @@ def load_utility(procedure_name): | |||
|
|||
|
|||
setattr(openc3.script, "load_utility", load_utility) | |||
setattr(openc3.script, "require_utility", load_utility) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is breaking, don't remove.
|
||
|
||
# Require an additional python file | ||
def load_utility(procedure_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supported not support
def test_load_utility_raises(self): | ||
with self.assertRaisesRegex( | ||
RuntimeError, | ||
"load_utility not support outside of Script Runner", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supported not support
Quality Gate passedIssues Measures |
Basic implementation done but wanted to discuss the best way to test (not tested currently)
closes #1281