Change usage to be modular rather than using %run #1

Merged
merged 3 commits into from Dec 15, 2014

Conversation

Projects
None yet
2 participants
@jni
Contributor

jni commented Nov 28, 2014

Before:

%run -i ipython_memory_usage.py # massive namespace pollution, no on/off switch

After:

import ipython_memory_usage as imu
imu.start_watching_memory()
# do memory testing stuff
imu.stop_watching_memory()
# do other stuff

Still to do, but preferably in another PR and/or not by myself:

  • ipython_memory_usage_perf.py is untouched. There is massive potential for code sharing so ideally it should be an option to start_watching_memory instead.
  • make a few functions internal, leaving only an API for users.
  • as you have already noted, adding setup.py

jni added some commits Nov 28, 2014

Update ipython_memory_usage.py to use as module
I have also changed the cmd printed because it becomes unwieldy for
large IPython notebook cells.

@ianozsvald ianozsvald merged commit 535ba08 into ianozsvald:master Dec 15, 2014

@ianozsvald

This comment has been minimized.

Show comment
Hide comment
@ianozsvald

ianozsvald Dec 15, 2014

Owner

Much obliged! Sorry to be slow, wanted to have a chance to review the change and December is always silly-busy. Cheers :-)

Owner

ianozsvald commented Dec 15, 2014

Much obliged! Sorry to be slow, wanted to have a chance to review the change and December is always silly-busy. Cheers :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment