Skip to content

Commit

Permalink
Fixing formatting with black (#1280)
Browse files Browse the repository at this point in the history
  • Loading branch information
manasaV3 authored Oct 2, 2023
1 parent 5c1605d commit bed6fff
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion data-workflows/plugin/categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from nhcommons.models.category import get_category


def process_for_categories(labels: dict, version: str) -> (dict, dict):
categories = defaultdict(list)
category_hierarchy = defaultdict(list)
Expand Down Expand Up @@ -59,7 +60,7 @@ def merge_metadata_manifest_categories(
if len(merged_category):
metadata["category"] = merged_category
metadata["category_hierarchy"] = merged_hierarchy

# removing keys from manifest as they have been merged
del manifest["category"]
del manifest["category_hierarchy"]
Expand Down
2 changes: 1 addition & 1 deletion data-workflows/plugin/tests/test_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def test_aggregate_for_handling_empty_aggregate(
{"type": PMType.PYPI},
{"visibility": "HIDDEN"},
{"visibility": "BLOCKED"},
)
),
],
)
def test_aggregate_for_valid_data(
Expand Down
6 changes: 5 additions & 1 deletion data-workflows/plugin/tests/test_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

ONTOLOGY_VERSION = "EDAM-BIOIMAGING:alpha06"


def category_responses():
return [
[{"dimension": "Wrkflw", "hierarchy": ["Img reg"], "label": "Img reg1"}],
Expand Down Expand Up @@ -70,7 +71,10 @@ def setup(self, monkeypatch) -> None:
(
["Img reg1", "2D image", "Img reg2"],
{"Wrkflw": ["Img reg1", "Img reg2"], "Data": ["2D"]},
{"Wrkflw": [["Img reg1"], ["Img reg2", "Affine reg"]], "Data": [["2D"]]},
{
"Wrkflw": [["Img reg1"], ["Img reg2", "Affine reg"]],
"Data": [["2D"]],
},
),
],
)
Expand Down
2 changes: 2 additions & 0 deletions data-workflows/plugin/tests/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
def category_terms():
return ["Img reg", "2D image", "Affine reg", "Foo"]


def category_responses():
return [
[{"dimension": "Wrkflw", "hierarchy": ["Img reg"], "label": "Img reg1"}],
Expand All @@ -31,6 +32,7 @@ def category_responses():
[],
]


class TestMetadata:
@pytest.fixture
def expected(self) -> dict:
Expand Down

0 comments on commit bed6fff

Please sign in to comment.