Skip to content

Commit

Permalink
Expand ruamel.yaml aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelzwiers committed Feb 5, 2024
1 parent 4128878 commit 306a2e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions bidscoin/bcoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import urllib.request
import time
import argparse
import copy
from duecredit.cmdline import cmd_summary
from functools import lru_cache
from importlib.metadata import entry_points
Expand All @@ -29,6 +30,7 @@
from bidscoin import templatefolder, pluginfolder, bidsmap_template, tutorialurl, trackusage, tracking, configfile, config, DEBUG

yaml = YAML()
yaml.composer.return_alias = lambda s: copy.deepcopy(s) # Expand aliases (https://stackoverflow.com/questions/66977002/yaml-anchor-for-sequence/66983530#66983530)

LOGGER = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies = ['pandas',
'numpy',
'pydicom >= 2',
'PyQt6',
'ruamel-yaml >= 0.15.35',
'ruamel-yaml > 0.17.2',
'tomli >= 1.1.0 ; python_version < "3.11"',
'coloredlogs',
'tqdm >= 4.60.0',
Expand Down
2 changes: 2 additions & 0 deletions tests/test_heuristics.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import jsonschema
import json
import copy
from bidscoin import bcoin, bidscoinroot
from ruamel.yaml import YAML
yaml = YAML()
yaml.composer.return_alias = lambda s: copy.deepcopy(s) # Expand aliases (https://stackoverflow.com/questions/66977002/yaml-anchor-for-sequence/66983530#66983530)

bcoin.setup_logging()

Expand Down

0 comments on commit 306a2e2

Please sign in to comment.