-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add lost function check_estimated_shape (#101)
* Add lost function check_estimated_shape This function transforms 1D output of shape (n,) to a 2D array of shape (n, 1). * Add tests for check_estimated_shape
- Loading branch information
Joanna Jędrzejewska-Szmek
committed
May 9, 2019
1 parent
8cf977a
commit ee322b9
Showing
2 changed files
with
29 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from __future__ import print_function, division, absolute_import | ||
from kcsd.sKCSD_utils import check_estimated_shape | ||
import os | ||
import unittest | ||
import numpy as np | ||
|
||
class testCheckEstimatedShape(unittest.TestCase): | ||
def test_unchanged(self): | ||
array = np.ones((1, 5)) | ||
out = check_estimated_shape(array) | ||
self.assertEqual(array.shape, out.shape) | ||
|
||
def test_changed(self): | ||
array = np.ones((5, )) | ||
out = check_estimated_shape(array) | ||
self.assertEqual(out.shape, (5, 1)) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |