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
Set __module__ for exported functions. #985
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some flake things, but otherwise I'm good with this:
____________________ FLAKE8-check(ignoring F405 W503 D999) _____________________
/home/travis/build/Unidata/MetPy/metpy/plots/__init__.py:25:5: F401 '.cartopy_utils.USCOUNTIES' imported but unused
/home/travis/build/Unidata/MetPy/metpy/plots/__init__.py:25:5: F401 '.cartopy_utils.USSTATES' imported but unused
_______________________ FLAKE8-check(ignoring F405 W503) _______________________
/home/travis/build/Unidata/MetPy/metpy/plots/_util.py:20:1: E302 expected 2 blank lines, found 1
_______________________ FLAKE8-check(ignoring F405 W503) _______________________
/home/travis/build/Unidata/MetPy/metpy/tests/test_packaging.py:11:1: E302 expected 2 blank lines, found 1
/home/travis/build/Unidata/MetPy/metpy/tests/test_packaging.py:11:1: D103 Missing docstring in public function
😡 I was running flake8 regularly here to try to avoid this. And apparently did not do it on the last iteration. |
8b25a57
to
16ae341
Compare
Alright, cleaned up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3.6 docs are failing with this and similar (I already kicked the build once)
________________ [doctest] metpy.interpolate.log_interpolate_1d ________________
EXAMPLE LOCATION UNKNOWN, not showing all tests of that example
??? >>> x_log = np.array([1e3, 1e4, 1e5, 1e6])
UNEXPECTED EXCEPTION: NameError("name 'np' is not defined",)
Traceback (most recent call last):
File "/opt/python/3.6.7/lib/python3.6/doctest.py", line 1330, in __run
compileflags, 1), test.globs)
File "<doctest metpy.interpolate.log_interpolate_1d[0]>", line 1, in <module>
NameError: name 'np' is not defined
Weird. Importing numpy within the |
fe0a7f9
to
1f508bd
Compare
This causes the functions to show up under the proper namespace, rather than the original module, when printed in IPython/notebook.
Not sure why this PR necessitates this, but these additions are fine.
Fixes #968. Resets the
__module__
on our exported functions so that they appear from the proper namespace when printed in IPython/Jupyter notebook. Also fixes a couple places where we were incorrectly putting the objects themselves, rather than their names, into__all__
. (Found because those cases break this new code.)