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

Add periodic flash for computing variables #8

Merged
merged 1 commit into from
Oct 26, 2021
Merged

Conversation

davidbrochart
Copy link
Owner

No description provided.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@stefaneidelloth
Copy link

stefaneidelloth commented Oct 27, 2021

Thanks a lot for the fast implementation!

I tried with following cells:

b=a+1
a
import time
def calc_a():
    time.sleep(3)
    return 30

a = calc_a()
a

I would expect the first cell to be marked while method calc_a is executed. However, it seems that the first cell is flashing after the method call is finished.

I also tried to wrap the function with ipyx.F. However, then the first cell seems to flash for ever:

import time
from ipyx import X, F
def calc_a():
    time.sleep(3)
    return 10
f = F(calc_a)
a = f()
a

=> What is the right way to define reactive cells and what is the expected behavior for the flashing feature?

@davidbrochart
Copy link
Owner Author

Here calc_a doesn't appear in the data flow, it's just used as an input to a. You should see the flashing behavior with something like that:

# cell 1
import time
from ipyx import X, F

def _f(x):
    time.sleep(3)
    return x + 30

f = F(_f)

# cell 2
a = X()
a

# cell 3
b = f(a)
b

# cell 4
a.v = 1  # should make b flash during 3 seconds

There is a bug when you assign the same value (like when re-executing cell 4), the flashing doesn't stop. I will push a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants