This is the README documentation for the daptics Design of Experiments GraphQL API and the Python API client.
To use the daptics API, you must first register at the https://daptics.ai to establish your login and password for API authentication.
The python_client
folder contains the Python GraphQL client package module
sources (in the daptics_client
, phoenix
, and syncasync
folders),
and several interactive Python notebooks for experimenting with the API.
Follow the instructions in the README-NOTEBOOKS.md file in that folder to set up a local Jupyter Notebook
server if you do not have access to a server that can open .ipynb
files.
Install graphql-markdown
Then in the pydocmd
folder, run:
NODE_TLS_REJECT_UNAUTHORIZED=0 graphql-markdown --no-toc --title 'Daptics GraphQL API' https://api.daptics.ai/api >graphql_api.md
Notes:
The NODE_TLS_REJECT_UNAUTHORIZED=0
is to handle our ZeroSSL certificates.
If this fails, you can use the appropriate JSON schema file to generate the docs, with this command:
graphql-markdown --no-toc --title 'Daptics GraphQL API' api-0.14.1.json >graphql_api.md
yarn
to manage node packages, try this:yarn bin graphql-markdown
to get the location of the graphql-markdown
executable.
Install these tools in order:
a. tornado - Important! Specify version 5.1.1 (version 6.0 will break MkDocs) b. pdoc3 c. MkDocs d. mkdocs-rtd-dropdown - Theme for MkDocs
Create Markdown documentation for the daptics_client.py
file using pdoc3
. In the
python_client
folder, run:
pdoc3 --pdf --force --template-dir ../pdoc/templates daptics_client >../pydocmd/daptics_client.md
Then build the entire "Read the Docs" site, using mkdocs
. In the root project folder,
where the mkdocs.yml
configuration file is located, run: mkdocs build
Html and Markdown files will be produced in the docs
folder.
Install jupytext
Set up metadata in any ipynb file that has Python code:
jupytext --set-formats ipynb,python//py:light 03_SimpleTutorial.ipynb
Export Python code to /python
subdirectory:
jupytext --from ipynb --to python//py:light 03_SimpleTutorial.ipynb
Edit Python code as needed. Or when you run in Jupyter notebook, and make changes, the corresponding Python file will be kept up to date!
Rebuild notebook from Python file without outputs (do this before checking into
version control):
jupytext --from python//py:light --to notebook python/03_SimpleTutorial.py
You can also use jupyter nbconvert
to remove all output from .ipynb files:
jupyter nbconvert 03_SimpleTutorial.ipynb --to notebook --ClearOutputPreprocessor.enabled=True --inplace