Skip to content
Snippets Groups Projects
Commit 657cd5c8 authored by Florian Obersteiner's avatar Florian Obersteiner
Browse files

use of underscore as a throwaway variable

parent 4d913a6a
No related branches found
No related tags found
1 merge request!4code contrib workflow test
......@@ -340,7 +340,7 @@ class Dataset:
:param splitChar: splitting character used to separate fields in a line
:type splitChar: str, defaults to ","
:param format:
:param format:
'''
@property
def nHeader(self):
......@@ -682,7 +682,7 @@ class Dataset:
prnt(delimiter.join([str(DVAR.miss)
for DVAR in self.dependentVariables.values()]))
# Variable names and units (Short variable name and units are required, and optional long descriptive name, in that order, and separated by commas. If the variable is unitless, enter the keyword "none" for its units. Each short variable name and units (and optional long name) are entered on one line. The short variable name must correspond exactly to the name used for that variable as a column header, i.e., the last header line prior to start of data.).
nul = [prnt(DVAR.desc(delimiter))
_ = [prnt(DVAR.desc(delimiter))
for DVAR in self.dependentVariables.values()]
if self.format == Formats.FFI2110:
# Number of variables (Integer value showing the number of dependent variables: the total number of columns of data is this value plus one.).
......@@ -693,13 +693,13 @@ class Dataset:
prnt(delimiter.join([str(AUXVAR.miss)
for AUXVAR in self.auxiliaryVariables.values()]))
# Variable names and units (Short variable name and units are required, and optional long descriptive name, in that order, and separated by commas. If the variable is unitless, enter the keyword "none" for its units. Each short variable name and units (and optional long name) are entered on one line. The short variable name must correspond exactly to the name used for that variable as a column header, i.e., the last header line prior to start of data.).
nul = [prnt(AUXVAR.desc(delimiter))
_ = [prnt(AUXVAR.desc(delimiter))
for AUXVAR in self.auxiliaryVariables.values()]
# Number of SPECIAL comment lines (Integer value indicating the number of lines of special comments, NOT including this line.).
prnt("{:d}".format(len(self.specialComments)))
# Special comments (Notes of problems or special circumstances unique to this file. An example would be comments/problems associated with a particular flight.).
nul = [prnt(x) for x in self.specialComments]
_ = [prnt(x) for x in self.specialComments]
# Number of Normal comments (i.e., number of additional lines of SUPPORTING information: Integer value indicating the number of lines of additional information, NOT including this line.).
prnt("{:d}".format(self.normalComments.nlines))
# Normal comments (SUPPORTING information: This is the place for investigators to more completely describe the data and measurement parameters. The supporting information structure is described below as a list of key word: value pairs. Specifically include here information on the platform used, the geo-location of data, measurement technique, and data revision comments. Note the non-optional information regarding uncertainty, the upper limit of detection (ULOD) and the lower limit of detection (LLOD) for each measured variable. The ULOD and LLOD are the values, in the same units as the measurements that correspond to the flags -7777s and -8888s within the data, respectively. The last line of this section should contain all the short variable names on one line. The key words in this section are written in BOLD below and must appear in this section of the header along with the relevant data listed after the colon. For key words where information is not needed or applicable, simply enter N/A.).
......@@ -707,7 +707,7 @@ class Dataset:
if self.normalComments.shortnames == []:
self.normalComments.shortnames = delimiter.join(
[self.variables[x].shortname for x in self.variables])
nul = [prnt(x) for x in self.normalComments]
_ = [prnt(x) for x in self.normalComments]
def writeData(self, f=sys.stdout, fmt=DEFAULT_NUM_FORMAT, delimiter=DEFAULT_FIELD_DELIM):
'''Write data
......@@ -727,8 +727,8 @@ class Dataset:
self.writeData(f=f, fmt=fmt, delimiter=delimiter)
def endDefineMode(self):
'''Fixes the variables structure of the dataset. Sets up the data store,
so data can be added. Needs to be called after variable definition
'''Fixes the variables structure of the dataset. Sets up the data store,
so data can be added. Needs to be called after variable definition
and before adding data.
'''
self.defineMode = False
......@@ -796,4 +796,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