This repository has been archived by the owner on Apr 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests for StandardScaler for with_mean with_std
tests for all combinations of with_mean=[True, False], with_std=[True, False] for the StandardScaler have been added fixes the smal bugs that raise errors for new tests
- Loading branch information
1 parent
c921c5f
commit 4d478aa
Showing
3 changed files
with
129 additions
and
91 deletions.
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
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,55 @@ | ||
import numpy as np | ||
from equistore import Labels, TensorBlock, TensorMap | ||
|
||
|
||
def random_single_block_no_components_tensor_map(): | ||
""" | ||
Create a dummy tensor map to be used in tests. This is the same one as the | ||
tensor map used in `tensor.rs` tests. | ||
""" | ||
block_1 = TensorBlock( | ||
values=np.random.rand(4, 2), | ||
samples=Labels( | ||
["sample", "structure"], | ||
np.array([[0, 0], [1, 1], [2, 2], [3, 3]], dtype=np.int32), | ||
), | ||
components=[], | ||
properties=Labels(["properties"], np.array([[0], [1]], dtype=np.int32)), | ||
) | ||
block_1.add_gradient( | ||
"positions", | ||
data=np.random.rand(7, 3, 2), | ||
samples=Labels( | ||
["sample", "structure", "center"], | ||
np.array( | ||
[ | ||
[0, 0, 1], | ||
[0, 0, 2], | ||
[1, 1, 0], | ||
[1, 1, 1], | ||
[1, 1, 2], | ||
[2, 2, 0], | ||
[3, 3, 0], | ||
], | ||
dtype=np.int32, | ||
), | ||
), | ||
components=[Labels(["direction"], np.array([[0], [1], [2]], dtype=np.int32))], | ||
) | ||
|
||
block_1.add_gradient( | ||
"cell", | ||
data=np.random.rand(4, 6, 2), | ||
samples=Labels( | ||
["sample", "structure"], | ||
np.array([[0, 0], [1, 1], [2, 2], [3, 3]], dtype=np.int32), | ||
), | ||
components=[ | ||
Labels( | ||
["direction_xx_yy_zz_yz_xz_xy"], | ||
np.array([[0], [1], [2], [3], [4], [5]], dtype=np.int32), | ||
) | ||
], | ||
) | ||
|
||
return TensorMap(Labels.single(), [block_1]) |