Skip to content

Commit

Permalink
add more modules to the virtual channels globals
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhrisca committed Sep 11, 2024
1 parent b1a35d4 commit d43ee28
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/asammdf/gui/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,26 @@ def compute_signal(
f"{description['function']} not found in the user defined functions",
)

import bisect
import collections
import itertools
import random
import struct

_builtins = dict(collections.__builtins__)
for key in ("breakpoint", "compile", "eval", "exec", "input", "open", "__import__"):
del _builtins[key]

_globals = {
"bisect": bisect,
"collections": collections,
"itertools": itertools,
"math": math,
"np": np,
"pd": pd,
"random": random,
"struct": struct,
"__builtins__": _builtins,
}

for function_name, definition in functions.items():
Expand Down
2 changes: 1 addition & 1 deletion src/asammdf/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
""" asammdf version module """

__version__ = "8.0.0.dev17"
__version__ = "8.0.0.dev18"

0 comments on commit d43ee28

Please sign in to comment.