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

Possible bug, fractional factorial by resolution #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyDOE2/doe_factorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def fracfact_by_res(n, res):
"""
# Determine minimum required number of base-factors.
min_fac = next(dropwhile(lambda n_: _n_fac_at_res(n_, res) < n,
range(res - 1, n)), None)
range(res - 1, n + 1)), None)

if min_fac is None:
raise ValueError('design not possible')
Expand Down Expand Up @@ -349,7 +349,7 @@ def _n_fac_at_res(n, res):
""" Calculate number of possible factors for fractional factorial
design with `n` base factors at resolution `res`.
"""
return sum(binom(n, r) for r in range(res - 1, n)) + n
return sum(binom(n, r) for r in range(res - 1, n + 1)) + n

################################################################################

Expand Down