Skip to content
Snippets Groups Projects
Commit f4b85c9c authored by Florian Obersteiner's avatar Florian Obersteiner :8ball:
Browse files

minor: comments/docstring/etc.

parent 1b57967d
No related branches found
No related tags found
1 merge request!15updated normal comments handling
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment