def _readContaminantOutputFiles(self, directory, baseFileName, session, spatial, spatialReferenceID):
        """
        Read any contaminant output files if available
        """
        if not os.path.isdir(directory):
            return
        if baseFileName == '':
            return

        # Look for channel output files denoted by the ".chan" after the base filename
        chanBaseFileName = '.'.join([baseFileName, 'chan'])

        # Get contents of directory
        directoryList = os.listdir(directory)

        # Compile a list of files with "basename.chan" in them
        chanFiles = []
        for thing in directoryList:
            if chanBaseFileName in thing:
                chanFiles.append(thing)

        # Assume all "chan" files are link node dataset files and try to read them
        for chanFile in chanFiles:
            linkNodeDatasetFile = LinkNodeDatasetFile()
            linkNodeDatasetFile.projectFile = self.projectFile

            try:
                linkNodeDatasetFile.read(directory=directory,
                                         filename=chanFile,
                                         session=session,
                                         spatial=spatial,
                                         spatialReferenceID=spatialReferenceID)
            except:
                log.warning('Attempted to read Contaminant Transport Output file {0}, but failed.'.format(chanFile))
def _readContaminantOutputFiles ( self , directory , baseFileName , session , spatial , spatialReferenceID ) : if not os . path . isdir ( directory ) : return if baseFileName == '' : return chanBaseFileName = '.' . join ( [ baseFileName , 'chan' ] ) directoryList = os . listdir ( directory ) chanFiles = [ ] for thing in directoryList : if chanBaseFileName in thing : chanFiles . append ( thing ) for chanFile in chanFiles : linkNodeDatasetFile = LinkNodeDatasetFile ( ) linkNodeDatasetFile . projectFile = self . projectFile try : linkNodeDatasetFile . read ( directory = directory , filename = chanFile , session = session , spatial = spatial , spatialReferenceID = spatialReferenceID ) except : log . warning ( 'Attempted to read Contaminant Transport Output file {0}, but failed.' . format ( chanFile ) )
Read any contaminant output files if available