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

some bugs solved in the epanet2.py file #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

manuelgilm
Copy link

In the following function (line 620):

def ENsetoption(self, paramcode, value):                      #<------------- solved: optioncode changed to paramcode
    """Sets the value of a particular analysis option.

    Arguments:
      optioncode: option code EN_TRIALS
                              EN_ACCURACY  
                              EN_TOLERANCE 
                              EN_EMITEXPON 
                              EN_DEMANDMULT
      value:  option value"""
    ierr= self._lib.EN_setoption(self.ph, ctypes.c_int(paramcode), ctypes.c_float(value))
    if ierr!=0: raise ENtoolkitError(self, ierr)

and the function (line 384):

def ENgetoption(self, optioncode):
    """Retrieves the value of a particular analysis option.

    Arguments:
    optioncode: EN_TRIALS       
                EN_ACCURACY 
                EN_TOLERANCE 
                EN_EMITEXPON 
                EN_DEMANDMULT""" 
    j= ctypes.c_float()                                                    #<--- solved: c_int() changed to c_float()
    ierr= self._lib.EN_getoption(self.ph, optioncode, ctypes.byref(j))
    if ierr!=0: raise ENtoolkitError(self, ierr)
    return j.value

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

Successfully merging this pull request may close these issues.

1 participant