Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Python evaluator block #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added Python evaluator block #25

wants to merge 1 commit into from

Conversation

ncorgan
Copy link
Member

@ncorgan ncorgan commented Jan 16, 2021

Differences from /blocks/evaluator

  • Takes in list of Python modules to import before evaluating expression
  • "Global variables" are labelled "local variables", as global and local have specific definitions in Python
  • As of now, multi-argument output is unsupported

@guruofquality Could you test the attached file in PothosFlow (changed extension so Github accepts it)? My unit test passes fine, but I'm getting hangs in PothosFlow changing the slider, pausing, reloading the registry, etc, while running this.

evalpothos.txt

@guruofquality
Copy link
Contributor

@guruofquality Could you test the attached file in PothosFlow (changed extension so Github accepts it)? My unit test passes fine, but I'm getting hangs in PothosFlow changing the slider, pausing, reloading the registry, etc, while running this.

setattr(Evaluator, setterName, partial(self.__setter, name))

I think it ends up holding a reference to itself, if you can pass a different function to partial with maybe a weakref to the self object that should work.

@guruofquality guruofquality force-pushed the evaluator branch 2 times, most recently from 54c9e4d to caed10c Compare July 25, 2021 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

python version of evaluator block
2 participants