Skip to content

Commit 306a2e2

Browse files
committed
Expand ruamel.yaml aliases
1 parent 4128878 commit 306a2e2

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

bidscoin/bcoin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import urllib.request
1515
import time
1616
import argparse
17+
import copy
1718
from duecredit.cmdline import cmd_summary
1819
from functools import lru_cache
1920
from importlib.metadata import entry_points
@@ -29,6 +30,7 @@
2930
from bidscoin import templatefolder, pluginfolder, bidsmap_template, tutorialurl, trackusage, tracking, configfile, config, DEBUG
3031

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

3335
LOGGER = logging.getLogger(__name__)
3436

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies = ['pandas',
2222
'numpy',
2323
'pydicom >= 2',
2424
'PyQt6',
25-
'ruamel-yaml >= 0.15.35',
25+
'ruamel-yaml > 0.17.2',
2626
'tomli >= 1.1.0 ; python_version < "3.11"',
2727
'coloredlogs',
2828
'tqdm >= 4.60.0',

tests/test_heuristics.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import jsonschema
22
import json
3+
import copy
34
from bidscoin import bcoin, bidscoinroot
45
from ruamel.yaml import YAML
56
yaml = YAML()
7+
yaml.composer.return_alias = lambda s: copy.deepcopy(s) # Expand aliases (https://stackoverflow.com/questions/66977002/yaml-anchor-for-sequence/66983530#66983530)
68

79
bcoin.setup_logging()
810

0 commit comments

Comments
 (0)