OpenWaterAnalytics / EPyT

EPyT: An EPANET-Python Toolkit for Smart Water Network Simulations
https://epanet-python-toolkit-epyt.readthedocs.io
European Union Public License 1.2
39 stars 26 forks source link

d.getNodeTankData() can not retrieves a group of properties when index of more than one tanks are used as input #28

Closed sdlj2008 closed 1 year ago

sdlj2008 commented 1 year ago

when index of more than one tanks are used as input, argv[0] is a list

    tankIndices = self.getNodeTankIndex()
    if len(argv) == 1:
        if argv[0] in tankIndices:
            tankIndices = argv[0]
        else:
            tankIndices = self.getNodeTankIndex(argv[0])

For the judgment, if argv[0] in tankIndices:, it can not check whether all the elements of argv[0] are in tankIndices. one solution is as follows:

    tankIndices = self.getNodeTankIndex()
    if len(argv) == 1:
        result = [True for c in argv[0] if c in tankIndices]
        if result:
            tankIndices = argv[0]
        else:
            tankIndices = self.getNodeTankIndex(argv[0])