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
scinumtools.dip.nodes.node_condition module
scinumtools.dip.nodes.node_constant module
scinumtools.dip.nodes.node_description module
scinumtools.dip.nodes.node_empty module
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
scinumtools.dip.nodes.node_group module
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
scinumtools.dip.nodes.node_option module
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
scinumtools.dip.nodes.node_source module
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
scinumtools.dip.nodes.node_unit module
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()