Skip to content

Commit

Permalink
FIX: build_schema
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudocubic committed Nov 7, 2024
1 parent 04b9d9e commit 08dcca4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
poetry install
- name: Build Schema
run: |
poetry run python docs/source/scripts/schema_deploy.py # Update to the correct command
poetry run python schema/build_schema.py
- name: Upload Schema as artifact
uses: actions/upload-artifact@v4
with:
Expand Down
Empty file removed schema/.gitkeep
Empty file.
12 changes: 8 additions & 4 deletions docs/source/scripts/schema_deploy.py → schema/build_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
from ravens.schema.decompose_schema import Schemas


def build_schema_docs():
def build_schema():
current_dir = os.path.dirname(os.path.abspath(__file__))
template_path = os.path.join(current_dir, "../../../ravens/cim_tools/cim_conversion_template.json")
xmi_path = os.path.join(current_dir, "../../../cim/iec61970cim17v40_iec61968cim13v13b_iec62325cim03v17b_CIM100.1.1.1_mgravens24v1.xmi")
schema_dir = os.path.join(current_dir, "../../../schema")
template_path = os.path.join(current_dir, "../ravens/cim_tools/cim_conversion_template.json")
xmi_path = os.path.join(current_dir, "../cim/iec61970cim17v40_iec61968cim13v13b_iec62325cim03v17b_CIM100.1.1.1_mgravens24v1.xmi")
schema_dir = os.path.join(current_dir, "../schema")

uml_data = parse_uml_data(xmi_path)

Expand Down Expand Up @@ -50,3 +50,7 @@ def build_schema_docs():
filename = k.split("/")[-1].replace(".json", "")
with open(os.path.join(schema_dir, f"{filename}.json"), "w") as f:
json.dump(v, f, indent=2)


if __name__ == "__main__":
build_schema()

0 comments on commit 08dcca4

Please sign in to comment.