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

[BUG] Multiline header in savetxt #710

Open
Bzero opened this issue Feb 11, 2025 · 3 comments
Open

[BUG] Multiline header in savetxt #710

Bzero opened this issue Feb 11, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@Bzero
Copy link

Bzero commented Feb 11, 2025

Describe the bug
When passing a header containing a linebreak to savetxt only the first line is a comment line, all following lines are uncommented.

ulab version: 6.7.2-2D

To Reproduce

np.savetxt('loadtxt.dat', np.array([1,2,3]), header='A header\nwith a second line')

The second line of the header is not a comment line:

# A header
with a second line
1.000000000000000
2.000000000000000
3.000000000000000

Expected behavior

The second line of the header should be a comment line as well as it is the case with numpy:

# A header
# with a second line
1.000000000000000
2.000000000000000
3.000000000000000

Additional context
Relevant for footers too.

@Bzero Bzero added the bug Something isn't working label Feb 11, 2025
@v923z
Copy link
Owner

v923z commented Feb 11, 2025

This is really along the same lines as #709, thanks for pointing it out! I'll try to set a bit of time aside to fix this.

@Bzero
Copy link
Author

Bzero commented Feb 11, 2025

Yes, sorry if I have been overreporting here a bit. I can try to address it myself as well.

@v923z
Copy link
Owner

v923z commented Feb 13, 2025

Oh, don't worry! While these are similar issues, it's good that you've opened two tickets.

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

2 participants