-
Notifications
You must be signed in to change notification settings - Fork 24
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
Scottx611x/expose extra directories #2447
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e03ec44
Fix bug when casting parameters to their expected types
scottx611x af54348
Add test coverage
scottx611x a44a59b
Expose `extra_directories` information in input.json
scottx611x 847b8aa
Update tests
scottx611x 6803569
Merge branch 'develop' into scottx611x/expose_extra_directories
scottx611x 6629c28
Update Parameter tests to use stronger assertions; Unfortunealy can't…
scottx611x 1b088f1
Remove redundant parens
scottx611x eb8551d
Merge branch 'scottx611x/expose_extra_directories' of https://github.…
scottx611x File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,7 +159,7 @@ class ToolDefinition(models.Model): | |
Visualizations, Other) will need to know about their expected inputs, | ||
outputs, and input file structuring. | ||
""" | ||
|
||
EXTRA_DIRECTORIES = "extra_directories" | ||
PARAMETERS = "parameters" | ||
WORKFLOW = 'WORKFLOW' | ||
VISUALIZATION = 'VISUALIZATION' | ||
|
@@ -204,14 +204,16 @@ def get_extra_directories(self): | |
""" | ||
if self.tool_type == ToolDefinition.VISUALIZATION: | ||
try: | ||
return self.get_annotation()["extra_directories"] | ||
return self.get_annotation()[self.EXTRA_DIRECTORIES] | ||
except KeyError: | ||
logger.error("ToolDefinition: %s's annotation is missing its " | ||
"`extra_directories` key.", self.name) | ||
"`%s` key.", self.name, self.EXTRA_DIRECTORIES) | ||
raise | ||
else: | ||
raise NotImplementedError( | ||
"Workflow-based tools don't utilize `extra_directories`" | ||
"Workflow-based tools don't utilize `{}`".format( | ||
self.EXTRA_DIRECTORIES | ||
) | ||
) | ||
|
||
def get_parameters(self): | ||
|
@@ -428,7 +430,11 @@ def _create_container_input_dict(self): | |
return { | ||
self.FILE_RELATIONSHIPS: self.get_file_relationships_urls(), | ||
ToolDefinition.PARAMETERS: self._get_visualization_parameters(), | ||
self.NODE_INFORMATION: self._get_detailed_input_nodes_dict() | ||
self.NODE_INFORMATION: self._get_detailed_input_nodes_dict(), | ||
ToolDefinition.EXTRA_DIRECTORIES: ( | ||
self.tool_definition.get_extra_directories() | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this should block, but the mix of |
||
|
||
} | ||
|
||
def _get_detailed_input_nodes_dict(self): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't think you need the surrounding paren here: There's no syntactic ambiguity without it.