@@ -143,7 +143,7 @@ def _is_file(path, parser):
143
143
144
144
145
145
def _parse_validate ():
146
- """Create and configure the argument parser for the " cubids validate" command.
146
+ """Create and configure the argument parser for the ` cubids validate` command.
147
147
148
148
This function sets up an argument parser with various options for running
149
149
the BIDS validator, including specifying the BIDS dataset directory, output
@@ -152,7 +152,7 @@ def _parse_validate():
152
152
Returns
153
153
-------
154
154
argparse.ArgumentParser
155
- Configured argument parser for the " cubids validate" command.
155
+ Configured argument parser for the ` cubids validate` command.
156
156
157
157
Parameters
158
158
----------
@@ -174,7 +174,7 @@ def _parse_validate():
174
174
listed subjects.
175
175
"""
176
176
parser = argparse .ArgumentParser (
177
- description = "cubids- validate: Wrapper around the official BIDS Validator" ,
177
+ description = "cubids validate: Wrapper around the official BIDS Validator" ,
178
178
formatter_class = argparse .ArgumentDefaultsHelpFormatter ,
179
179
)
180
180
PathExists = partial (_path_exists , parser = parser )
@@ -244,7 +244,7 @@ def _parse_validate():
244
244
245
245
246
246
def _enter_validate (argv = None ):
247
- """Entry point for the ' cubids-validate' command.
247
+ """Entry point for the ` cubids-validate` command.
248
248
249
249
This function is deprecated and will be removed in the future.
250
250
Please use 'cubids validate' instead.
@@ -276,7 +276,7 @@ def _enter_validate(argv=None):
276
276
277
277
278
278
def _parse_bids_version ():
279
- """Parse command-line arguments for the BIDS version command.
279
+ """Parse command-line arguments for the `cubids bids- version` command.
280
280
281
281
This function sets up an argument parser for the `cubids bids-version` command,
282
282
which retrieves the BIDS Validator and Schema version for a given BIDS dataset.
@@ -325,7 +325,11 @@ def _parse_bids_version():
325
325
326
326
327
327
def _enter_bids_version (argv = None ):
328
- """Parses command-line arguments and invokes the `bids_version` workflow.
328
+ """Entry point for the deprecated `cubids-bids-version`.
329
+
330
+ This function serves as the entry point for the BIDS version command-line
331
+ functionality. It parses command-line arguments, issues a deprecation
332
+ warning, and invokes the corresponding workflow.
329
333
330
334
Parameters
331
335
----------
@@ -335,16 +339,28 @@ def _enter_bids_version(argv=None):
335
339
Returns
336
340
-------
337
341
None
342
+
343
+ Warns
344
+ -----
345
+ DeprecationWarning
346
+ Indicates that the `cubids-bids-version` command is deprecated and
347
+ will be removed in the future.
338
348
"""
349
+ warnings .warn (
350
+ "cubids-bids-version is deprecated and will be removed in the future. "
351
+ "Please use cubids bids-version." ,
352
+ DeprecationWarning ,
353
+ stacklevel = 2 ,
354
+ )
339
355
options = _parse_bids_version ().parse_args (argv )
340
356
args = vars (options ).copy ()
341
357
workflows .bids_version (** args )
342
358
343
359
344
360
def _parse_bids_sidecar_merge ():
345
- """Create an argument parser for merging BIDS sidecar JSON files .
361
+ """Create an argument parser for the `cubids bids- sidecar-merge` command .
346
362
347
- This function sets up an argument parser for the `bids-sidecar-merge` command-line tool,
363
+ This function sets up an argument parser for the `cubids bids-sidecar-merge` command-line tool,
348
364
which merges critical keys from one BIDS sidecar JSON file into another.
349
365
350
366
Returns
@@ -385,7 +401,7 @@ def _parse_bids_sidecar_merge():
385
401
386
402
387
403
def _enter_bids_sidecar_merge (argv = None ):
388
- """Entry point for the BIDS sidecar merge command-line interface .
404
+ """Entry point for the deprecated `cubids-enter-bids- sidecar command` .
389
405
390
406
This function serves as the entry point for the BIDS sidecar merge
391
407
functionality. It parses command-line arguments, issues a deprecation
@@ -401,10 +417,6 @@ def _enter_bids_sidecar_merge(argv=None):
401
417
DeprecationWarning
402
418
Indicates that the `bids-sidecar-merge` command is deprecated and
403
419
will be removed in the future.
404
-
405
- Notes
406
- -----
407
- This function is intended to be used as a command-line entry point.
408
420
"""
409
421
warnings .warn (
410
422
"bids-sidecar-merge is deprecated and will be removed in the future. "
@@ -418,9 +430,9 @@ def _enter_bids_sidecar_merge(argv=None):
418
430
419
431
420
432
def _parse_group ():
421
- """Parses command-line arguments for the CuBIDS group command.
433
+ """Parse command-line arguments for the `cubids group` command.
422
434
423
- This function sets up an argument parser for the `cubids- group` command,
435
+ This function sets up an argument parser for the `cubids group` command,
424
436
which is used to find key and parameter groups in a BIDS dataset.
425
437
426
438
Returns
@@ -448,7 +460,7 @@ def _parse_group():
448
460
Path to a config file for grouping. If not provided, the default config file from CuBIDS will be used.
449
461
"""
450
462
parser = argparse .ArgumentParser (
451
- description = "cubids- group: find key and parameter groups in BIDS" ,
463
+ description = "cubids group: find key and parameter groups in BIDS" ,
452
464
formatter_class = argparse .ArgumentDefaultsHelpFormatter ,
453
465
)
454
466
PathExists = partial (_path_exists , parser = parser )
@@ -502,11 +514,11 @@ def _parse_group():
502
514
503
515
504
516
def _enter_group (argv = None ):
505
- """Handles the entry point for the deprecated ' cubids-group' command.
517
+ """Entry point for the deprecated ` cubids-group` command.
506
518
507
- This function issues a deprecation warning indicating that ' cubids-group'
519
+ This function issues a deprecation warning indicating that ` cubids-group`
508
520
is deprecated and will be removed in the future. It then parses the
509
- command-line arguments and invokes the ' group' workflow with the parsed
521
+ command-line arguments and invokes the ` group` workflow with the parsed
510
522
arguments.
511
523
512
524
Parameters
@@ -535,9 +547,9 @@ def _enter_group(argv=None):
535
547
536
548
537
549
def _parse_apply ():
538
- """Parse command-line arguments for the `cubids- apply` command.
550
+ """Parse command-line arguments for the `cubids apply` command.
539
551
540
- This function sets up an argument parser for the `cubids- apply` command,
552
+ This function sets up an argument parser for the `cubids apply` command,
541
553
which applies changes specified in a TSV file to a BIDS directory.
542
554
543
555
Returns
@@ -565,7 +577,7 @@ def _parse_apply():
565
577
Path to a config file for grouping. If not provided, the default config file from CuBIDS will be used.
566
578
"""
567
579
parser = argparse .ArgumentParser (
568
- description = ("cubids- apply: apply the changes specified in a tsv to a BIDS directory" ),
580
+ description = ("cubids apply: apply the changes specified in a tsv to a BIDS directory" ),
569
581
formatter_class = argparse .ArgumentDefaultsHelpFormatter ,
570
582
)
571
583
PathExists = partial (_path_exists , parser = parser )
@@ -680,7 +692,7 @@ def _enter_apply(argv=None):
680
692
681
693
682
694
def _parse_datalad_save ():
683
- """Create an argument parser for the `cubids- datalad-save` command.
695
+ """Create an argument parser for the `cubids datalad-save` command.
684
696
685
697
This function sets up an argument parser for performing a DataLad save on a BIDS directory.
686
698
It includes arguments for specifying the BIDS directory, a commit message, and an optional
@@ -703,7 +715,7 @@ def _parse_datalad_save():
703
715
image tag or Singularity image file.
704
716
"""
705
717
parser = argparse .ArgumentParser (
706
- description = ("cubids- datalad-save: perform a DataLad save on a BIDS directory" ),
718
+ description = ("cubids datalad-save: perform a DataLad save on a BIDS directory" ),
707
719
formatter_class = argparse .ArgumentDefaultsHelpFormatter ,
708
720
)
709
721
PathExists = partial (_path_exists , parser = parser )
@@ -765,16 +777,16 @@ def _enter_datalad_save(argv=None):
765
777
766
778
767
779
def _parse_undo ():
768
- """Create an argument parser for the ' cubids- undo' command.
780
+ """Create an argument parser for the ` cubids undo` command.
769
781
770
- This function sets up an argument parser for the ' cubids- undo' command,
782
+ This function sets up an argument parser for the ` cubids undo` command,
771
783
which is used to revert the most recent commit in a BIDS dataset. It
772
784
defines the required and optional arguments for the command.
773
785
774
786
Returns
775
787
-------
776
788
argparse.ArgumentParser
777
- The argument parser for the ' cubids- undo' command.
789
+ The argument parser for the ` cubids undo` command.
778
790
779
791
Parameters
780
792
----------
@@ -788,7 +800,7 @@ def _parse_undo():
788
800
- container: Docker image tag or Singularity image file.
789
801
"""
790
802
parser = argparse .ArgumentParser (
791
- description = "cubids- undo: revert most recent commit" ,
803
+ description = "cubids undo: revert most recent commit" ,
792
804
formatter_class = argparse .ArgumentDefaultsHelpFormatter ,
793
805
)
794
806
PathExists = partial (_path_exists , parser = parser )
@@ -812,9 +824,9 @@ def _parse_undo():
812
824
813
825
814
826
def _enter_undo (argv = None ):
815
- """Handle the ' cubids-undo' command-line interface (CLI) entry point .
827
+ """Entry point for the deprecated ` cubids-undo` command.
816
828
817
- This function is called when the ' cubids-undo' command is executed.
829
+ This function is called when the ` cubids-undo` command is executed.
818
830
It displays a deprecation warning and then parses the command-line
819
831
arguments to execute the undo workflow.
820
832
@@ -827,8 +839,8 @@ def _enter_undo(argv=None):
827
839
Warns
828
840
-----
829
841
DeprecationWarning
830
- Indicates that ' cubids-undo' is deprecated and will be removed
831
- in the future. Users should use ' cubids undo' instead.
842
+ Indicates that ` cubids-undo` is deprecated and will be removed
843
+ in the future. Users should use ` cubids undo` instead.
832
844
833
845
Returns
834
846
-------
@@ -845,9 +857,9 @@ def _enter_undo(argv=None):
845
857
846
858
847
859
def _parse_copy_exemplars ():
848
- """Parse command-line arguments for the cubids- copy-exemplars script.
860
+ """Parse command-line arguments for the ` cubids copy-exemplars` script.
849
861
850
- This function sets up an argument parser for the cubids- copy-exemplars script,
862
+ This function sets up an argument parser for the ` cubids copy-exemplars` script,
851
863
which creates and saves a directory with one subject from each Acquisition Group
852
864
in the BIDS dataset.
853
865
@@ -882,7 +894,7 @@ def _parse_copy_exemplars():
882
894
"""
883
895
parser = argparse .ArgumentParser (
884
896
description = (
885
- "cubids- copy-exemplars: create and save a directory with "
897
+ "cubids copy-exemplars: create and save a directory with "
886
898
"one subject from each Acquisition Group in the BIDS dataset"
887
899
),
888
900
formatter_class = argparse .ArgumentDefaultsHelpFormatter ,
@@ -964,7 +976,7 @@ def _parse_copy_exemplars():
964
976
965
977
966
978
def _enter_copy_exemplars (argv = None ):
967
- """Entry point for the ' cubids-copy-exemplars' command.
979
+ """Entry point for the deprecated ` cubids-copy-exemplars` command.
968
980
969
981
This function is deprecated and will be removed in the future.
970
982
It parses command-line arguments and invokes the `copy_exemplars`
@@ -992,9 +1004,9 @@ def _enter_copy_exemplars(argv=None):
992
1004
993
1005
994
1006
def _parse_add_nifti_info ():
995
- """Parse command-line arguments for adding NIfTI information to BIDS dataset sidecars .
1007
+ """Parse command-line arguments for the `cubids add-nifti-info` command .
996
1008
997
- This function sets up an argument parser for the `cubids- add-nifti-info` command,
1009
+ This function sets up an argument parser for the `cubids add-nifti-info` command,
998
1010
which adds information from NIfTI files to the sidecars of each dataset in a BIDS
999
1011
directory.
1000
1012
@@ -1017,7 +1029,7 @@ def _parse_add_nifti_info():
1017
1029
"""
1018
1030
parser = argparse .ArgumentParser (
1019
1031
description = (
1020
- "cubids- add-nifti-info: Add information from nifti"
1032
+ "cubids add-nifti-info: Add information from nifti"
1021
1033
"files to the sidecars of each dataset"
1022
1034
),
1023
1035
formatter_class = argparse .ArgumentDefaultsHelpFormatter ,
@@ -1055,7 +1067,7 @@ def _parse_add_nifti_info():
1055
1067
1056
1068
1057
1069
def _enter_add_nifti_info (argv = None ):
1058
- """Entry point for adding NIfTI information via command line interface .
1070
+ """Entry point for the deprecated `cubids-add-nifti-info` command.
1059
1071
1060
1072
This function is deprecated and will be removed in the future.
1061
1073
Please use `cubids add-nifti-info` instead.
@@ -1087,9 +1099,9 @@ def _enter_add_nifti_info(argv=None):
1087
1099
1088
1100
1089
1101
def _parse_purge ():
1090
- """Parse command-line arguments for the `cubids- purge` command.
1102
+ """Parse command-line arguments for the `cubids purge` command.
1091
1103
1092
- This function sets up an argument parser for the `cubids- purge` command,
1104
+ This function sets up an argument parser for the `cubids purge` command,
1093
1105
which is used to purge associations from a BIDS dataset. It defines the
1094
1106
required arguments and options for the command.
1095
1107
@@ -1111,7 +1123,7 @@ def _parse_purge():
1111
1123
- `--container`: Docker image tag or Singularity image file.
1112
1124
"""
1113
1125
parser = argparse .ArgumentParser (
1114
- description = "cubids- purge: purge associations from the dataset" ,
1126
+ description = "cubids purge: purge associations from the dataset" ,
1115
1127
formatter_class = argparse .ArgumentDefaultsHelpFormatter ,
1116
1128
)
1117
1129
PathExists = partial (_path_exists , parser = parser )
@@ -1153,10 +1165,10 @@ def _parse_purge():
1153
1165
1154
1166
1155
1167
def _enter_purge (argv = None ):
1156
- """Entry point for the ' cubids-purge' command.
1168
+ """Entry point for the deprecated ` cubids-purge` command.
1157
1169
1158
1170
This function is deprecated and will be removed in the future.
1159
- Please use ' cubids purge' instead.
1171
+ Please use ` cubids purge` instead.
1160
1172
1161
1173
Parameters
1162
1174
----------
@@ -1184,16 +1196,16 @@ def _enter_purge(argv=None):
1184
1196
1185
1197
1186
1198
def _parse_remove_metadata_fields ():
1187
- """Create an argument parser for removing metadata fields from a BIDS dataset .
1199
+ """Create an argument parser for the `cubids remove-metadata- fields` command .
1188
1200
1189
1201
This function sets up an argument parser for the command-line interface (CLI)
1190
- tool `cubids- remove-metadata-fields`, which is used to delete specified fields
1202
+ tool `cubids remove-metadata-fields`, which is used to delete specified fields
1191
1203
from the metadata of a BIDS dataset.
1192
1204
1193
1205
Returns
1194
1206
-------
1195
1207
argparse.ArgumentParser
1196
- The argument parser configured for the `cubids- remove-metadata-fields` CLI tool.
1208
+ The argument parser configured for the `cubids remove-metadata-fields` CLI tool.
1197
1209
1198
1210
Parameters
1199
1211
----------
@@ -1210,7 +1222,7 @@ def _parse_remove_metadata_fields():
1210
1222
Docker image tag or Singularity image file.
1211
1223
"""
1212
1224
parser = argparse .ArgumentParser (
1213
- description = "cubids- remove-metadata-fields: delete fields from metadata" ,
1225
+ description = "cubids remove-metadata-fields: delete fields from metadata" ,
1214
1226
formatter_class = argparse .ArgumentDefaultsHelpFormatter ,
1215
1227
)
1216
1228
PathExists = partial (_path_exists , parser = parser )
@@ -1241,10 +1253,10 @@ def _parse_remove_metadata_fields():
1241
1253
1242
1254
1243
1255
def _enter_remove_metadata_fields (argv = None ):
1244
- """Set entrypoint for " cubids-remove-metadata-fields" CLI .
1256
+ """Entry point for the deprecated ` cubids-remove-metadata-fields` command .
1245
1257
1246
1258
This function serves as the entry point for the deprecated
1247
- " cubids-remove-metadata-fields" command-line interface (CLI). It issues a
1259
+ ` cubids-remove-metadata-fields` command-line interface (CLI). It issues a
1248
1260
deprecation warning and then parses the provided arguments to execute the
1249
1261
`remove_metadata_fields` workflow.
1250
1262
@@ -1256,15 +1268,14 @@ def _enter_remove_metadata_fields(argv=None):
1256
1268
Warns
1257
1269
-----
1258
1270
DeprecationWarning
1259
- Indicates that the " cubids-remove-metadata-fields" CLI is deprecated and
1260
- will be removed in the future. Users are advised to use " cubids remove-metadata-fields" instead.
1271
+ Indicates that the ` cubids-remove-metadata-fields` CLI is deprecated and
1272
+ will be removed in the future. Users are advised to use ` cubids remove-metadata-fields` instead.
1261
1273
1262
1274
See Also
1263
1275
--------
1264
1276
_parse_remove_metadata_fields : Function to parse the command-line arguments.
1265
1277
workflows.remove_metadata_fields : Workflow to remove metadata fields.
1266
1278
"""
1267
- """Set entrypoint for "cubids-remove-metadata-fields" CLI."""
1268
1279
warnings .warn (
1269
1280
"cubids-remove-metadata-fields is deprecated and will be removed in the future. "
1270
1281
"Please use cubids remove-metadata-fields." ,
@@ -1277,15 +1288,15 @@ def _enter_remove_metadata_fields(argv=None):
1277
1288
1278
1289
1279
1290
def _parse_print_metadata_fields ():
1280
- """Create the parser for the " cubids print-metadata-fields" command.
1291
+ """Create the parser for the ` cubids print-metadata-fields` command.
1281
1292
1282
1293
This function sets up an argument parser for the command that prints all unique metadata fields
1283
1294
in a BIDS dataset. It defines the required arguments and their types, as well as optional arguments.
1284
1295
1285
1296
Returns
1286
1297
-------
1287
1298
argparse.ArgumentParser
1288
- The argument parser for the " cubids print-metadata-fields" command.
1299
+ The argument parser for the ` cubids print-metadata-fields` command.
1289
1300
1290
1301
Parameters
1291
1302
----------
@@ -1299,7 +1310,7 @@ def _parse_print_metadata_fields():
1299
1310
"""
1300
1311
"""Create the parser for the "cubids print-metadata-fields" command."""
1301
1312
parser = argparse .ArgumentParser (
1302
- description = "cubids- print-metadata-fields: print all unique metadata fields" ,
1313
+ description = "cubids print-metadata-fields: print all unique metadata fields" ,
1303
1314
formatter_class = argparse .ArgumentDefaultsHelpFormatter ,
1304
1315
)
1305
1316
PathExists = partial (_path_exists , parser = parser )
@@ -1323,9 +1334,9 @@ def _parse_print_metadata_fields():
1323
1334
1324
1335
1325
1336
def _enter_print_metadata_fields (argv = None ):
1326
- """Parse command-line arguments and print metadata fields.
1337
+ """Entry point for the deprecated `cubids-print- metadata- fields` command .
1327
1338
1328
- This function parses the command-line arguments for printing metadata fields,
1339
+ This function parses the command-line arguments for `cubids-print- metadata- fields` ,
1329
1340
issues a deprecation warning, and then calls the `print_metadata_fields`
1330
1341
function from the `workflows` module with the parsed arguments.
1331
1342
@@ -1373,9 +1384,9 @@ def _enter_print_metadata_fields(argv=None):
1373
1384
1374
1385
1375
1386
def _get_parser ():
1376
- """Create the general " cubids" parser object.
1387
+ """Create the general ` cubids` parser object.
1377
1388
1378
- This function sets up the argument parser for the " cubids" command-line interface.
1389
+ This function sets up the argument parser for the ` cubids` command-line interface.
1379
1390
It includes a version argument and dynamically adds subparsers for each command
1380
1391
defined in the COMMANDS list.
1381
1392
@@ -1405,7 +1416,7 @@ def _get_parser():
1405
1416
1406
1417
1407
1418
def _main (argv = None ):
1408
- """Set entrypoint for " cubids" CLI.
1419
+ """Set entrypoint for ` cubids` CLI.
1409
1420
1410
1421
Parameters
1411
1422
----------
@@ -1416,7 +1427,6 @@ def _main(argv=None):
1416
1427
-------
1417
1428
None
1418
1429
"""
1419
- """Set entrypoint for "cubids" CLI."""
1420
1430
options = _get_parser ().parse_args (argv )
1421
1431
args = vars (options ).copy ()
1422
1432
args .pop ("func" )
0 commit comments