scinumtools.dip.nodes package

Submodules

scinumtools.dip.nodes.node module

class scinumtools.dip.nodes.node.Node(code, **kwargs)

Bases: object

code: str
copy()
defined: bool = False
dimension: List[tuple] = None
dtype

alias of str

dtype_prop

alias of list

indent: int = 0
isource: tuple = False
keyword: str = None
name: str = None
source: tuple = None
units_raw: str = None
value_expr: str = None
value_fn: str = None
value_raw: str = None
value_ref: str = None
value_slice: List[tuple] = None

scinumtools.dip.nodes.node_base module

class scinumtools.dip.nodes.node_base.BaseNode(parser=None, *args, **kwargs)

Bases: Node

branch_id: int = None
case_id: int = None
cast_value(value=None)

Cast (raw-)value as a datatype self, or another node

clean_name()

Strip @case and @else from the name

condition: str = None
constant: bool = False
inject_value(env: Environment, node=None)

Inject value from a remote source

Parameters:
  • env – Environment object

  • node – Node object that should be injected

modify_value(node, env)

Modify value taking value of a different node

parse(env)
set_value(value=None)

Set value using value_raw or arbitrary value

slice_value(slices, value=None)

Slice part of the value

Parameters:
  • slices (list) – List of tuples with slicing

  • value – Value to be sliced. If none value of current node is taken.

value: str = None

scinumtools.dip.nodes.node_boolean module

class scinumtools.dip.nodes.node_boolean.BooleanNode(parser=None, *args, **kwargs)

Bases: BaseNode

description: str = None
dtype

alias of bool

static is_node(parser)
keyword: str = 'bool'
parse(env)
set_value(value=None)

Set value using value_raw or arbitrary value

tags: list = None
value: bool = None

scinumtools.dip.nodes.node_case module

class scinumtools.dip.nodes.node_case.CaseNode(parser=None, *args, **kwargs)

Bases: BaseNode

case_id: int = 0
case_type: str = None
static is_node(parser)
keyword: str = 'case'
parse(env)

scinumtools.dip.nodes.node_condition module

class scinumtools.dip.nodes.node_condition.ConditionNode(parser=None, *args, **kwargs)

Bases: BaseNode

static is_node(parser)
keyword: str = 'condition'
parse(env)

scinumtools.dip.nodes.node_constant module

class scinumtools.dip.nodes.node_constant.ConstantNode(parser=None, *args, **kwargs)

Bases: BaseNode

static is_node(parser)
keyword: str = 'constant'
parse(env)

scinumtools.dip.nodes.node_description module

class scinumtools.dip.nodes.node_description.DescriptionNode(parser=None, *args, **kwargs)

Bases: BaseNode

static is_node(parser)
keyword: str = 'description'
parse(env)

scinumtools.dip.nodes.node_empty module

class scinumtools.dip.nodes.node_empty.EmptyNode(parser=None, *args, **kwargs)

Bases: BaseNode

static is_node(parser)
keyword: str = 'empty'

scinumtools.dip.nodes.node_float module

class scinumtools.dip.nodes.node_float.FloatNode(*args, **kwargs)

Bases: BaseNode, SelectNode

description: str = None
dtype

alias of float

static is_node(parser)
keyword: str = 'float'
options: List = None
parse(env)
precision: int
set_value(value=None)

Set value using value_raw or arbitrary value

tags: list = None
value: float = None
value_expr: str = False

scinumtools.dip.nodes.node_format module

class scinumtools.dip.nodes.node_format.FormatNode(parser=None, *args, **kwargs)

Bases: BaseNode

static is_node(parser)
keyword: str = 'format'
parse(env)

scinumtools.dip.nodes.node_group module

class scinumtools.dip.nodes.node_group.GroupNode(parser=None, *args, **kwargs)

Bases: BaseNode

static is_node(parser)
keyword: str = 'group'

scinumtools.dip.nodes.node_import module

class scinumtools.dip.nodes.node_import.ImportNode(parser=None, *args, **kwargs)

Bases: BaseNode

inject_value(env: Environment, node=None)

Inject value from a remote source

Parameters:
  • env – Environment object

  • node – Node object that should be injected

is_node()
keyword: str = 'import'
parse(env)

scinumtools.dip.nodes.node_integer module

class scinumtools.dip.nodes.node_integer.IntegerNode(*args, **kwargs)

Bases: BaseNode, SelectNode

description: str = None
dtype

alias of int

static is_node(parser)
keyword: str = 'int'
options: List = None
parse(env)
set_value(value=None)

Set value using value_raw or arbitrary value

tags: list = None
unsigned: bool
value: int = None
value_expr: str = False

scinumtools.dip.nodes.node_mod module

class scinumtools.dip.nodes.node_mod.ModNode(parser=None, *args, **kwargs)

Bases: BaseNode

static is_node(parser)
keyword: str = 'mod'
parse(env)

scinumtools.dip.nodes.node_option module

class scinumtools.dip.nodes.node_option.OptionNode(parser=None, *args, **kwargs)

Bases: BaseNode

static is_node(parser)
keyword: str = 'option'
parse(env)

scinumtools.dip.nodes.node_select module

class scinumtools.dip.nodes.node_select.Option(value: scinumtools.dip.datatypes.type_integer.IntegerType | scinumtools.dip.datatypes.type_float.FloatType | scinumtools.dip.datatypes.type_string.StringType, value_raw: str, units_raw: str)

Bases: object

units_raw: str
value: IntegerType | FloatType | StringType
value_raw: str
class scinumtools.dip.nodes.node_select.SelectNode(*args, **kwargs)

Bases: object

options: List = None
set_option(node, env)

Set option using value of a different node

validate_options()

Check if current value is in option list

scinumtools.dip.nodes.node_source module

class scinumtools.dip.nodes.node_source.SourceNode(parser=None, *args, **kwargs)

Bases: BaseNode

static is_node(parser)
keyword: str = 'source'
parse(env)

scinumtools.dip.nodes.node_string module

class scinumtools.dip.nodes.node_string.StringNode(*args, **kwargs)

Bases: BaseNode, SelectNode

description: str = None
dtype

alias of str

format: str = None
static is_node(parser)
keyword: str = 'str'
options: list = None
parse(env)
set_value(value=None)

Set value using value_raw or arbitrary value

tags: list = None

scinumtools.dip.nodes.node_table module

class scinumtools.dip.nodes.node_table.TableNode(parser=None, *args, **kwargs)

Bases: BaseNode

static is_node(parser)
keyword: str = 'table'
parse(env)

scinumtools.dip.nodes.node_tags module

class scinumtools.dip.nodes.node_tags.TagsNode(parser=None, *args, **kwargs)

Bases: BaseNode

static is_node(parser)
keyword: str = 'tags'
parse(env)

scinumtools.dip.nodes.node_unit module

class scinumtools.dip.nodes.node_unit.UnitNode(parser=None, *args, **kwargs)

Bases: BaseNode

static is_node(parser)
keyword: str = 'unit'
parse(env)

scinumtools.dip.nodes.parser module

class scinumtools.dip.nodes.parser.Parser(*args, **kwargs)

Bases: Node

ccode: str
comment: str = None
formating: str = None
is_empty()
is_parsed(name: str)

Check if directive or node part was already parsed

Parameters:

name (str) – Name of a directive or node part

kwd_case()
kwd_condition()
kwd_constant()
kwd_description()
kwd_format()
kwd_options()
kwd_source()
kwd_tags()
kwd_unit()
parsed: List[str]
part_comment()
part_dimension()
part_equal()
part_expression()
part_format()
part_function()
part_indent()
part_name(path=True)
part_reference(inject=False)
part_slice()
part_type()
part_units()
part_value()

Module contents