InputVariable#
- class nextnanopy.utils.datasets.InputVariable(name, value, unit='', comment='', metadata=None, **kwargs)#
Bases:
DataVariable defined in a nextnano input file.
Base class for the per-product variants, which set
var_charandcom_charto the characters that product marks variables and comments with –$and#for nextnano++.- Parameters:
- namestr
Name of the dataset.
- valuenot defined
Stored value.
- unitstr, default=’’
Unit of the value.
- commentstr, default=’’
Comment written after the value on the same line of the input file.
- metadatadict, default=None
Extra information.
- label_fmtcallable, default=None
Called as
label_fmt(name, unit)to buildlabel. If not defined, the two are joined as'{name} ({unit})'.
- Attributes:
- namestr
Name of the dataset.
- valuenumpy.ndarray or object
Stored value. Converted with
numpy.arrayat construction; assigning to it, asInputFile.set_variabledoes, stores the object unchanged.- unitstr
Unit of the value.
- commentstr
Comment written after the value on the same line of the input file.
- metadatadict
Extra information. Carries
line_idx, the line the variable was read from, for every variable parsed out of a file.- labelstr
Name and unit rendered by
label_fmt, ready to use as an axis label. Read-only.- label_fmtcallable
Called as
label_fmt(name, unit)to buildlabel. If omitted, the two are joined as'{name} ({unit})'.- textstr
The variable as one line of input-file syntax,
$name = value # comment, with the characters of the product. Read-only.
- get_value()#
Return a copy of the value.