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

Automatic detection of cell changes #30

Merged
merged 3 commits into from
May 29, 2015
Merged

Automatic detection of cell changes #30

merged 3 commits into from
May 29, 2015

Conversation

TyberiusPrime
Copy link

This patch detects when a cell changed and when the set of variables changed
(See #27 )

Cell change is unfortunatly done on hashed contents - no access to python byte code at this level,
which could prevent some unnecessary recalculations.

There is no option for this because it will trip people up and lead to inconsistent data.
Better safe (recalc) then sorry (work with wrong data).

So long!

@TyberiusPrime
Copy link
Author

Hm. I'm not sure why the travis build fails - tests locally did suceed.

@ihrke
Copy link
Collaborator

ihrke commented May 29, 2015

nice work, thanks so much!
I checked and the failing travis build is due to some changes in ipython (we run some notebooks through an ipython runner which appears to be broken by the changes).
What about a global option for enabling/disabling the automatic recalculations? I can imagine one or two scenarios where you do not want to recalculate (say you added a comment to a cell or re-indented a line) and people might be annoyed by a lengthy recalculation based on this.

ihrke added a commit that referenced this pull request May 29, 2015
Automatic detection of cell changes
@ihrke ihrke merged commit 4baec8b into rossant:master May 29, 2015
@ihrke
Copy link
Collaborator

ihrke commented May 29, 2015

just realized that there appear to be issues with your patch for python 3.

ERROR: test_ipycache.test_cache_1
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/home/travis/build/rossant/ipycache/test_ipycache.py", line 93, in test_cache_1
    ip_user_ns=user_ns, ip_run_cell=ip_run_cell, ip_push=ip_push)
  File "/home/travis/build/rossant/ipycache/ipycache.py", line 239, in cache
    cell_md5 = hashlib.md5(cell).hexdigest()
TypeError: Unicode-objects must be encoded before hashing

ihrke added a commit to ihrke/ipycache that referenced this pull request May 29, 2015
@ihrke ihrke mentioned this pull request May 29, 2015
@TyberiusPrime
Copy link
Author

Seems easily fixable but I'm traveling right now. Could habe sworn I ran the tests with python3...

Anyhow we will nee test case with non ASCII data.

@ihrke
Copy link
Collaborator

ihrke commented May 29, 2015

Hi, I fixed the python3 tests in #31

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.

2 participants