-
Notifications
You must be signed in to change notification settings - Fork 1
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
Get cell #186
Merged
Get cell #186
Changes from 4 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
cdb7771
add get_cell
samwaseda df73b02
add get_cell in __init__
samwaseda e29d1d8
another adding in __init__
samwaseda 09fa362
add tests
samwaseda e2d0846
update docstring and add error message
samwaseda ac7e157
update tests
samwaseda bc476bc
copy and paste the same message, which Liam will probably hate
samwaseda 4c5834c
Add tests as if my previous commit message hadn't existed
samwaseda adc184b
Merge branch 'separate_draw_box' into get_cell
samwaseda 99a28ac
Merge remote-tracking branch 'origin' into get_cell
samwaseda e21bb2f
use get_cell
samwaseda 98c62c6
Update structuretoolkit/common/helper.py
samwaseda f82327e
update error
samwaseda 0d3a426
Merge branch 'get_cell' of github.com:pyiron/structuretoolkit into ge…
samwaseda 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
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -51,6 +51,7 @@ | |
get_wrapped_coordinates, | ||
pymatgen_to_ase, | ||
select_index, | ||
get_cell, | ||
) | ||
|
||
# Visualize | ||
|
This file contains 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 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 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,24 @@ | ||
# coding: utf-8 | ||
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department | ||
# Distributed under the terms of "New BSD License", see the LICENSE file. | ||
|
||
import unittest | ||
import numpy as np | ||
from ase.build import bulk | ||
import structuretoolkit as stk | ||
|
||
|
||
class TestHelpers(unittest.TestCase): | ||
def test_get_cell(self): | ||
self.assertEqual((3 * np.eye(3)).tolist(), stk.get_cell(3).tolist()) | ||
self.assertEqual( | ||
([1, 2, 3] * np.eye(3)).tolist(), stk.get_cell([1, 2, 3]).tolist() | ||
) | ||
atoms = bulk("Fe") | ||
self.assertEqual( | ||
atoms.cell.tolist(), stk.get_cell(atoms).tolist() | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
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.
Remove unused import to clean up the code.
- from ase.data import atomic_numbers
This import is unused and should be removed to clean up the codebase.
Committable suggestion