-
Notifications
You must be signed in to change notification settings - Fork 5
fix version-string (PEP compliant) and other stuff #134
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| """Atom- and bond-based SPAHM module.""" | ||
|
|
||
| from . import compute_rho_spahm | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ def get_git_version_hash(): | |
| if not version.strip(): | ||
| return VERSION + "+unknown" | ||
| print(version) | ||
| return VERSION+'+'+version.strip().decode() | ||
| return version.strip().decode() | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @briling @liam-o-marsh this is the smallest change I could find to make it work!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or we remove
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the problem appeared when we added tag to the git but can we count they will be always here? @liam-o-marsh
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They have been around for quite some time ... I don't see why they would remove it.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean if we remove them... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nowadays I would say that we have everything in a pyproject.toml but otherwise we can read it from a __version__ variable in the package
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we would need to declare that
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. numpy has a very complex build system so they can afford to dynamically generate a
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so what should we do? I think Yannick's changes work
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah they probably do |
||
|
|
||
|
|
||
| def check_for_openmp(): | ||
|
|
||
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.
this is necessary to expose the underlying functions when importing
qstack.spahm.rho@liam-o-marsh @briling do you normally import main python script or rather import all subscripts individually?
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.
what's the problem here?
i wanted to be able to run
python -m qstack.spahm.rhoinstead ofpython -m qstack.spahm.rho.compute_rho_spahmThere 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.
Yes, that part works perfectly, thanks to the
__main__.pyscript.However,
import qstack.spahm.rhoin any script outside the Q-stack tree does not allow you to import the functions/scripts in that folder, only an empty module!The changes I made resolve the issue, since the
compute_rho_spahm.pyscript basically imports all the other functions in the folder (to be verified), but I was wondering if that was enough or if we should import all the scripts in the folder individually in__init__.pyi.e.
I tried to check how you did it in the other folders, but it didn't seem systematic.
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.
oh I see now
do we need all the modules to be imported though?
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.
hm...
I see a different problem:
I imagine people would want to
import qstack.spahm.rhoto call theget_reprorspahm_a_bfunctions in compute_rho_spahm.py, but since that file is a script it's better to not import it. (due to the self-importing shenanigans that will occur when calling the script itself. Assuming we want the script itself to be the right way to call it. Technically the docs recommend callingpython3 -m qstack.spahm.rhoinstead)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.
but I thought
import qstack.spahm.rhoimports__init__.pyand the script is in__main__.pyThere 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.
yes, but if
__init__importscompute_rho_spahm, and somebody tries to runcompute_rho_spahm.pydirectly, we will have the self-import issue (not that it's a big issue)but on the other hand we can't not import
compute_rho_spahmin__init__, because it contains key functions we want to import forqstack.spahm.rhoas a whole