Skip to content
Snippets Groups Projects
Commit d452b411 authored by Maxim Gonchar's avatar Maxim Gonchar
Browse files

feat: Output.seti to set particular field of the output

parent 352fcb13
No related branches found
No related tags found
No related merge requests found
...@@ -317,6 +317,22 @@ class Output: ...@@ -317,6 +317,22 @@ class Output:
return True return True
def seti(self, idx: int, value: float, check_taint: bool = False, force: bool = False) -> bool:
if self.node._frozen and not force:
return False
tainted = True
if check_taint:
tainted = self._data[udx] != value
if tainted:
self._data[idx] = value
self.taint_children()
self.node.invalidate_parents()
self.node._tainted = False
return tainted
def set( def set(
self, data: ArrayLike, check_taint: bool = False, force: bool = False self, data: ArrayLike, check_taint: bool = False, force: bool = False
) -> bool: ) -> bool:
......
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