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

Bug: sampling with constant variable with float #258

Open
mpvanderschelling opened this issue Dec 15, 2023 · 0 comments
Open

Bug: sampling with constant variable with float #258

mpvanderschelling opened this issue Dec 15, 2023 · 0 comments

Comments

@mpvanderschelling
Copy link
Collaborator

mpvanderschelling commented Dec 15, 2023

Problem

When sampling from a Domain with a constant variable with a float, the following error is raised:

Traceback (most recent call last):
  File "/home/martin/Documents/scratchbook/try_hydra/main.py", line 10, in <module>
    e = ExperimentData.from_sampling(domain=domain, sampler='random', n_samples=2)
  File "/home/martin/Documents/GitHub/F3DASM/src/f3dasm/_src/experimentdata/experimentdata.py", line 296, in from_sampling
    experimentdata.sample(sampler=sampler, n_samples=n_samples, seed=seed)
  File "/home/martin/Documents/GitHub/F3DASM/src/f3dasm/_src/experimentdata/experimentdata.py", line 1372, in sample
    sample_data: DataTypes = sampler(
  File "/home/martin/Documents/GitHub/F3DASM/src/f3dasm/_src/design/samplers.py", line 157, in __call__
    return self.get_samples()
  File "/home/martin/Documents/GitHub/F3DASM/src/f3dasm/_src/design/samplers.py", line 126, in get_samples
    samples_constant = self._sample_constant(numsamples=numsamples)
  File "/home/martin/Documents/GitHub/F3DASM/src/f3dasm/_src/design/samplers.py", line 163, in _sample_constant
    samples[:, dim] = param.value
ValueError: could not convert string to float: 'test'
@mpvanderschelling mpvanderschelling changed the title Bug: creating constant variable with float Bug: sampling with constant variable with float Dec 15, 2023
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

1 participant