Error with numpy arrays in dodo.py namespace
m2march opened this issue · comments
Having declared a global variable of type numpy.array
in the dodo file namespace, I get the following error:
Traceback (most recent call last):
File "/home/march/miniconda3/lib/python3.9/site-packages/doit/doit_cmd.py", line 295, in run
return command.parse_execute(args)
File "/home/march/miniconda3/lib/python3.9/site-packages/doit/cmd_base.py", line 151, in parse_execute
return self.execute(params, args)
File "/home/march/miniconda3/lib/python3.9/site-packages/doit/cmd_base.py", line 591, in execute
self.task_list = self.loader.load_tasks(cmd=self, pos_args=args)
File "/home/march/miniconda3/lib/python3.9/site-packages/doit/cmd_base.py", line 389, in load_tasks
tasks = loader.load_tasks(
File "/home/march/miniconda3/lib/python3.9/site-packages/doit/loader.py", line 142, in load_tasks
funcs = _get_task_creators(namespace, command_names)
File "/home/march/miniconda3/lib/python3.9/site-packages/doit/loader.py", line 240, in _get_task_creators
if ref == task_params:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
This is due to the comparison with the task_params decorator in loader.py:
Line 240 in cc0eea7
Possible sanitization is to check that ref is of type function before performing the comparison.
Upvote & Fund
- We're using Polar.sh so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.
@m2march Thanks for report. I thought this was a blocker, so made a new release: https://pypi.org/project/doit/0.34.2/