diff --git a/learnware/market/easy2/organizer.py b/learnware/market/easy2/organizer.py index 6c0327d..f6122ca 100644 --- a/learnware/market/easy2/organizer.py +++ b/learnware/market/easy2/organizer.py @@ -337,7 +337,7 @@ class EasyOrganizer(BaseOrganizer): Learnware ids """ if check_status is None: - filtered_ids = self.use_flags.keys() + filtered_ids = list(self.use_flags.keys()) elif check_status in [BaseChecker.NONUSABLE_LEARNWARE, BaseChecker.USABLE_LEARWARE]: filtered_ids = [key for key, value in self.use_flags.items() if value == check_status] else: diff --git a/tests/test_market/test_easy.py b/tests/test_market/test_easy.py index 5d4fb02..973864d 100644 --- a/tests/test_market/test_easy.py +++ b/tests/test_market/test_easy.py @@ -27,15 +27,6 @@ user_semantic = { "Scenario": {"Values": ["Education"], "Type": "Tag"}, "Description": {"Values": "", "Type": "String"}, "Name": {"Values": "", "Type": "String"}, - "Input": { - - }, - "Output": { - "Dimension": 10, - "Description": { - "0": "the probability of the label is zero", - }, - }, } @@ -47,7 +38,7 @@ class TestMarket(unittest.TestCase): def _init_learnware_market(self): """initialize learnware market""" - easy_market = instantiate_learnware_market(market_id="sklearn_digits", name="easy", rebuild=True) + easy_market = instantiate_learnware_market(market_id="sklearn_digits_easy", name="easy", rebuild=True) return easy_market def test_prepare_learnware_randomly(self, learnware_num=5): @@ -107,7 +98,8 @@ class TestMarket(unittest.TestCase): semantic_spec = copy.deepcopy(user_semantic) semantic_spec["Name"]["Values"] = "learnware_%d" % (idx) semantic_spec["Description"]["Values"] = "test_learnware_number_%d" % (idx) - semantic_spec["Output"] = {"Dimension": 1, "Description": {"0": "The label of the hand-written digit."}} + semantic_spec["Input"] = {"Dimension": 64, "Description": {f"{i}": f"The value in the grid {i // 8}{i % 8} of the image of hand-written digit." for i in range(64)}} + semantic_spec["Output"] = {"Dimension": 10, "Description": {f"{i}": "The probability for each digit for 0 to 9." for i in range(10)}} easy_market.add_learnware(zip_path, semantic_spec) print("Total Item:", len(easy_market)) diff --git a/tests/test_workflow/test_workflow.py b/tests/test_workflow/test_workflow.py index aaeab40..d2b9c38 100644 --- a/tests/test_workflow/test_workflow.py +++ b/tests/test_workflow/test_workflow.py @@ -96,7 +96,7 @@ class TestAllWorkflow(unittest.TestCase): semantic_spec = copy.deepcopy(user_semantic) semantic_spec["Name"]["Values"] = "learnware_%d" % (idx) semantic_spec["Description"]["Values"] = "test_learnware_number_%d" % (idx) - semantic_spec["Output"] = {"Dimension": 1, "Description": {"0": "The label of the hand-written digit."}} + semantic_spec["Output"] = {"Dimension": 10, "Description": {f"{i}": "The probability for each digit for 0 to 9." for i in range(10)}} easy_market.add_learnware(zip_path, semantic_spec) print("Total Item:", len(easy_market))