Skip to content
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

add schema validation to user input #5

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

add schema validation to user input #5

wants to merge 5 commits into from

Conversation

felipeZ
Copy link
Member

@felipeZ felipeZ commented Jan 21, 2021

Add schema validation

having an input in YAML allows the user to provide in a single file all the options. This has the advantage of avoiding passing every option via the command line.
Also the schema package takes care of validating the input.
Now the command line can be called like:

 xtp_gradient -i tests/files/example.yml 

where the example.yml file contains all the user keywords that the user wants to supply. The only mandatory keyword is the path to the molecule. For example the following is a valid input:

molecule: tests/files/ethylene.xyz

@felipeZ felipeZ requested a review from baumeier January 21, 2021 15:43
@codecov
Copy link

codecov bot commented Jan 21, 2021

Codecov Report

Merging #5 (9979d16) into master (17ef79f) will decrease coverage by 2.13%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #5      +/-   ##
==========================================
- Coverage   25.94%   23.80%   -2.14%     
==========================================
  Files           6        7       +1     
  Lines         212      231      +19     
  Branches       27       27              
==========================================
  Hits           55       55              
- Misses        157      176      +19     
Impacted Files Coverage Δ
PyVOTCA/schemas.py 0.00% <0.00%> (ø)
PyVOTCA/xtp_gradient.py 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 17ef79f...9979d16. Read the comment docs.

@baumeier
Copy link
Member

I'm not sure if I understand when this works. You show the example of when we have a pre-defined tool such as the xtp_gradient. That I can follow.

However, the votca wrapper is freely importable into any custom code, like in the run_python.py in the newly created examples folder. That one will not know about command line options and yaml?

@felipeZ
Copy link
Member Author

felipeZ commented Jan 21, 2021

You are right there is a schema for each command line. But for the wrapper is not necessary because we assume that the user know what she/he is doing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants