-
Notifications
You must be signed in to change notification settings - Fork 2
SOF-7776 Update: add WFN property #151
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a19bfa3
update: add wfn property (claude)
VsevolodX 4c4a0fe
update: move to settings
VsevolodX c77903d
update: add test
VsevolodX cfd1d08
update: adjsut test
VsevolodX 72eca52
chore: esse
VsevolodX ecd4095
chore: esse
VsevolodX 57d9e20
chore: ipdate test
VsevolodX 8bc3975
update: convert alat to ang
VsevolodX 2b5a245
update: test with conversion
VsevolodX 7e845fc
update: convert alat to ang
VsevolodX 494f72d
update: fix error -- already angstroms
VsevolodX 46b8058
update: add comment
VsevolodX 2f31885
update: esse
VsevolodX File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
express/properties/non_scalar/two_dimensional_plot/wavefunction_amplitude.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from express.properties.non_scalar.two_dimensional_plot import TwoDimensionalPlotProperty | ||
|
|
||
|
|
||
| class WavefunctionAmplitude(TwoDimensionalPlotProperty): | ||
| """ | ||
| Wavefunction amplitude. | ||
| """ | ||
|
|
||
| def __init__(self, name, parser, *args, **kwargs): | ||
| super(WavefunctionAmplitude, self).__init__(name, parser, *args, **kwargs) | ||
| wavefunction_amplitude = self.parser.wavefunction_amplitude() | ||
| self.xDataArray = wavefunction_amplitude[0] | ||
| self.yDataSeries = [wavefunction_amplitude[1]] | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
tests/unit/properties/non_scalar/two_dimensional_plot/test_wavefunction_amplitude.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| from tests.unit import UnitTestBase | ||
| from express.properties.non_scalar.two_dimensional_plot.wavefunction_amplitude import WavefunctionAmplitude | ||
|
|
||
|
|
||
| WAVEFUNCTION_AMPLITUDE_RAW_DATA = [ | ||
| [0.0, 0.0050251256, 0.0100502513, 0.0150753769, 0.0201005025], | ||
| [0.0000322091, 0.0000072134, -0.0000218274, -0.0000540398, -0.0000883573] | ||
| ] | ||
|
|
||
| WAVEFUNCTION_AMPLITUDE = { | ||
| "name": "wavefunction_amplitude", | ||
| "xDataArray": [0.0, 0.0050251256, 0.0100502513, 0.0150753769, 0.0201005025], | ||
| "yDataSeries": [[0.0000322091, 0.0000072134, -0.0000218274, -0.0000540398, -0.0000883573]], | ||
| "xAxis": {"label": "coordinate", "units": "angstrom"}, | ||
| "yAxis": {"label": "amplitude", "units": "a.u."}, | ||
| } | ||
|
|
||
|
|
||
| class WavefunctionAmplitudeTest(UnitTestBase): | ||
| def setUp(self): | ||
| super().setUp() | ||
|
|
||
| def tearDown(self): | ||
| super().tearDown() | ||
|
|
||
| def test_wavefunction_amplitude(self): | ||
| parser = self.get_mocked_parser("wavefunction_amplitude", WAVEFUNCTION_AMPLITUDE_RAW_DATA) | ||
| property_ = WavefunctionAmplitude("wavefunction_amplitude", parser) | ||
| self.assertDeepAlmostEqual(property_.serialize_and_validate(), WAVEFUNCTION_AMPLITUDE) | ||
|
|
Oops, something went wrong.
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.
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.
We need to multiply by alat_to_angstrom