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

Example in README fails #1

Open
ipashchenko opened this issue Sep 2, 2017 · 1 comment
Open

Example in README fails #1

ipashchenko opened this issue Sep 2, 2017 · 1 comment

Comments

@ipashchenko
Copy link

In Python 3:

remove = range(dim - r, dim)

results in TypeError: 'float' object cannot be interpreted as an integer.
This probably because of pynolh.params(dim) returns two ints and a float (r).

In Python 2:

nolh = pynolh.nolh(conf, remove)

results in TypeError: 'float' object cannot be interpreted as an index.

Checkmate, guys:)

@shimwell
Copy link

shimwell commented Mar 15, 2018

Thanks for raising this issue and the suggested fix, I made a few changes and the first example now works for me in python2 and python3

line in pynolh.py function nolh
changed from
s = m + (math.factorial(m - 1) / (2 * math.factorial(m - 3)))
changed to
s = int(m + (math.factorial(m - 1) / (2 * math.factorial(m - 3))))

line in pynolh.py function params
changed from
return m, q, s - dim
changed to
return m, q, int(s - dim)

I would like to see an example showing how to vary the number of sample points generated

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