Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mismatch in the section name for gradients in seq.read and seq.write #26

Closed
tonggehua opened this issue Feb 27, 2020 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@tonggehua
Copy link
Contributor

Describe the bug
The seq.write function generates files that cannot be read by seq.read because the gradient section name is different between the two ([GRAD] according to the write function and [GRADIENTS] as expected by the read function).

To Reproduce
Run the following code (under Pypulseq 1.2.1):

from pypulseq.Sequence.sequence import Sequence
from pypulseq.make_sinc_pulse import make_sinc_pulse
from pypulseq.make_extended_trapezoid import make_extended_trapezoid
from pypulseq.opts import Opts
from math import pi

system = Opts()
seq = Sequence()
g = make_extended_trapezoid(channel='x',times=[0,0.01],amplitudes=[1,2],system=system)
seq.add_block(g)
seq.write('test.seq')
seq2 = Sequence()
seq2.read('test.seq')

Expected behavior
The sequence should be read without generating an error.

Error message
When run, this error appears:

  File "(personal system path)\pypulseq\Sequence\read_seq.py", line 57, in read
    raise ValueError(f'Unknown section code: {section}')
ValueError: Unknown section code: [GRADIENTS]

Desktop (please complete the following information):

  • OS: Microsoft Windows 10 Pro
  • Version: pypulseq 1.2.1
@imr-framework imr-framework self-assigned this Feb 27, 2020
@imr-framework imr-framework added the bug Something isn't working label Feb 27, 2020
@sravan953
Copy link
Collaborator

Thanks for reporting this! Looks like the version packaged on PyPI does not have this fix even though the most recent Github version does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants