Comments (8)
Absolutely agree - for now we can just design the naming here to make sure it fits when we move that over.
How about
parsers
generators
converters
?
from qe-tools.
Here is a possible suggestion, adapting from yours, with the philosophy that we can make methods public easily later if we want to, while the reverse is complex for backwards incompatibility:
qe_tools
: publicparsers
: publiccpinputparser
CpInputFile
: public, directly underparsers
OK
pwinputparser
:PwInputFile
: public, directly underparsers
OKparse_k_points
: private
qeinputparser
:QeInputFile
: public, directly underparsers
OKget_cell_from_parameters
: privateget_structure_from_qeinput
: privateparse_atomic_positions
: privateparse_atomic_species
: privateparse_cell_parameters
: privateparse_namelists
: privatestr2val
: privatestrip_comment
: private
generators
: publiccell_conversion
: privateget_parameters_from_cell
: public (directly undergenerators
)
utils
:_qe_version
: privateparse_version
: private
exceptions
: move to top-level qe_tools.exceptions, make exceptions public
constants
: keep and make public
What do you think? Happy for different suggestions of course
from qe-tools.
Also, for renaming, some suggestions:
- maybe we can rename
qe_tools.parsers.cpinputparser
to e.g.qe_tools.inputparsers.cp
or something like this? get_structure_from_qeinput
-> shall we change the name to something simpler? isget_structure
clear enough? orparse_structure
? or should we put an underscore betweenqe
aninput
?- shall we rename the kwargs of the public methods/functions, where it might make sense? E.g. for the
__init__
of QeInputFile, probably it doesn't make sense that it's calledpwinput
. Maybe simplyinput_file
orinput_file_content
orinput_content
? We might want to do a similar discussion more generally once we agree on which are the public methods
from qe-tools.
Thanks a lot! I think I agree on the public / private suggestions (at least, I didn't see anything that I didn't agree with at first glance).
* maybe we can rename `qe_tools.parsers.cpinputparser` to e.g. `qe_tools.inputparsers.cp` or something like this?
Yeah, that makes sense. Is output-parsing also within the scope of this library? If so, we could consider either a structure
parsers
input
output
generators
input
or flat:
input_parsers
(orinputparsers
)output_parsers
(currently doesn't exist)input_generators
I tend to favor the flat structure, although that means right now the options are just input_parsers
and input_generators
- which seems slightly redundant, but actually IMO nicer than the somewhat confusing generators
.
* `get_structure_from_qeinput` -> shall we change the name to something simpler? is `get_structure` clear enough? or `parse_structure`? or should we put an underscore between `qe` an `input`?
Definitely. I think this opens up a separate discussion, see #42
* shall we rename the kwargs of the public methods/functions, where it might make sense? E.g. for the `__init__` of QeInputFile, probably it doesn't make sense that it's called `pwinput`. Maybe simply `input_file` or `input_file_content` or `input_content`? We might want to do a similar discussion more generally once we agree on which are the public methods
Yeah, input_content
or just content
seems good to me.
from qe-tools.
If you would like my 2 centimes, I would prefer the nested structure, were it not for the fact that you will run into the problem when importing from input
you will get "keyword reserved" issues. So maybe the flat one works best here. Although I would definitely keep the underscore in that case.
from qe-tools.
If you would like my 2 centimes,
always appreciated
you will run into the problem when importing from
input
you will get "keyword reserved" issues.
Ha, I hadn't even considered that. Though it would technically work because input
is a function, not a keyword - but shadowing a builtin is rarely a great idea.
What's still bugging me here is that get_parameters_from_cell
actually doesn't really generate the input - not to the point where you could write it to disk, at least. So maybe input_converters
would be a better name there. If we think it could also be used on output, bare converters
could also work.
We could also ditch the "input" from the module name completely, and have the classes be importable as e.g. qe_tools.parsers.PwInputFile
.
from qe-tools.
What's still bugging me here is that
get_parameters_from_cell
actually doesn't really generate the input - not to the point where you could write it to disk, at least. So maybeinput_converters
would be a better name there.
This makes me think that the actual "generators" are currently embedded in the CalcJob
plugins of aiida-quantumespresso
. It might be useful to look if we can factor that out and include here. This would make it a lot easier for consumers that do not want this mingled with AiiDA. The QE input generator tool on the materials cloud comes to mind. This now has to install aiida-quantumespresso
just to build input file from some python values. We already factored this code out in aiida-quantumespresso
to even make this possible
from qe-tools.
Let's go with this
from qe-tools.
Related Issues (20)
- Exponentially-slow regex HOT 2
- Problem when encountering comments HOT 1
- dictionary problem with k_points
- Slight inconsistencies in physical constants HOT 9
- Wrong alat used if ibrav != 0 HOT 1
- Missing 'valid_ibrav' values in get_cell_from_parameters HOT 4
- Drop py2 support? HOT 10
- ibrav -13 is incorrect HOT 3
- Structure of Qe/Pw/CpInputFile HOT 5
- Add (minimal) documentation build
- Check and update docstrings
- Add README as long_description in setup.py
- When set qetools as the parser for qeinputgenerator, the generated input file for pwscf always use this setting: calculation = 'scf'. HOT 5
- Update or pin pytest-cases
- Parsing PW input file HOT 4
- Empty line after ATOMIC_SPECIES makes the parser fail HOT 1
- Move CI from Travis to GHA
- Drop Python 3.5 compatibility, add Python 3.9 to test matrix
- Constructing cell from parameters
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qe-tools.