Skip to content

Commit 71b43b9

Browse files
committed
feat: Add backwards compatibility and DeprecationWarning
1 parent 9e96316 commit 71b43b9

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/smriprep/workflows/surfaces.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"""
3030

3131
import typing as ty
32+
import warnings
3233

3334
from nipype.interfaces import freesurfer as fs
3435
from nipype.interfaces import io as nio
@@ -1321,8 +1322,9 @@ def init_anat_ribbon_wf(name='anat_ribbon_wf'):
13211322

13221323
def init_resample_surfaces_wf(
13231324
surfaces: list[str],
1324-
space: str,
1325-
density: str,
1325+
density: str | None = None,
1326+
grayord_density: str | None = None,
1327+
space: str = 'fsLR',
13261328
name: str = 'resample_surfaces_wf',
13271329
):
13281330
"""
@@ -1367,6 +1369,17 @@ def init_resample_surfaces_wf(
13671369
import templateflow.api as tf
13681370
from niworkflows.engine.workflows import LiterateWorkflow as Workflow
13691371

1372+
if density is None:
1373+
if grayord_density is None:
1374+
raise ValueError('No density specified. Set density argument.')
1375+
density = '32k' if grayord_density == '91k' else '59k'
1376+
warnings.warn(
1377+
'Deprecated grayord_density passed. Replace with\n\t'
1378+
"density='32k' if grayord_density == '91k' else '59k'",
1379+
DeprecationWarning,
1380+
stacklevel=2,
1381+
)
1382+
13701383
workflow = Workflow(name=name)
13711384

13721385
inputnode = pe.Node(

0 commit comments

Comments
 (0)