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

Linear variable distribution fails #168

Open
Rykath opened this issue Jul 11, 2022 · 0 comments
Open

Linear variable distribution fails #168

Rykath opened this issue Jul 11, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@Rykath
Copy link
Collaborator

Rykath commented Jul 11, 2022

On profit run with a variable of the form: Linear(0.001, 0.101) the following error occurs:

Traceback (most recent call last):
  File "/home/oswell/ThreeSidedDie/venv/bin/profit", line 8, in <module>
    sys.exit(main())
  File "/home/oswell/ThreeSidedDie/venv/lib/python3.9/site-packages/profit/main.py", line 65, in main
    config = BaseConfig.from_file(config_file)
  File "/home/oswell/ThreeSidedDie/venv/lib/python3.9/site-packages/profit/config.py", line 279, in from_file
    self = cls(base_dir=path.split(filename)[0], **entries)
  File "/home/oswell/ThreeSidedDie/venv/lib/python3.9/site-packages/profit/config.py", line 234, in __init__
    self.process_entries()  # Postprocess the attributes to standardize different user entries.
  File "/home/oswell/ThreeSidedDie/venv/lib/python3.9/site-packages/profit/config.py", line 254, in process_entries
    self.variable_group.add(vars)
  File "/home/oswell/ThreeSidedDie/venv/lib/python3.9/site-packages/profit/util/variable.py", line 223, in add
    v.generate_values()
  File "/home/oswell/ThreeSidedDie/venv/lib/python3.9/site-packages/profit/util/variable.py", line 386, in generate_values
    self.value = globals().get(self.kind.lower())(*self.constraints, size=self.size).astype(self.dtype)
  File "/home/oswell/ThreeSidedDie/venv/lib/python3.9/site-packages/profit/util/variable.py", line 31, in linear
    return check_ndim(np.linspace(start, end, size))
  File "<__array_function__ internals>", line 180, in linspace
  File "/home/oswell/ThreeSidedDie/venv/lib/python3.9/site-packages/numpy/core/function_base.py", line 120, in linspace
    num = operator.index(num)
TypeError: 'tuple' object cannot be interpreted as an integer

replacing Linear with Uniform works as expected.

@Rykath Rykath added the bug Something isn't working label Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant