Skip to content
dataset.py 41.1 KiB
Newer Older
        self.independentVariable = None
        self.independentBoundedVariable = None
        self.auxiliaryVariables = {}
        self.dependentVariables = {}
        self.specialComments = []
        self.normalComments = StandardNormalComments()
Christoph Knote's avatar
Christoph Knote committed
        # Standard v2.0 for normal comments requires all keywords present,
        # might not be the case - then reading data will fail
        self.nHeaderFile = -1
        self.data = None
        self.defineMode = True
        self.inputFhandle = None

Christoph.Knote's avatar
Christoph.Knote committed
        # read data if f is not None
        if f is not None:
            if isinstance(f, (str, pathlib.Path)):
                self.inputFhandle = open(f, "r", encoding="utf-8")
Christoph.Knote's avatar
Christoph.Knote committed
            else:
                self.inputFhandle = f
            if not self.isValidFileName(pathlib.Path(f).name):
                warnings.warn(f"{pathlib.Path(f).name} is not a valid ICARTT filename")
            self.readHeader(delimiter)
Christoph.Knote's avatar
Christoph.Knote committed
            if loadData:
                self.endDefineMode()
                self.readData(delimiter)