Repository navigation
Allow and test 1's in grid_shape - #274
Conversation
|
Restarting Travis. |
There was a problem hiding this comment.
Is this docstring still appropriate? Now that this is no longer test_both_methods.
|
Correct. Thanks @markkness |
|
@cowlicks please add several tests on the client side that use a context with a prime number of targets and create several multi-dimensional distarrays with different distributions in each axis. Check that the |
|
@kwmsmith got it. I limited it to 3 engines because otherwise we'd have to bump of the minimum number of engines on the ipcluster the tests are run with. |
|
Oh hey @coveralls, where have you been? |
There was a problem hiding this comment.
I am a little concerned that we would no longer have the alternate method available to test against. The previous test_both_methods seemed like a pretty thorough test that mult_partitions worked as expected. I guess that create_factors wouldn't handle the situation of allowing 1 as a factor?
There was a problem hiding this comment.
Yes. Also, create_factors was unused in the code.
There was a problem hiding this comment.
I think create_factors was really a test for mult_partitions, I think probably a simple-but-slow method that mult_partitions could be tested against. So it would have probably more properly lived in the test code.
There was a problem hiding this comment.
create_factors isn't so simple, it calls out to two other functions. Which themselves should be tested. It is complicated enough to warrant its own tests. And I'm not sure writing meta-tests for functions only used in tests is worthwhile.
I also deleted one of the functions create_factors called, divisors. And another that just wasn't used anywhere.
There was a problem hiding this comment.
On Tue, Apr 8, 2014 at 10:05 AM, Blake Griffith notifications@github.comwrote:
In distarray/tests/test_utils.py:
@@ -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]:create_factors isn't so simple, it calls out to two other functions.
Which themselves should be tested. It is complicated enough to warrant its
own tests. And I'm not sure writing meta-tests for functions only used in
tests is worthwhile.
Given unlimited resources, we'd do the full testing with multiple versions,
etc. @markkness feel free to make a wishlist issue with your testing
ideas, but otherwise, I'm +1 on just testing the factorisation function in
use and removing the others.
I also deleted one of the functions create_factors called, divisors. And
another that just wasn't used anywhere.Reply to this email directly or view it on GitHubhttps://github.com//pull/274/files#r11393841
.
Kurt W. Smith, Ph.D. ksmith@enthought.com
Enthought, Inc. http://www.enthought.com | 512.536.1057
|
I have created issue #293 to note the possible desirability of the extra test of the factoring, and included the relevant code. So I am now satisfied that this PR does not need to keep this anymore. |
|
This PR changes some of the distributions chosen for the example plots. I am not immediately sure if this change is bad or just another acceptable decision. In particular, the examples that were changed: [With 4 targets] |
|
@markkness @cowlicks you should be able to pass in the @markkness please keep the |
|
The plot examples are not currently specifying a |
|
@markkness I could have worded my response more clearly: what I meant is that I think you should pass in an explicit @cowlicks we'll have to think about what constraints the new grid_shape selection logic should satisfy, especially if it is changing the grid shape from what it was before this PR. |
|
@kwmsmith : Do you think that the arrays created via In any case, I am adjusting the example generator to be able to specify a grid shape. |
|
I think I can't specify |
|
I have created PR #294 to specify an explicit grid shape in the examples, which then generate the exact same output with this PR as with |
|
@kwmsmith yes the |
|
When |
There was a problem hiding this comment.
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
|
On Tue, Apr 8, 2014 at 3:01 PM, Mark Kness notifications@github.com wrote:
Yes, that's consistent with things as they stand right now. The
+1. It may make sense to allow a
Kurt W. Smith, Ph.D. ksmith@enthought.com |
|
On Tue, Apr 8, 2014 at 3:04 PM, Mark Kness notifications@github.com wrote:
Kurt W. Smith, Ph.D. ksmith@enthought.com |
|
rebased |
|
Ugh, I can't restart travis. |
|
I restarted it. |
|
The functionality in this PR seems to be fine, as far as I can see. I tried running the test suite with a number of engines other than 4, and this handled it better than master. With 8 engines, master has 15 errors, while this PR has only 10, and none of those are not seen in master. With 11 engines, this PR does as well as with 8, but master gets two more errors. (Ideally of course |
Allow and test 1's in `grid_shape`






This closes issue #258. And does some small refactoring.