imr-framework / pypulseq

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

Integer definitions are missed in `write_seq.py` #49

Closed sravan953 closed 3 years ago

sravan953 commented 3 years ago

Describe the bug Originally reported by @mavel101 from #45: The set_definition function accepts an integer as value, but in the write_seq an integer is only accepted as part of a list, tuple or ndarray not as a single integer. Changing this line in the write_seq:

elif isinstance(values[block_counter], float):
                output_file.write(f'{values[block_counter]:0.9g} ')

to

elif isinstance(values[block_counter], (int,float)):
                output_file.write(f'{values[block_counter]:0.9g} ')

would solve this.

To Reproduce

Desktop (please complete the following information):