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

Writing an inp file 'self' argument error message #399

Closed
DanielaBS1 opened this issue Dec 27, 2023 · 2 comments
Closed

Writing an inp file 'self' argument error message #399

DanielaBS1 opened this issue Dec 27, 2023 · 2 comments
Labels

Comments

@DanielaBS1
Copy link

After adding some controls to a model I am trying to save a new INP file by writing the flowing line:

wntr.epanet.InpFile.write(filename='d.inp',wn=wn1)

However I am getting the following error message:

TypeError: InpFile.write() missing 1 required positional argument: 'self'

When typing the arguments inside the parenthesis 'self' appears as first variable, but it is not on the documentation. 'self' been a python keyword it seams strange to be a required argument. Is it a bug? I could not work it out, can you advise?

I am using Python 3.10.9 via Spyder.

@kaklise
Copy link
Collaborator

kaklise commented Jan 2, 2024

While you can create an instance of the InpFile class and use its write method, I suggest calling wntr.network.write_inpfile, see https://usepa.github.io/WNTR/model_io.html#epanet-inp-file for more details.

@DanielaBS1
Copy link
Author

Thanks for the suggestion. It did work.

@kaklise kaklise added the support label Jan 3, 2024
@kaklise kaklise closed this as completed Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants