Add handling for ibrav=91/-13 to 'cell_from_parameters'. #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #28.
Because the meaning of
ibrav=-13
changed in QE version 6.4.1, this adds a way of dealing with different QE versions:The
parse_version
function turns a string (e.g.'6.4.1'
) into apackaging.version.Version
. By default the latest version is used, which is implemented as a singleton object that compares as greater than anyVersion
object.In the interface, the version can be specified as the optional keyword-only argument
qe_version
. Because this option needs to be available both at the top-levelQeInputFile.__init__
and on the free functions (e.g.get_cell_from_parameters
), it accepts either a string or an already-parsed version. This allows immediately parsing the version inQeInputFile.__init__
, while also accepting string input inget_cell_from_parameters
.The way this is implemented is by making the
parse_version
idempotent, meaning that it will not change an already-parsed version.In the tests, the
qe_version
can be passed as a keyword tosingletest
. However, these tests currently cannot auto-generate the reference file.Dependency changes:
pytest
as a test runner (haven't modified the existing tests yet, but these could potentially be simplified a lot withpytest-regressions
)packaging
as an explicit dependency. Since this is part of the standard Python tooling (viasetuptools
) it should usually be installed already anyway.To be reviewed especially carefully:
pw.x
input descriptionqe_version
keyword-only argument. The other changes (addingparse_version
etc.) are internal-only.