PTB-MR / mrpro

MR image reconstruction and processing.
https://ptb-mr.github.io/mrpro/
Apache License 2.0
17 stars 2 forks source link

Add ScaledFunctional implementing scalar*Functional #411

Closed fzimmermann89 closed 3 weeks ago

github-actions[bot] commented 1 month ago

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/mrpro/algorithms/csm
   inati.py24196%44
   walsh.py16194%34
src/mrpro/algorithms/dcf
   dcf_voronoi.py53492%15, 48–49, 76
src/mrpro/algorithms/optimizers
   adam.py20195%69
src/mrpro/algorithms/reconstruction
   DirectReconstruction.py281643%51–71, 85
   IterativeSENSEReconstruction.py422345%77–78, 88–98, 113–124, 138–149
   Reconstruction.py512453%41, 53–55, 79–86, 103–114
src/mrpro/data
   AcqInfo.py128298%174, 214
   CsmData.py28389%14, 81–83
   DcfData.py44882%17, 65, 77–82
   IData.py67987%119, 125, 129, 159–167
   IHeader.py75791%75, 109, 127–131
   KHeader.py1641790%24, 126–130, 157, 207, 218, 225–226, 229, 236, 275–286
   KNoise.py311552%39–52, 56–61
   KTrajectory.py69593%178–182
   MoveDataMixin.py1261489%14, 109, 125, 139–141, 202, 265, 279, 358, 378–379, 396–397
   QData.py39782%42, 65–73
   Rotation.py4472295%96, 277, 362, 364, 391, 446, 451, 454, 469, 486, 491, 634, 639, 642, 658, 662, 736, 738, 746–747, 987, 1069
   SpatialDimension.py46296%64, 103
   TrajectoryDescription.py14193%23
   acq_filters.py10190%47
src/mrpro/data/_kdata
   KData.py1051685%108–109, 118, 126, 180–181, 216, 221–222, 241–252
   KDataRemoveOsMixin.py29293%44, 46
   KDataSelectMixin.py20290%47, 63
   KDataSplitMixin.py48394%50, 80, 89
src/mrpro/data/traj_calculators
   KTrajectoryCalculator.py25292%23, 45
   KTrajectoryIsmrmrd.py13285%41, 50
   KTrajectoryPulseq.py29197%54
src/mrpro/operators
   CartesianSamplingOp.py50982%49–50, 55–56, 61–62, 88, 91, 114
   ConstraintsOp.py60297%46, 48
   EndomorphOperator.py64297%225, 231
   FiniteDifferenceOp.py27293%40, 105
   FourierOp.py77199%131
   Functional.py71593%20–22, 117, 119
   GridSamplingOp.py136993%72–73, 82–83, 90–91, 94, 96, 98
   LinearOperator.py1601292%54, 90, 189, 217, 258, 267, 275, 284, 292, 303, 401, 406
   MultiIdentityOp.py13285%44, 49
   Operator.py76297%24, 67
   ProximableFunctionalSeparableSum.py38392%49, 102, 109
   SliceProjectionOp.py173895%44, 61, 63, 69, 206, 227, 260, 300
   WaveletOp.py120596%152, 170, 205, 210, 233
   ZeroPadOp.py16194%30
src/mrpro/utils
   filters.py62297%44, 49
   modify_acq_info.py17194%12
   slice_profiles.py46687%20, 36, 113–116, 149
   sliding_window.py34197%34
   split_idx.py10280%43, 47
   summarize_tensorvalues.py11918%20–29
   typing.py12742%6–15
   zero_pad_or_crop.py31681%26, 30, 54, 57, 60, 63
TOTAL404230892% 

Tests Skipped Failures Errors Time
1869 0 :zzz: 0 :x: 0 :fire: 1m 34s :stopwatch:
fzimmermann89 commented 1 month ago

currently torch.tensor(1.) * L2SquaredFunctional() will result in mypy type Tensor|Functional. This is caused by wrong type hints in pytorch. I should fix https://github.com/pytorch/pytorch/pull/1353 and get it merged..

github-actions[bot] commented 1 month ago

:books: Documentation

:file_folder: Download as zip :mag: View online

fzimmermann89 commented 1 month ago

Scratch my previous responses. Scale must be float. The type hints in rmul must be complex, but rmul should return not implemented for complex.

fzimmermann89 commented 1 month ago

pre-commit.ci autofix

guastinimara commented 1 month ago

nice! I like it like this :)

fzimmermann89 commented 1 month ago

Please remember to do review