Create GSSHAPY Reservoir Objects Method

def _createReservoir(self, linkResult, replaceParamFile):
        """
        Create GSSHAPY Reservoir Objects Method
        """
        # Extract header variables from link result object
        header = linkResult['header']

        # Cases
        if linkResult['type'] == 'LAKE':
            # Lake handler
            initWSE = vrp(header['initwse'], replaceParamFile)
            minWSE = vrp(header['minwse'], replaceParamFile)
            maxWSE = vrp(header['maxwse'], replaceParamFile)
            numPts = header['numpts']

        elif linkResult['type'] == 'RESERVOIR':
            # Reservoir handler
            initWSE = vrp(header['res_initwse'], replaceParamFile)
            minWSE = vrp(header['res_minwse'], replaceParamFile)
            maxWSE = vrp(header['res_maxwse'], replaceParamFile)
            numPts = header['res_numpts']

        # Initialize GSSHAPY Reservoir object
        reservoir = Reservoir(initWSE=initWSE,
                              minWSE=minWSE,
                              maxWSE=maxWSE)

        # Initialize GSSHAPY StreamLink object
        link = StreamLink(linkNumber=int(header['link']),
                          type=linkResult['type'],
                          numElements=numPts)

        # Associate StreamLink with ChannelInputFile
        link.channelInputFile = self

        # Associate Reservoir with StreamLink
        reservoir.streamLink = link

        # Create ReservoirPoint objects
        for p in linkResult['points']:
            # Initialize GSSHAPY ReservoirPoint object
            resPoint = ReservoirPoint(i=p['i'],
                                      j=p['j'])

            # Associate ReservoirPoint with Reservoir
            resPoint.reservoir = reservoir

        return link