You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve input validation in all make_* functions - #433
Motivated by #398 and future refactoring plans, I added input validations for almost all arguments of our make_* functions.
While touching the files, I also standardised the docstrings, added missing parameters etc.
This leads to many code changes, however, 99.9% do NOT affect the code itself. The only (slight) logic change is in make_block_pulse, because I didn't like the if elif cases with a pass statement in the middle of the block.
And I added the duration attribute to ADC when giving it as an argument. This was missing before.
In the first commit, I already changed make_adc to always set adc.duration. Previously, adc.duration was only set in the dwell-path, which was inconsistent IMO.
To keep event objects consistent regardless of how they're created, Sequence.get_block() reconstruction now restores adc.duration as num_samples * dwell, the same formula make_adc and calc_duration use. Therefore, users can rely on the attribute existing on every ADC event now.
Making sure adc.duration always exists pointed out a latent bug: check_timing div-checked adc.duration against rf_raster_time, which produced many false-positive RASTER errors in epi_se_rs and mprage. The reason why it was checking against rf_raster_time is that adc.delay has to lie on the RF raster, which we are/were correctly checking before in the code. The (wrong) duration check was previously never triggered, because reconstructed ADCs (using seq.get_block() in check_timing()) never had a duration attribute.
check_timing() now correctly div-checks adc.delay against rf_raster_time and adc.duration against adc_raster_time for all ADC events independent of how they were created and/or restored.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivated by #398 and future refactoring plans, I added input validations for almost all arguments of our
make_*functions.While touching the files, I also standardised the docstrings, added missing parameters etc.
This leads to many code changes, however, 99.9% do NOT affect the code itself. The only (slight) logic change is in
make_block_pulse, because I didn't like theif elifcases with a pass statement in the middle of the block.And I added the
durationattribute to ADC when giving it as an argument. This was missing before.I also added tests for the new input validations.
Closes #398