From df7374b9ae4896819563868b14be3790a43c8f8a Mon Sep 17 00:00:00 2001 From: Ali Khosravi Date: Tue, 10 Dec 2024 16:04:02 +0100 Subject: [PATCH] Use public API to get the AiiDA config path (#387) --- src/aiida_workgraph/config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/aiida_workgraph/config.py b/src/aiida_workgraph/config.py index ab316c38..4fce3c41 100644 --- a/src/aiida_workgraph/config.py +++ b/src/aiida_workgraph/config.py @@ -1,5 +1,6 @@ import json -from aiida.manage.configuration.settings import AIIDA_CONFIG_FOLDER +from aiida.manage import get_config +from pathlib import Path WORKGRAPH_EXTRA_KEY = "_workgraph" WORKGRAPH_SHORT_EXTRA_KEY = "_workgraph_short" @@ -11,7 +12,8 @@ def load_config() -> dict: """Load the configuration from the config file.""" - config_file_path = AIIDA_CONFIG_FOLDER / "workgraph.json" + config = get_config() + config_file_path = Path(config.dirpath) / "workgraph.json" try: with config_file_path.open("r") as f: config = json.load(f)