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

simulate_experiment_responses does not install new responses. #34

Open
nhpackard opened this issue Jul 15, 2021 · 4 comments
Open

simulate_experiment_responses does not install new responses. #34

nhpackard opened this issue Jul 15, 2021 · 4 comments
Assignees

Comments

@nhpackard
Copy link
Contributor

(cf. #32)

To generate simulated responses and export them I execute:

space = daptics.get_experimental_space()
design = daptics.design
experiments = daptics.random_experiments_with_responses(space, design)
expsim = daptics.simulate_experiment_responses(experiments)
daptics.export_csv(csv_experiments_file, expsim, True)

This works to the extent that csv_experiments_file has the right simulated results

But then when I request next gen design with

newgen = daptics.put_experiments_csv(
    DapticsExperimentsType.DESIGNED_WITH_OPTIONAL_EXTRAS,
    csv_experiments_file)

I get error

Task failed with error(s)!  Messages are:
[0] category:	execution
[0] fatalError:	None
[0] message:	Experiments in Experiments1.csv do not match those of generation 1
[0] systemError:	None

My diagnosis is that the call daptics.random_experiments_with_responses installs the random experiments in Experiments1.csv, and then there is a skew between those and the simulated response experiments in csv_experiments_file.

Proposed solution: dispense with current daptics.simulate_experiment_responses, create new daptics.simulated_experiments_with_responses that is exactly like daptics.random_experiments_with_responses (including installation of Experiments1.csv on backend), except using simulated responses instead of random.

Actually better names would be:

daptics.experiments_with_random_responses
daptics.experiments_with_simulated_responses

I will work on this in new branch...

@nhpackard nhpackard self-assigned this Jul 15, 2021
@nhpackard
Copy link
Contributor Author

Not sure of my diagnosis.

I don't see where the code is fixing Experiments1.csv. Don't see this happening in daptics.random_experiments_with_responses.

@nhpackard
Copy link
Contributor Author

The problem: in

expsim = daptics.simulate_experiment_responses(experiments)
daptics.export_csv(csv_experiments_file, expsim, True)

The return value expsim does not have the same form as experiments, and so can't be exported with daptics.export_csv.

Instead, needs to be

expsim = daptics.simulate_experiment_responses(experiments)
expsim = expsim['simulateResponses']['table']
daptics.export_csv(csv_experiments_file, expsim, True)

If no objections, I am going to change 'daptics.simulate_experiment_responses(experiments)to return an experiments dictionary of the same form as the argexperiments`

@pzingg
Copy link
Collaborator

pzingg commented Jul 17, 2021

@nhpackard If you want to put up a pull request with these changes I will review.

@nhpackard
Copy link
Contributor Author

Will do.
Now distracted by workshop.

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