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

Allow deprecated set_kpoints_path of KpointsData without cell #1047

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Jan 15, 2018

Fixes #1046

In a recent update, various buggy methods of the KpointsData class were
deprecated. The deprecated interface would raise a ValueError if the
set_kpoints_path would be called before a cell had been set, however,
the deprecated methods used to allow for this, as long as the provided
list used explicit reciprocal coordinates and Cartesian mode was False.
Always raising when a cell was not defined was therefore breaking backwards
compatibility.

To restore this behavior, we now pass cell=None when it is not set, to the
legacy version of the get_explicit_kpoints_path method. This also required
some minor changes to the helper function analyze_cell

A regression test was added to verify that the old behavior was successfully
restored through these changes

In a recent update, various buggy methods of the KpointsData class were
deprecated. The deprecated interface would raise a ValueError if the
set_kpoints_path would be called before a cell had been set, however,
the deprecated methods used to allow for this, as long as the provided
list used explicit reciprocal coordinates and cartesion mode was False.
Always raising when a cell was not defined was therefore breaking backwards
compatibility.

To restore this behavior, we now pass cell=None when it is not set, to the
legacy version of the get_explicit_kpoints_path method. This also required
some minor changes to the helper function analyze_cell

A regression test was added to verify that the old behavior was successfully
restored through these changes
@sphuber sphuber added this to the v0.11.0 milestone Jan 15, 2018
Copy link
Member

@giovannipizzi giovannipizzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good to me!!!

@giovannipizzi giovannipizzi merged commit 423523a into aiidateam:release_v0.11.0 Jan 15, 2018
@sphuber sphuber deleted the fix_1046_set_kpoints_data_backwards_compatibility branch January 15, 2018 21:30
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.

2 participants