-
Notifications
You must be signed in to change notification settings - Fork 200
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
enable loading config.yml files from URL #3977
Conversation
9bf0c03
to
aa3c2ee
Compare
bf6ea84
to
5c29bfc
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.
hi @ltalirz ,
First of all, thanks for letting me participate in the code review. I can really learn a lot from it. I made some specific change requests below.
One thing need to be discussed is whether it is possible to provide a valid url somewhere and add test cases for actually test UrlPath
and UrlFile
?
923c7c6
to
0c4137b
Compare
Thanks a lot for your review @unkcpz !
You are absolutely correct. P.S. Don't worry about the failing test of circleci |
263f93b
to
801fe59
Compare
Thanks a lot @ltalirz , just few questions from my personal side. You haven't put any more traps in it to test me, have you? 😆 |
@unkcpz Please have another look and review again - pushing changes dismisses a previous approving review (just in case this was not clear) |
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.
It seems all fine. Thanks! @ltalirz
@chrisjsewell @sphuber The circleci tests are failing and blocking me from merging this PR. |
Ah no, sorry - it seems @unkcpz's review does not yet "count". Will fix this :-) |
@chrisjsewell @sphuber |
I am in the process of merging the docs revamp now. Please hold off with this PR until then. You can then rebase and the tests should then automatically start running |
Codecov Report
@@ Coverage Diff @@
## develop #3977 +/- ##
===========================================
- Coverage 78.75% 78.74% -0.00%
===========================================
Files 467 467
Lines 34454 34466 +12
===========================================
+ Hits 27130 27138 +8
- Misses 7324 7328 +4
Continue to review full report at Codecov.
|
I put this on hold because I am also going through a review, so please don't merge this yet |
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.
Thanks @ltalirz
aiida/cmdline/commands/cmd_import.py
Outdated
@@ -17,7 +17,7 @@ | |||
|
|||
from aiida.cmdline.commands.cmd_verdi import verdi | |||
from aiida.cmdline.params import options | |||
from aiida.cmdline.params.types import GroupParamType, ImportPath | |||
from aiida.cmdline.params.types import GroupParamType, PathURL |
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.
Two points about the name:
- I did not immediately understand that this type basically allows a 'Path' or 'URL'. But that is the only reason for its existence, since we have options that need to support both and Click does not support parameters of multiple type. So I think perhaps the name
PathOrUrl
andFileOrUrl
would make this a lot easier to see. - Second point is already made implicitly in the previous. It is a matter of convention, but both Microsoft and Google advocate to stick to camel-case (or pascal-case) rules, even when it comes to acronyms. So
URL
should becomeUrl
.
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.
Yeah... I guess what you would really want is to be able to pass multiple types, but that's not how the click API is built.
Besides concatenating Class names with Or
, one can also just choose one of them (e.g. File
). In that case, one then has to check the documentation to know exactly how our File
implementation differs from the standard one.
Anyhow, I've used your suggestions for now. Just not entirely sure about the FILEORURL
metavar... I guess it's good enough for the moment.
In the view of the plans of starting online repositories that maintain yaml configuration files for computers and codes, it becomes very useful to be able to directly import a configuration file from a URL. Version 0.6 of the config-file-option now respects the `type` parameter, and file handles can be passed directly to the configuration file provider. This allows handling opening files locally and from URLs on the same footing.
Very strange pre-commit failure https://github.com/aiidateam/aiida-core/pull/3977/checks?check_run_id=731694434 Anyhow, I'm silencing the pre-commit warning now |
In the view of the plans of starting online repositories that maintain
yaml configuration files for computers and codes, it becomes very useful
to be able to directly import a configuration file from a URL.
Todo: