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

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
Copy link
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.

Copy link
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