-
Notifications
You must be signed in to change notification settings - Fork 8
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
gh-107: add all public functions/classes under glass namespace #221
Conversation
Pull Request Test Coverage Report for Build 10903745730Details
💛 - Coveralls |
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.
A quick grep -nRI 'glass.' glass
shows the following additional locations:
glass/lensing.py:9:The :mod:`glass.lensing` module provides functionality for simulating
glass/lensing.py:43: from glass.shells import RadialWindow
glass/lensing.py:386: shells : list of :class:`~glass.shells.RadialWindow`
glass/user.py:9:The :mod:`glass.user` module contains convenience functions for users of the
glass/shapes.py:9:The :mod:`glass.shapes` module provides functionality for simulating the
glass/points.py:9:The :mod:`glass.points` module provides functionality for simulating point
glass/points.py:52: w : :class:`~glass.shells.RadialWindow`
glass/points.py:126: the :mod:`~glass.points` module, e.g. ``'linear'`` for
glass/fields.py:9:The :mod:`glass.fields` module provides functionality for simulating random
glass/observations.py:9:The :mod:`glass.observations` module provides functionality for simulating
glass/shells.py:9:The :mod:`glass.shells` module provides functions for the definition of
glass/shells.py:95: >>> from glass.shells import RadialWindow
glass/galaxies.py:9:The :mod:`glass.galaxies` module provides functionality for simulating galaxies
glass/galaxies.py:46: w : :class:`~glass.shells.RadialWindow`
glass/galaxies.py:212: glass.observations.tomo_nz_gausserr :
glass/__init__.py
Outdated
@@ -1,4 +1,68 @@ | |||
try: | |||
from ._version import __version__, __version_tuple__ # noqa: F401 | |||
from glass._version import __version__, __version_tuple__ |
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.
Isn't version one place where you don't do an absolute import? At least in my experience, but can't find a resource to back this 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.
I use absolute for my projects and it works fine, but I can update this if relative is recommended for versions imports.
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.
Cool, I don't have a strong preference. Would be good if we can find a resource that does 😛
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.
Looked around a bit - setuptools_scm
suggests using importlib.metadata
to obtain version in __init__
file, but scientific-python/cookie suggests doing from ._version import version as __version__
(probably because this works with majority of the build-backends).
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.
I'd probably lean toward the scientific-python
one, I must have found that convention somewhere!
Ah, I thought the modules should still import other modules explicitly so that developers know where the functions are coming from? They can look at the |
I would usually do this internally too, makes it easy to know where stuff comes from |
d288f50
to
a49af11
Compare
Modules should import from the true location. Those examples are all user-facing text in the docs. |
4f9039a
to
c7457fd
Compare
Oh yes, I missed a few spots. Thank you! |
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.
Much simpler, just change that version __init__.py
thing and good to go I reckon
glass/__init__.py
Outdated
@@ -1,4 +1,68 @@ | |||
try: | |||
from ._version import __version__, __version_tuple__ # noqa: F401 | |||
from glass._version import __version__, __version_tuple__ |
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.
I'd probably lean toward the scientific-python
one, I must have found that convention somewhere!
4406dbe
to
901c622
Compare
Thanks for the review! I'll also wait on @ntessore's approval on this. |
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.
Great work, this had been stuck in the queue for ages!
I've merged this as will need for #232 |
glass
module name.Closes: #107
Changed: All the public functions and classes are now under the
glass
namespace