Skip to content

Random array creation takes distribution#360

Merged
kwmsmith merged 13 commits into
masterfrom
feature/random-array-creation-takes-distribution
May 5, 2014
Merged

Random array creation takes distribution#360
kwmsmith merged 13 commits into
masterfrom
feature/random-array-creation-takes-distribution

Conversation

@bgrant
Copy link
Copy Markdown
Contributor

@bgrant bgrant commented May 4, 2014

Refactor the client-side array-creation methods to take a Distribution object instead of the shape, dist, grid_shape arguments directly. A user can create a Distribution object many ways, including with those arguments. This allows all array-creation routines to create all of our supported distribution types.

I modified all random.py functions to take a Distribution as a required argument, whereas before, some of them could be called without shape/dist/grid_shape parameters to return a single scalar. This didn't seem to be an important use-case (one could just use the appropriate numpy function for that), so I omitted it.

bgrant added 12 commits May 2, 2014 11:50
Also, fix the tests.

All of these functions have been modified to take a distribution as a required argument, whereas before, some of them could be called without shape/dist/grid_shape parameters to return a single scalar.  This didn't seem to be an important use-case (one could just use the appropriate numpy function for that), so I omitted it.
@bgrant bgrant added this to the 0.3 milestone May 4, 2014
@cowlicks
Copy link
Copy Markdown
Contributor

cowlicks commented May 5, 2014

Restarted travis.

…bution

Conflicts:
	distarray/dist/decorators.py
	distarray/dist/tests/test_context.py
	distarray/dist/tests/test_decorators.py
	distarray/dist/tests/test_distributed_io.py
	distarray/dist/tests/test_random.py
@bgrant bgrant mentioned this pull request May 5, 2014
@kwmsmith
Copy link
Copy Markdown
Contributor

kwmsmith commented May 5, 2014

LGTM. Looks like this PR mostly finishes the client-side distribution work and fully integrates distributions with distarrays.

We'll see how things shake out interface-wise, but for now I think this is a much cleaner design.

kwmsmith added a commit that referenced this pull request May 5, 2014
…takes-distribution

Random array creation takes distribution
@kwmsmith kwmsmith merged commit 7f4c7c8 into master May 5, 2014
@cowlicks cowlicks deleted the feature/random-array-creation-takes-distribution branch May 5, 2014 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants