ProtoLife / daptics-api

API documentation and clients for the daptics.ai design of experiments engine
https://daptics.ai
GNU General Public License v3.0
1 stars 1 forks source link

doc: Notebook and documentation improvements #9

Open ggazzola opened 5 years ago

ggazzola commented 5 years ago

This is the main TODO list, and refers to the steps in the 03_SimpleTutorial notebook. Details and discussion on the items in the list are in subsequent comments.

General

Step 3

Step 7

Step 8

Step 9

Step 11

Step 12

Step 13

status = running -- 37 seconds.
Error:  HTTPConnectionPool(host='inertia.protolife.com', port=8080): Read timed out. (read timeout=None)
nhpackard commented 5 years ago

Merge steps {5,6}, {9,10}, and {13,10} <--> E.g., hide the daptics.poll_for_current_task() call in a while loop within daptics.save_experimental_and_space_parameters_csv() / daptics.save_experimental_and_space_parameters_csv() / daptics.save_experiment_responses_csv() and break the loop when status == success.

No: The whole point of launching long-running processes and then having the ability to poll is to not tie up a session waiting for a call to finish. User could launch the process with daptics.save_experimental_and_space_parameters_csv(), shut down the window, then come back later and see if it has finished. If user wants to write a loop to poll, fine.

nhpackard commented 5 years ago

Add to the documentation:

Ummm... is this basic jupyter notebook knowledge? (execute code block by putting code in a colde cell and execute the cell with shift-return)

should be no failures in the tutorial.

ggazzola commented 5 years ago

No: The whole point of launching long-running processes and then having the ability to poll is to not tie up a session waiting for a call to finish. User could launch the process with daptics.save_experimental_and_space_parameters_csv(), shut down the window, then come back later and see if it has finished. If user wants to write a loop to poll, fine.

I see. Then I think it would be useful for functions like daptics.save_experimental_and_space_parameters_csv to trigger some kind of equivalent of the progress bubbles we have in the web interface. E.g., have these functions print something like "Computing..." as soon as they are called, and then something like "Done" as soon as their task is completed (I am guessing the latter is trickier to do if the user closes the notebook/disconnects from the Jupiter server and reopen/reconnects to it at a later time).

I also added this item to the issue description on top of this page:

ggazzola commented 5 years ago

Add to the documentation:

  • [ ] how to execute a code block;

Ummm... is this basic jupyter notebook knowledge? (execute code block by putting code in a colde cell and execute the cell with shift-return)

Yes, I think it may be worth mentioning the shift-return command somewhere in the intro, so the inexperienced user doesn't have to search that information somewhere else.

nhpackard commented 5 years ago

Why not saving the N-th design directly to genN_experiments.csv, rather than saving it to genN_design.csv and having the user manually duplicate and rename that file in the next step?

I think this is basically a good idea, but I haven't done it yet.

nhpackard commented 5 years ago

No: The whole point of launching long-running processes and then having the ability to poll is to not tie up a session waiting for a call to finish. User could launch the process with daptics.save_experimental_and_space_parameters_csv(), shut down the window, then come back later and see if it has finished. If user wants to write a loop to poll, fine.

I see. Then I think it would be useful for functions like daptics.save_experimental_and_space_parameters_csv to trigger some kind of equivalent of the progress bubbles we have in the web interface. E.g., have these functions print something like "Computing..." as soon as they are called, and then something like "Done" as soon as their task is completed (I am guessing the latter is trickier to do if the user closes the notebook/disconnects from the Jupiter server and reopen/reconnects to it at a later time).

Still no. The point is to launch the process, then let the user do whatever they want. If they want to create bubbles they can wrap the polling function inside a loop with bubbles. But they might want to go and do something with their liquid handling robot then come back and check to see if the process is done. 'Done' is when you call the polling function and see status=success instead of status=running.

But: FYI: I did make a class method that has more or less the behavior you suggest: wait_for_current_task(). It sits in a loop, printing out elapsed number of seconds, until the loop finishes, then returns.

The tutorial shows how to use the lower level polling function, and then uses the wait_for_current_task() for the rest of the tutorial.

pzingg commented 4 years ago

Adding an item to the list above from the server repo: Explain in one or more of the notebooks that there is a way to go from design to design + responses = experiments tfor next design without using CSV files, using in-memory Python structures only.