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

Improve usage outside IPython #80

Merged
merged 2 commits into from Jan 4, 2022

Conversation

Hugovdberg
Copy link
Contributor

@Hugovdberg Hugovdberg commented Dec 8, 2021

Build upon #46 to allow injecting globals when used outside IPython. If you are willing to accept this signature change then it is probably best to include some info in the documentation for usage outside Jupyter and IPython.

Build upon rasbt#46 to allow injecting globals when used outside IPython.
@pep8speaks
Copy link

pep8speaks commented Dec 8, 2021

Hello @Hugovdberg! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-12-08 13:14:03 UTC

@rasbt
Copy link
Owner

rasbt commented Dec 11, 2021

Thanks a lot for the PR! I am a bit swamped right now due to end-of-the-semester grading, but at first glance, it looks great! I will take another look next week and incorporate it in the docs (and make a minor new version release so that it can be used).

@rasbt
Copy link
Owner

rasbt commented Jan 4, 2022

This looks good to me, thanks again for the PR!

@rasbt rasbt merged commit 1cb8660 into rasbt:master Jan 4, 2022
@rasbt
Copy link
Owner

rasbt commented Jan 4, 2022

Regarding the documentation example, I just added an example to the README file


  • It is now possible to inject globals when used outside IPython (#80, via contribution by
    Hugo Lapré
    ). For example, version numbers of imported packages can now be obtained as follows:
import numpy
import watermark.watermark as watermark


watermark(iversions=True, globals_=globals())

But I should definitely set up a better documentation some time using Mkdocs that provides examples on using watermark outside Jupyter. I think I never expected watermark to get so many additional features :)

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

3 participants