flojoy-ai / studio

Joyful visual programming for Python
https://docs.flojoy.ai
MIT License
196 stars 19 forks source link

"str object cannot be interpreted as int" in LINSPACE node #517

Closed jackparmer closed 1 year ago

jackparmer commented 1 year ago

Getting this error on a fresh install from main

The @flojoy decorator really needs to typecheck params and make sure that they match what the node is expecting.

image
[2023-06-06 22:30:50.100-RQ-flojoy]   File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/flojoy/flojoy_python.py", line 458, in wrapper
[2023-06-06 22:30:50.100-RQ-flojoy]     dt_obj = func(node_inputs, func_params)  # DataContainer object from node
[2023-06-06 22:30:50.100-RQ-flojoy]   File "/Users/jackparmer/Desktop/flojoy-screencast/studio/PYTHON/./nodes/GENERATORS/SIMULATIONS/LINSPACE/LINSPACE.py", line 10, in LINSPACE
[2023-06-06 22:30:50.100-RQ-flojoy]     y = np.linspace(params["start"], params["end"], params["step"])
[2023-06-06 22:30:50.100-RQ-flojoy]   File "<__array_function__ internals>", line 180, in linspace
[2023-06-06 22:30:50.100-RQ-flojoy]   File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/core/function_base.py", line 120, in linspace
[2023-06-06 22:30:50.100-RQ-flojoy]     num = operator.index(num)
[2023-06-06 22:30:50.100-RQ-flojoy] TypeError: 'str' object cannot be interpreted as an integer
smahmed776 commented 1 year ago

@jackparmer This happens when you have flojoy <=0.1.4. We have implemented that typechecking in latest flojoy python package. Can you confirm if you're still having this with v >= 0.1.4 ?