imr-framework / pypulseq

Pulseq in Python
https://pypulseq.readthedocs.io
GNU Affero General Public License v3.0
115 stars 62 forks source link

ValueError in make_block_pulse.py when not difining the use parameter #48

Closed schuenke closed 3 years ago

schuenke commented 3 years ago

Since https://github.com/imr-framework/pypulseq/commit/7542b39630c1c4cefc6eb5ded3ddb290a54e487c the _make_blockpulse.py throws the ValueError ValueError: Invalid use parameter. Must be one of 'excitation', 'refocusing' or 'inversion'. Passed: when use is not defined. The reason is that the default for use is an empty string now, but in line 64 you check for a None. This can be fixed by changing line 64 to:

if use != '' and use not in valid_use_pulses:

sravan953 commented 3 years ago

Please let me know if pulling from the latest dev commit fixes this issue for you.

schuenke commented 3 years ago

Unfortunately you forgot to add a return in the else statement. It must be

    if return_gz:
        return rf, gz
    else:
        return rf

instead of

    if return_gz:
        return rf, gz
    else:
        rf
sravan953 commented 3 years ago

Oh darn, oops, will fix.

schuenke commented 3 years ago

Issue is fixed now. Thanks @sravan953 !