From f4b85c9cdcdd106404e35c338473922dfde752cc Mon Sep 17 00:00:00 2001 From: Florian Obersteiner Date: Wed, 16 Mar 2022 21:36:41 +0100 Subject: [PATCH] minor: comments/docstring/etc. --- src/icartt/dataset.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/icartt/dataset.py b/src/icartt/dataset.py index 4bef866..5e7f023 100644 --- a/src/icartt/dataset.py +++ b/src/icartt/dataset.py @@ -72,7 +72,7 @@ class DataStore1001: :param newData: data to be added :type newData: numpy.ndarray """ - if not type(newData) is np.ndarray: + if not type(newData) is np.ndarray: # TODO: isinstance(arr, np.ndarray)? raise ArgumentError("Input data needs to be numpy ndarray.") if newData.dtype.names is None: try: @@ -151,7 +151,7 @@ class DataStore2110(collections.UserDict): ivarValue = float(auxds[self.ivar.shortname]) self.data[ivarValue] = { "AUX": auxds, "DEP": depds } - + def add(self, newAuxData, newDepData): auxds = DataStore1001(self.ivar, self.auxvars) depds = DataStore1001(self.ibvar, self.dvars) @@ -301,9 +301,9 @@ class Variable: :rtype: str """ descstr = [str(self.shortname), str(self.units)] - if not self.standardname is None: + if self.standardname is not None: descstr += [str(self.standardname)] - if not self.longname is None: + if self.longname is not None: descstr += [str(self.longname)] return splitChar.join(descstr) @@ -402,8 +402,8 @@ class Dataset: def times(self): """Time steps of the data - :return: list of time steps - :rtype: list + :return: numpy array of time steps + :rtype: numpy.ndarray """ if self.data.data is None or self.independentVariable is None: return np.datetime64("NaT") @@ -614,7 +614,7 @@ class Dataset: # line 15 + nvar - Special comments (Notes of problems or special # circumstances unique to this file. An example would be comments/problems # associated with a particular flight.). - self.specialComments = [f.readline(doSplit=False) for i in range(0, nscom)] + self.specialComments = [f.readline(doSplit=False) for _ in range(nscom)] # line 16 + nvar + nscom - Number of Normal comments (i.e., number of # additional lines of SUPPORTING information: Integer value indicating the @@ -855,7 +855,7 @@ class Dataset: # TODO: this could be more meaningful return "ICARTT Dataset string representation" - # TODO: why is init comming last? + def __init__(self, f=None, loadData=True, splitChar=",", format=Formats.FFI1001): """Constructor method""" self.format = format @@ -910,4 +910,4 @@ class Dataset: self.readHeader(splitChar) if loadData: self.endDefineMode() - self.readData(splitChar) + self.readData(splitChar) \ No newline at end of file -- GitLab