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

Is there a way to resolve the issue that occurs when the function setpattern is used? #90

Open
LittleBrize opened this issue Apr 20, 2022 · 1 comment

Comments

@LittleBrize
Copy link

After using the function of 'addpattern' to add a new time pattern into the network, I want to input the values all at once by using the function of 'setpattern'. The codes are listed below.
for i in range(7):
patid = patternids[i]
en.addpattern(inp_proj, id=patid)
en.setpattern(inp_proj, i+2, p0values, p0lens)

There is error poping out, which is listed below.
''TypeError: in method 'setpattern', argument 3 of type 'double *'''

The type of p0values is 'list'. How can I fix it?

@GalPerelman
Copy link
Contributor

GalPerelman commented Apr 21, 2022

@LittleBrize
The epanet toolkit is written in C and gets its input with parameters of C types
Python float and C double* are not exactly the same which causes this issue
I had the same problem in the past and solved it with this solution #57

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

No branches or pull requests

2 participants