From c03c8e353c61c69a807e80ec9d986bb652c41155 Mon Sep 17 00:00:00 2001 From: Bento007 Date: Fri, 23 Feb 2024 15:46:16 -0800 Subject: [PATCH 1/3] chore: moving the generated artifacts --- .github/workflows/validate_curated_lists.yml | 2 +- .../cell_class_list.json | 0 .../cell_subclass_list.json | 0 .../src/ontology-references => ontology-assets}/organ_list.json | 0 .../ontology-references => ontology-assets}/system_list.json | 0 .../tissue_general_list.json | 0 tools/ontology-builder/src/env.py | 1 + tools/ontology-builder/src/validate_curated_lists.py | 2 +- 8 files changed, 3 insertions(+), 2 deletions(-) rename {tools/ontology-builder/src/ontology-references => ontology-assets}/cell_class_list.json (100%) rename {tools/ontology-builder/src/ontology-references => ontology-assets}/cell_subclass_list.json (100%) rename {tools/ontology-builder/src/ontology-references => ontology-assets}/organ_list.json (100%) rename {tools/ontology-builder/src/ontology-references => ontology-assets}/system_list.json (100%) rename {tools/ontology-builder/src/ontology-references => ontology-assets}/tissue_general_list.json (100%) diff --git a/.github/workflows/validate_curated_lists.yml b/.github/workflows/validate_curated_lists.yml index b23aa637..52165b2b 100644 --- a/.github/workflows/validate_curated_lists.yml +++ b/.github/workflows/validate_curated_lists.yml @@ -3,7 +3,7 @@ name: Validate Curated List Update on: push: paths: - - "**/tools/ontology-builder/src/ontology-references/**.json" + - "ontology-references/**.json" - "**/artifact-schemas/**.json" branches-ignore: - main diff --git a/tools/ontology-builder/src/ontology-references/cell_class_list.json b/ontology-assets/cell_class_list.json similarity index 100% rename from tools/ontology-builder/src/ontology-references/cell_class_list.json rename to ontology-assets/cell_class_list.json diff --git a/tools/ontology-builder/src/ontology-references/cell_subclass_list.json b/ontology-assets/cell_subclass_list.json similarity index 100% rename from tools/ontology-builder/src/ontology-references/cell_subclass_list.json rename to ontology-assets/cell_subclass_list.json diff --git a/tools/ontology-builder/src/ontology-references/organ_list.json b/ontology-assets/organ_list.json similarity index 100% rename from tools/ontology-builder/src/ontology-references/organ_list.json rename to ontology-assets/organ_list.json diff --git a/tools/ontology-builder/src/ontology-references/system_list.json b/ontology-assets/system_list.json similarity index 100% rename from tools/ontology-builder/src/ontology-references/system_list.json rename to ontology-assets/system_list.json diff --git a/tools/ontology-builder/src/ontology-references/tissue_general_list.json b/ontology-assets/tissue_general_list.json similarity index 100% rename from tools/ontology-builder/src/ontology-references/tissue_general_list.json rename to ontology-assets/tissue_general_list.json diff --git a/tools/ontology-builder/src/env.py b/tools/ontology-builder/src/env.py index ac8f84db..5967afe8 100644 --- a/tools/ontology-builder/src/env.py +++ b/tools/ontology-builder/src/env.py @@ -8,3 +8,4 @@ ONTO_INFO_YAML = os.path.join(FIXTURES_ROOT, "ontology_info.yml") PARSED_ONTOLOGIES_FILE = os.path.join(FIXTURES_ROOT, "all_ontology.json.gz") SCHEMA_DIR = os.path.join(os.path.realpath(__file__).rsplit("/", maxsplit=4)[0], "artifact-schemas") +ONTOLOGY_ASSETS = os.path.join(os.path.realpath(__file__).rsplit("/", maxsplit=4)[0], "ontology-assets") diff --git a/tools/ontology-builder/src/validate_curated_lists.py b/tools/ontology-builder/src/validate_curated_lists.py index 6a9321e9..e27fa48e 100644 --- a/tools/ontology-builder/src/validate_curated_lists.py +++ b/tools/ontology-builder/src/validate_curated_lists.py @@ -29,7 +29,7 @@ def verify_json(schema_file_name: str, json_file_name: str) -> bool: return True -def main(path: str = env.ONTOLOGY_REF_DIR) -> None: +def main(path: str = env.ONTOLOGY_ASSETS) -> None: """ Verify the curated JSON lists match their respective JSON schema in artifact-schemas :param path: The destination path for the json files From 939e62b033cc6e59245785353e93c745b1b0ad8b Mon Sep 17 00:00:00 2001 From: Bento007 Date: Mon, 26 Feb 2024 11:09:10 -0800 Subject: [PATCH 2/3] suggestions --- .github/workflows/validate_curated_lists.yml | 2 +- tools/ontology-builder/src/env.py | 5 +++-- tools/ontology-builder/src/validate_curated_lists.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate_curated_lists.yml b/.github/workflows/validate_curated_lists.yml index 52165b2b..d5a1fc42 100644 --- a/.github/workflows/validate_curated_lists.yml +++ b/.github/workflows/validate_curated_lists.yml @@ -3,7 +3,7 @@ name: Validate Curated List Update on: push: paths: - - "ontology-references/**.json" + - "**/ontology-assets/**.json" - "**/artifact-schemas/**.json" branches-ignore: - main diff --git a/tools/ontology-builder/src/env.py b/tools/ontology-builder/src/env.py index 5967afe8..a65bbce1 100644 --- a/tools/ontology-builder/src/env.py +++ b/tools/ontology-builder/src/env.py @@ -7,5 +7,6 @@ RAW_ONTOLOGY_DIR = os.path.join(ONTOLOGY_REF_DIR, "raw-files") ONTO_INFO_YAML = os.path.join(FIXTURES_ROOT, "ontology_info.yml") PARSED_ONTOLOGIES_FILE = os.path.join(FIXTURES_ROOT, "all_ontology.json.gz") -SCHEMA_DIR = os.path.join(os.path.realpath(__file__).rsplit("/", maxsplit=4)[0], "artifact-schemas") -ONTOLOGY_ASSETS = os.path.join(os.path.realpath(__file__).rsplit("/", maxsplit=4)[0], "ontology-assets") +ROOT_DIR = os.path.realpath(__file__).rsplit("/", maxsplit=4)[0] +SCHEMA_DIR = os.path.join(ROOT_DIR, "artifact-schemas") +ONTOLOGY_ASSETS_DIR = os.path.join(ROOT_DIR, "ontology-assets") diff --git a/tools/ontology-builder/src/validate_curated_lists.py b/tools/ontology-builder/src/validate_curated_lists.py index e27fa48e..3d91e344 100644 --- a/tools/ontology-builder/src/validate_curated_lists.py +++ b/tools/ontology-builder/src/validate_curated_lists.py @@ -29,7 +29,7 @@ def verify_json(schema_file_name: str, json_file_name: str) -> bool: return True -def main(path: str = env.ONTOLOGY_ASSETS) -> None: +def main(path: str = env.ONTOLOGY_ASSETS_DIR) -> None: """ Verify the curated JSON lists match their respective JSON schema in artifact-schemas :param path: The destination path for the json files From 1d86f30cb30bfa7d728f6c15805a52a2ab7ce2d6 Mon Sep 17 00:00:00 2001 From: Bento007 Date: Mon, 26 Feb 2024 11:18:29 -0800 Subject: [PATCH 3/3] suggestions --- tools/ontology-builder/src/env.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ontology-builder/src/env.py b/tools/ontology-builder/src/env.py index a65bbce1..d796b67b 100644 --- a/tools/ontology-builder/src/env.py +++ b/tools/ontology-builder/src/env.py @@ -7,6 +7,6 @@ RAW_ONTOLOGY_DIR = os.path.join(ONTOLOGY_REF_DIR, "raw-files") ONTO_INFO_YAML = os.path.join(FIXTURES_ROOT, "ontology_info.yml") PARSED_ONTOLOGIES_FILE = os.path.join(FIXTURES_ROOT, "all_ontology.json.gz") -ROOT_DIR = os.path.realpath(__file__).rsplit("/", maxsplit=4)[0] -SCHEMA_DIR = os.path.join(ROOT_DIR, "artifact-schemas") -ONTOLOGY_ASSETS_DIR = os.path.join(ROOT_DIR, "ontology-assets") +PROJECT_ROOT_DIR = os.path.realpath(__file__).rsplit("/", maxsplit=4)[0] +SCHEMA_DIR = os.path.join(PROJECT_ROOT_DIR, "artifact-schemas") +ONTOLOGY_ASSETS_DIR = os.path.join(PROJECT_ROOT_DIR, "ontology-assets")