Skip to content

Commit

Permalink
Use public API to get the AiiDA config path (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
khsrali authored Dec 10, 2024
1 parent 96ad5e7 commit df7374b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/aiida_workgraph/config.py
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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)
Expand Down

0 comments on commit df7374b

Please sign in to comment.