more element

This commit is contained in:
Erik Frojdh
2020-09-24 14:06:58 +02:00
parent 101f029eef
commit 18d5c5e26d
3 changed files with 134 additions and 87 deletions

View File

@ -40,6 +40,14 @@ def list_to_bitmask(values):
mask += 1 << v
return mask
def make_bitmask(args):
if isinstance(args, list):
return list_to_bitmask(args)
elif isinstance(args, dict):
return {key: list_to_bitmask(value) for key, value in args.items()}
else:
raise ValueError("Cannot convert arg to bitmask")
def to_geo(value):
if isinstance(value, _slsdet.xy):