Skip to content
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

Fix RectangularStrategy() results if get_grid() argument is prime #50

Open
MorganHaworth opened this issue Feb 25, 2019 · 1 comment
Open

Comments

@MorganHaworth
Copy link
Collaborator

RectangularStrategy, if get_grid takes in prime N, creates a one-row by N cols plots grid. This poses an issue with larger prime numbers (N > 3)

@pganssle
Copy link
Member

@MorganHaworth I am not sure there's much that can be done about that, because the whole point of "RectangularStrategy" is "find me an arrangement of plots where each row has the same number of columns". For prime numbers, that always means you'll have one row, which is the risk you're running by using RectangularStrategy.

That said, I think we can probably do some refactoring to make it clearer what the difference between a Rectangular and Square strategy. I would think that a Square strategy would be the same as a Rectangular strategy, but with a constrained aspect ratio, but the real difference is that RectangularStrategy is strict about keeping the number of columns per row the same, and SquareStrategy relaxes that contraint in favor of keeping the aspect ratio closer to 1:1.

I'll have to think more about how the API should work, but I'm wondering if maybe we can refactor this and have RectangularStrategy take an aspect ratio parameter, but otherwise have the same behavior as SquareStrategy has now, and SquareStrategy can just be an alias for RectangularStrategy(1, 1).

We can then migrate RectangularStrategy to a new class named more to focus on the fact that it is enforcing the constraint that all rows have the same number of columns. Unfortunately, my intuition for how that should be called is "GridStrategy" (since it lays everything out on a grid), in which case maybe we should be calling this project subplot-strategy...

@MorganHaworth MorganHaworth changed the title Fix RectangularStrategy() results if get_grid() parameter is prime Fix RectangularStrategy() results if get_grid() argument is prime Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants