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

file_prefix argument is inconsistently implemented in fileio/ascii.py #740

Open
will-henney opened this issue Dec 20, 2024 · 4 comments
Open

Comments

@will-henney
Copy link

Hi, I recently ran into an issue, whereby the file_prefix optional argument is not consistently implemented in fileio.ascii.write(). The "fort" prefix is hardcoded for the q and aux variables.

It looks to me like you just need to change the format string in lines 53 and 65 to match what you have in line 42

Best wishes

Will

@mandli
Copy link
Member

mandli commented Dec 20, 2024

Thanks for pointing that out. Looks like the read functions work but write does not.

@MohitKambli
Copy link

Hello,
Hope you're doing well
I would like to work on this issue
As far as what I have understood from the comments, we need to fix the two lines in the write function
I have made the following changes:

  • at line 53
    file_name = '%s.q%s' % (file_prefix,str(frame).zfill(4))

  • at line 65
    file_name = '%s.a%s' % (file_prefix,str(frame).zfill(4))

Let me know your thoughts about these code changes and whether they would meet the necessary requirements
Sincere apologies for my mistakes if you find any
I'll raise a PR for the same if you think we are good to go with these code changes

Screenshot:
image

Thanks and Regards,
Mohit Kambli

@mandli
Copy link
Member

mandli commented Dec 21, 2024

@MohitKambli this looks correct. If you want to open a PR with these changes we can discuss the issue. We may also want to check the other output types although from a cursory glance it looks like they do the correct thing.

@MohitKambli
Copy link

Hello @mandli
Sure
Sounds good
I'll raise a PR for this issue and we'll discuss about it there itself

Thanks and Regards,
Mohit Kambli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants