Skip to content

Add TypedDicts for resolve function return types#263

Closed
nx10 wants to merge 1 commit into
refactor/consolidate-bids-packagefrom
refactor/resolve-typedicts
Closed

Add TypedDicts for resolve function return types#263
nx10 wants to merge 1 commit into
refactor/consolidate-bids-packagefrom
refactor/resolve-typedicts

Conversation

@nx10
Copy link
Copy Markdown
Contributor

@nx10 nx10 commented Apr 3, 2026

  • Adds FunctionalInputs and MetricsInputs TypedDicts to match the QCInputs pattern already in bids/qc.py
  • Updates resolve_functional and resolve_metrics return type annotations
  • Re-exports all three TypedDicts from rbc.bids

No call-site changes needed since TypedDicts are still dicts.

Part of #259 (stacked on #260).

Unifies the pattern across all resolve functions: resolve_qc already
returned QCInputs (TypedDict), now resolve_functional returns
FunctionalInputs and resolve_metrics returns MetricsInputs. This gives
callers proper type safety when accessing resolved paths.

Part of #259.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 3, 2026

Coverage

Coverage Report
FileStmtsMissCoverMissing
rbc
   __init__.py10100% 
   context.py25868%70, 75–77, 79–80, 93–94
   metadata.py560100% 
rbc/bids
   __init__.py80100% 
   _schema.py585499%776, 782, 790, 1101
   anatomical.py120100% 
   builder.py72790%233–235, 362, 364–365, 386
   functional.py300100% 
   metrics.py230100% 
   qc.py170100% 
   query.py684238%100–104, 118–122, 124–125, 127–132, 134, 136, 150, 156–162, 195, 204, 206–213, 222, 254, 263–264
rbc/cli
   __init__.py80100% 
   all.py920100% 
   anatomical.py470100% 
   base.py37197%51
   functional.py620100% 
   longitudinal.py87198%182
   main.py430100% 
   metrics.py79396%69, 72, 84
   qc.py610100% 
   query.py340100% 
rbc/core
   __init__.py30100% 
   common.py21861%42–44, 58, 61–64
   fileops.py27485%69–72
   fsl2itk.py420100% 
   nifti.py192597%236–237, 244–245, 524
   niwrap.py56198%58
rbc/core/anatomical
   __init__.py40100% 
   registration.py14471%45, 137, 152, 167
   segmentation.py24866%61, 71–73, 89, 111, 122, 138
rbc/core/functional
   __init__.py130100% 
   coregistration.py7271%44, 55
   despiking.py7357%32, 36–37
   distortion.py1304069%269–271, 321, 324, 332–335, 341–346, 349, 352–353, 356, 365–369, 375–376, 387–388, 391, 397, 443–444, 447, 455, 461, 470–471, 474, 484, 491
   erosion.py32196%50
   initialization.py9455%35, 42–43, 63
   masking.py342526%53, 55–56, 58–59, 62–65, 69, 91, 134, 183, 197, 208, 223, 233, 249, 258, 271, 285, 296, 306, 319, 328
   motion.py573735%62, 64–67, 69, 71, 73, 76–77, 83–84, 86–87, 95–97, 99, 102, 105, 107, 124–125, 135–138, 159, 169, 171–172, 175, 177–179, 181, 183
   nuisance.py816025%78, 80–85, 87, 89–90, 93, 96–98, 100–102, 104–110, 112–116, 118, 163, 165, 167, 170–171, 173–175, 178, 181–182, 185–187, 190–193, 197, 203–205, 207, 235, 243, 269, 278, 307, 316, 322
   regressors.py89693%163, 193, 325–328
   resampling.py544320%37–42, 74–76, 78, 80–81, 85–87, 90, 93, 105, 107–108, 112, 114, 150–152, 154–155, 159, 161–162, 167–169, 173–174, 177, 180, 187, 199, 201–202, 207, 209
   timing.py161131%46–47, 49–53, 58, 60, 66–67
rbc/core/longitudinal
   __init__.py10100% 
   transform.py46784%106–107, 165–168, 170
rbc/core/metrics
   __init__.py30100% 
   alff.py90198%265
   reho.py660100% 
   smoothing.py7357%36, 42–43
   standardization.py271159%64, 66–68, 70, 72–75, 77–78
   timeseries.py57198%120
rbc/core/qc
   __init__.py60100% 
   dvars.py260100% 
   motion.py310100% 
   registration.py410100% 
   xcp.py410100% 
rbc/workflows
   __init__.py100100% 
   anatomical.py451957%76–85, 87, 154–157, 159–162
   functional.py985642%113–114, 122, 127–128, 136, 201–202, 205–206, 209–210, 213, 216–219, 229–231, 241–242, 245, 248, 251–252, 260–261, 268–269, 276–277, 284–285, 288–290, 293–296, 308–309, 321, 325–328, 331–332, 341–342, 350, 357, 426, 432
   metrics.py401757%83–84, 89–90, 93–96, 99–102, 106–109, 111
   qc.py513139%85, 87–88, 91, 94, 97–101, 104, 113–115, 119–122, 124–127, 129–130, 132–134, 137, 154, 161, 163
rbc_resources
   __init__.py300100% 
TOTAL307547484% 

Tests Skipped Failures Errors Time
763 0 💤 0 ❌ 0 🔥 10.839s ⏱️

@nx10
Copy link
Copy Markdown
Contributor Author

nx10 commented Apr 3, 2026

Merged into consolidated PR

@nx10 nx10 closed this Apr 3, 2026
@nx10 nx10 deleted the refactor/resolve-typedicts branch April 8, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant