-
Notifications
You must be signed in to change notification settings - Fork 51
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
Python Import Name #181
Comments
Disclaimer - the current python naming scheme does not appeal greatly to me. This suggestion would certainly make this lib consistent with the other openPMD python libs, but it runs contrary to the largely accepted PEP naming convention. I propose something more radical, conceptually different: import openpmd.api
import openpmd.viewer |
you have my +1. We could for convenience even provide a repo with a lightweight |
This meta-package will be nice for convenience, but it is not required. You can combine multiple distinct python sub-packages, each providing a |
@RemiLehe what do you think? |
Yes, I like the naming However, I am not sure how this will be implemented in practice. For instance, with the meta-package that @ax3l suggested, is the idea that import openpmd_viewer as viewer
import openpmd_api as api |
Or is the plan to have a whole new package and a single Github repository for both the viewer and the API? |
The idea is too keep them separated as before and just change their provided imports accordingly. On top of that, we could make a simple wrapper-only repo and meta-package that depends on all of them. But that's not necessary for the subpackages to get this structure, as @C0nsultant pointed out. |
Oh, ok I see. Sorry that I had not properly read @C0nsultant's comment/
Is that correct? |
I had admittedly never thought about the pypi project name up to this point. But yes, the The meta-package @ax3l suggested would install like pip install openpmd and would allow for import openpmd.api
import openpmd.viewer
... without explicitly installing individual packages. |
Anyway, PyPI (or conda) package names is then the second step. This issue is first just about import names (module names) :) (openPMD-api is also interesting on PyPI and easier on conda. For PyPI OSX binary wheels and a source wheel for linux are probably possible...) E.g., the package name for conda will probably have an underscore. Also, we might be shipping |
Following proposal: as mentioned above, we can keep for module names the
# need updates
import openpmd_api as api # done in 0.7.0+
import openpmd_validator as validator
import openpmd_viewer as viewer # upcoming in 1.0.0+ But the package names should be consistently and PEP8 recommended (and conda compatible) called with a # all good! https://pypi.org/search/?q=openPMD
pip install openpmd-api
pip install openpmd-validator
pip install openpmd-viewer # all good!
spack install openpmd-api
# spack install openpmd-validator # optional, not created yet
# spack install openpmd-viewer # optional, not created yet # need updates: https://anaconda.org/search?q=openPMD
conda install -c conda-forge openpmd-api # done in 0.7.0+
conda install -c ax3l openpmd-validator # to do!
conda install -c rlehe openpmd-viewer # to do! |
Import and package names for Please see the respective linked issues for other repos. |
We current do
but for consistency with other python libs we have so far we probably need to name it
or
or similar.
cc @RemiLehe @C0nsultant
The text was updated successfully, but these errors were encountered: