-
Notifications
You must be signed in to change notification settings - Fork 12
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
YAML reader function #70
Conversation
It should be noted that this is a draft since the relative imports in each script seem to be causing issues when using YAML input from the command line. For example, assuming parastell.py and config.yaml are in the same directory, the command
results in the following error:
|
I think we'll want to get to a point where we actually install this rather than just run from the source directory. Alternatively, we put the |
This is with |
Executing from a different directory with
results in the same error. |
I can change it so that we don't use relative imports; it's just strange that they seem to cause issues |
If that fixes it, I guess let's change it. Separately, I'd like to better understand these relative imports, because they should work. |
The relative imports work when ParaStell is imported as a module, but not when run from command line with a YAML input argument. |
It might be that relative imports are defined only for Python modules, but when these scripts are run from command line with a YAML argument, they might not be considered modules by Python anymore |
Yes... so I think the right way to do this is to generate a lightweight script that imports if you make a file called
and make it executable. I think there are simple ways to do this with setup tools as part of installation. But that may be for another time. |
ec51095
to
3468bc1
Compare
3468bc1
to
4efc266
Compare
4efc266
to
a96a381
Compare
I am planning to lump in the solution we discussed for #52 into this PR since it's so related, unless there are any objections. |
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 a minor comment on naming the executables.
executables/invessel_build.py
Outdated
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.
Also, if we figure out how to use pip install
correctly, these can be automatically generated in the right place in the path.
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.
Would we rather make ParaStell pip-installable or condo-installable, given the dependency on conda packages? I'm not sure that some of our dependencies can be installed via pip.
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.
pip
can also be used to install the software from the source code in a local place on the Python path. This is the mode I'm thinking of, not necessarily installing with pip
from PyPi
56a59b5
to
3b0d528
Compare
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.
LGTM - thanks @connoramoreno
Changes the location of the YAML reader function
read_yaml_config
. Previously, each ParaStell script had an identicalread_yaml_config
function to read YAML input. This PR moves this function toutils.py
, and each script then imports it.Closes #52
Closes #54