Skip to content

Commit

Permalink
Merge pull request #1336 from Sage-Bionetworks/develop-viz-api-FDS-1391
Browse files Browse the repository at this point in the history
Resolved an issue where a visualization endpoint intermittently returned the wrong information
  • Loading branch information
mialy-defelice authored Dec 13, 2023
2 parents 7bf43cb + 2cf78d0 commit 4186cc7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion schematic/visualization/tangled_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ def get_node_layers_json(self, topological_gen, source_nodes, child_parents, par

return layers_json

def save_outputs(self, save_file, layers_json, cn='', all_layers=[]):
def save_outputs(self, save_file, layers_json, cn='', all_layers=None):
'''
Inputs:
save_file (bool): Indicates whether to save a file locally or not.:
Expand All @@ -702,6 +702,8 @@ def save_outputs(self, save_file, layers_json, cn='', all_layers=[]):
If save_file == False: Each string represents contains the layers for a single tangled tree.
If save_file ==True: is an empty list.
'''
if all_layers is None:
all_layers = []
if save_file == True:
if cn:
output_file_name = f"{self.schema_abbr}_{self.figure_type}_{cn}_tangled_tree.json"
Expand Down
1 change: 1 addition & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,7 @@ def test_visualize_attributes(self, client, data_model_jsonld):

@pytest.mark.parametrize("figure_type", ["component", "dependency"])
def test_visualize_tangled_tree_layers(self, client, figure_type, data_model_jsonld):
# TODO: Determine a 2nd data model to use for this test, test both models sequentially, add checks for content of response
params = {
"schema_url": data_model_jsonld,
"figure_type": figure_type
Expand Down

0 comments on commit 4186cc7

Please sign in to comment.