Repository navigation
Allow and test 1's in grid_shape
#274
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
Changes from all commits
bb5c48e
4bc12b9
2f4ffef
657663c
34c9861
a55333b
c6198ab
1c62d7d
a737a76
bca0d3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -222,8 +222,8 @@ def _init(self, dim_data, grid_shape, dtype=None, buf=None, comm=None): | |
| # object's data. | ||
| self.global_index = GlobalIndex(self.maps, self.local_array.view()) | ||
|
|
||
| self.base = None | ||
| self.ctypes = None | ||
| self.base = None # mimic numpy.ndarray.base | ||
| self.ctypes = None # mimic numpy.ndarray.ctypes | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly for this, though it seems like this should be an attribute that raises http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.ctypes.html
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Neither are implemented. And I think to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks to me like On Wed, Apr 9, 2014 at 2:52 PM, Blake Griffith notifications@github.comwrote:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are correct. Since we don't have slicing
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I vote for keeping both of these in here, as there is some meaning to them. |
||
|
|
||
| def _init_grid_shape(self, grid_shape): | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,14 +16,18 @@ class TestMultPartitions(unittest.TestCase): | |
| Test the multiplicative parition code. | ||
| """ | ||
|
|
||
| def test_both_methods(self): | ||
| """ | ||
| Do the two methods of computing the multiplicative partitions agree? | ||
| """ | ||
| for s in [2, 3]: | ||
| for n in range(2, 512): | ||
| self.assertEqual(utils.mult_partitions(n, s), | ||
| utils.create_factors(n, s)) | ||
| def test_mult_partitions(self): | ||
| self.assertEqual(utils.mult_partitions(1, 2), [(1, 1)]) | ||
| self.assertEqual(utils.mult_partitions(2, 2), [(1, 2)]) | ||
| self.assertEqual(utils.mult_partitions(1, 7), [(1,) * 7]) | ||
| self.assertEqual(utils.mult_partitions(7, 2), [(1, 7)]) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am a little concerned that we would no longer have the alternate method available to test against. The previous
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. Also,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I also deleted one of the functions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On Tue, Apr 8, 2014 at 10:05 AM, Blake Griffith notifications@github.comwrote:
Given unlimited resources, we'd do the full testing with multiple versions,
Kurt W. Smith, Ph.D. ksmith@enthought.com |
||
| self.assertEqual(utils.mult_partitions(7, 3), [(1, 1, 7)]) | ||
| self.assertEqual(utils.mult_partitions(16, 4), [(1, 1, 1, 16), | ||
| (1, 1, 2, 8), | ||
| (1, 1, 4, 4), | ||
| (1, 2, 2, 4), | ||
| (2, 2, 2, 2)]) | ||
| self.assertEqual(utils.mult_partitions(6, 3), [(1, 1, 6), (1, 2, 3)]) | ||
|
|
||
|
|
||
| class TestSanitizeIndices(unittest.TestCase): | ||
|
|
||
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.
Do you think this is not needed? This is here from Brian's original code.
http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.base.html