Skip to content

Commit e0feab7

Browse files
committed
Repo documentation
1 parent 41f5cf2 commit e0feab7

11 files changed

Lines changed: 206 additions & 43 deletions

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,23 @@ This repo holds the OpenAD website:
1717

1818
## Development
1919

20+
### Auto-generated content
21+
22+
Some of the documentation pages are automatically generated or updated by the `generate_docs()` script.
23+
Jump to the [/generator](generator) directory for details.
24+
25+
Documentation pages are generated by script:
26+
- [Publicly Available Models](https://openad.accelerate.science/docs/model-service/deploying-models)
27+
- [OpenAD Commands](https://openad.accelerate.science/docs/commands)
28+
- [Base Concepts](https://openad.accelerate.science/docs/base-concepts)
29+
30+
Documentation pages that have descriptions that are updated by script:
31+
- [OpenAD Plugins](https://openad.accelerate.science/docs/plugins)
32+
33+
Other files that are generated or updated by the script:
34+
- [README.md](https://github.com/acceleratedscience/openad-toolkit?tab=readme-ov-file#readme) for the openad-toolkit repo
35+
- [commands.csv](generator/_output/other/commands.csv) overview file
36+
2037
### Development Server
2138

2239
Run the development server at [localhost:8000](http://localhost:8000)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{{DO_NOT_EDIT}}
2+
3+
# Publicly Available Models
4+
5+
Below an overview of our available open-source models. Find them on [GitHub here](https://github.com/orgs/acceleratedscience/repositories?q=%22openad-service-%22).
6+
Go to [Deploying Models](deploying-models.md) for more detailed deployment options beyond the quick-start.
7+
8+
<br><br>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<!-- autogenerated:notion -->
2+
<!--
3+
4+
Attention
5+
---------
6+
One or more descriptions in this file have been auto-generated
7+
by the generate_docs() script in @openad-website/generator.
8+
9+
For more info:
10+
https://github.com/acceleratedscience/openad-website/tree/generator
11+
12+
-->
13+
<!-- /autogenerated:notion -->
14+
15+
<!--
16+
17+
Attention:
18+
The desciption in this file is auto-generated by the
19+
generatce_docs script in the openad-toolkit repo.
20+
21+
For more info:
22+
https://github.com/acceleratedscience/openad-toolkit/tree/main/docs
23+
24+
-->
25+
26+
<img src="assets/molecule-header.jpg" width="830" alt="OpenAD" />
27+
28+
# OpenAD
29+
30+
**Open Source Molecular & Materials Research Toolkit**
31+
32+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/openad)](https://pypi.org/project/openad/)
33+
[![PyPI version](https://img.shields.io/pypi/v/openad)](https://pypi.org/project/openad/)
34+
[![License MIT](https://img.shields.io/github/license/acceleratedscience/openad-toolkit)](https://opensource.org/licenses/MIT)
35+
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
36+
37+
<!-- autogenerated:description -->
38+
OpenAD is an intuitive toolkit that simplifies access to a variety of AI models and services for scientific discovery. Together with its convenient visualisation capabilities, OpenAD empowers scientists across industries to enhance their discovery process.
39+
40+
OpenAD is designed to integrate into your existing workflows via Jupyter Notebook, CLI or API, using a low-code approach to accelerate your research.
41+
<!-- /autogenerated:description -->
42+
43+
[![image](assets/home.svg)](https://openad.accelerate.science)
44+
[![image](assets/docs.svg)](https://openad.accelerate.science/docs/getting-started)
45+
[![image](assets/tutorials.svg)](https://openad.accelerate.science/blog/category/tutorials)
46+
<!-- [![image](assets/install.svg)](https://openad.accelerate.science/docs/installation) -->
47+
<br><br>
48+
49+
50+
## Quick Install
51+
52+
> [!TIP]
53+
> To install OpenAD inside a virtual environment, please consult the [Installation](https://openad.accelerate.science/docs/installation) guide.
54+
55+
pip install openad
56+
openad
57+
58+
Get started with Jupyter Notebook examples:
59+
60+
init_magic
61+
init_examples
62+
jupyter lab ~/openad_notebooks/Table_of_Contents.ipynb
63+
64+
If you get an error when running `init_magic`, you may first need to setup the default iPython profile for magic commands.
65+
66+
ipython profile create
67+
68+
<br><br>
69+
70+
## Release Notes
71+
72+
`0.7.5`
73+
- We have retired the RXN and Deep Search toolkits and replaced them with new and more user-friendly [plugins](README/plugins.md).

generator/methods/generate_commands_csv.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@
1010
from .shared import write_output_file
1111

1212

13-
# Loop through all commands and export them to a CSV file.
14-
# This is not used for anything in particular, other than
15-
# to have a list of all commands in a file which can be annotated.
1613
def generate_commands_csv(filename="commands.csv", delimiter=";"):
14+
"""
15+
Create a CSV with all OpenAD commands.
16+
17+
This is not used for anything in particular, other than
18+
to have a list of all commands in a file which can be annotated.
19+
20+
- Loop through all toolkit commands and compile CSV
21+
- Store CSV in _output/other/commands.csv
22+
"""
23+
1724
output_text(
1825
"<h1>Generating <yellow>commands.csv</yellow> from help</h1>", pad_top=2
1926
)

generator/methods/generate_commands_md.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@
66
from .shared import DO_NOT_EDIT, read_input_file, write_output_file
77

88

9-
# Loop through all commands and export them to docs/commands.md
109
def generate_commands_md(filename="commands.md"):
10+
"""
11+
Generate the commands.md page for the documentation.
12+
13+
- Start from the _input/commands.md template
14+
- Loop through all OpenAD commands & generate markdown
15+
- Store result in _output/docs/commands.md
16+
"""
17+
1118
output_text(f"<h1>Generating <yellow>{filename}</yellow> from help</h1>", pad_top=2)
1219

1320
toc = [] # Table of content

generator/methods/generate_model_docs.py

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,42 @@
1919

2020
def generate_model_docs(filename="model-service~available-models.md"):
2121
"""
22-
Generate output/available-models.md page for documentation website.
22+
Generate the available-models.md page for the documentation.
23+
24+
- Start from the _input/model-service~available-models.md template
25+
- Load the models.csv file from _input/models.csv
26+
- Scrape the README.md files from the GitHub repositories listed in models.csv
27+
- Generate overview markdown for each model
28+
- Store result in _output/docs/model-service~available-models.md
29+
30+
Note: The copy_docs script will interpret the ~ in the filename to know
31+
the path in the /docs directory where to copy the file to.
2332
"""
2433

2534
output_text(
2635
f"<h1>Generating <yellow>{filename}</yellow> from input/models.csv</h1>",
2736
pad_top=2,
2837
)
2938

39+
# Read commands.md input content
40+
available_models_md = read_input_file(filename)
41+
42+
# Insert DO NOT EDIT comment
43+
available_models_md = re.sub(
44+
r"{{DO_NOT_EDIT}}", DO_NOT_EDIT, available_models_md, flags=re.DOTALL
45+
)
46+
47+
# Scrape README.md files from GitHub
3048
model_data = scrape_repos()
3149
if not model_data:
3250
return
33-
# print(model_data)
51+
52+
# Generate markdown
3453
markdown = generate_md(model_data)
35-
markdown = DO_NOT_EDIT + "\n\n# Publicly Available Models\n\n" + markdown
36-
write_output_file("docs/" + filename, markdown)
54+
55+
# Insert in template and save
56+
available_models_md = available_models_md + "\n\n" + markdown
57+
write_output_file("docs/" + filename, available_models_md)
3758

3859
# for model in model_data:
3960
# output_text(f"<yellow>Name:</yellow> {model['name']}", pad_top=1)
@@ -213,16 +234,16 @@ def generate_md(model_data):
213234
if model["support:compose"]
214235
else "--REMOVE-LINE--"
215236
)
216-
instructions_url_container = "/docs/model-service/prepackaged-models/#deployment-via-container"
217-
instructions_url_compose = "/docs/model-service/prepackaged-models/#deployment-via-container-composeyml"
237+
instructions_url_container = "/docs/model-service/deploying-models/#deployment-via-container"
238+
instructions_url_compose = "/docs/model-service/deploying-models/#deployment-via-container-composeyaml-recommended"
218239
instructions_url = instructions_url_compose if model["support:compose"] else instructions_url_container
219240
btn_instructions = f"[Instructions]({instructions_url}){{ .md-button .md-button--tertiary }} "
220241
support_overview = (
221242
f"\n"
222243
"Support for: \n"
223244
f"{'❌' if not model['support:compose'] else '✅'} Docker / Podman Compose \n"
224245
f"{'❌' if not model['support:docker'] else '✅'} Docker / Podman \n"
225-
f"{'❌' if model['support:apple-silicon'] is False else '❓' if model['support:apple-silicon'] is None else '✅'} Apple Silicon - [more info](/docs/model-service/prepackaged-models/#apple-silicon) \n"
246+
f"{'❌' if model['support:apple-silicon'] is False else '❓' if model['support:apple-silicon'] is None else '✅'} Apple Silicon - [more info](/docs/model-service/deploying-models#apple-silicon) \n"
226247
f"\n"
227248
)
228249
# fmt:on
@@ -277,7 +298,7 @@ def generate_md(model_data):
277298

278299
# Compile
279300
html_block = [
280-
f"<details markdown><summary><h3>{title}</h3></summary>",
301+
f"<details markdown><summary><h4>{title}</h4></summary>",
281302
"<div markdown>",
282303
"",
283304
# Buttons

generator/methods/update_base_concepts_md.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@
77
from openad.helpers.output import output_text
88

99

10-
# Generate the docs/base-concepts.md file with the concept descriptions
1110
def update_base_concepts_md(filename="base-concepts.md"):
11+
"""
12+
Update the base-concepts.md page for the documentation.
13+
14+
- Copy the content of the current version of the page in /docs
15+
- Update the page with the latest concept descriptions from the _source description files
16+
- Store result in _output/docs/base-concepts.md
17+
"""
18+
1219
output_text(f"<h1>Generating <yellow>{filename}</yellow></h1>", pad_top=2)
1320

1421
# Read base file content

generator/methods/update_gh_readme.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,18 @@
77
from openad.helpers.output import output_text
88

99

10-
# Update the main README.md for the openad-toolkit repo with OpenAD description
1110
def update_gh_readme(filename="README.md"):
11+
"""
12+
Update the main README.md for the openad-toolkit repo with the latest OpenAD description.
13+
14+
WARNING: this will fetch the README.md from the current main branch of the
15+
openad-toolkit repo. If you have local changes, they will be overwritten.
16+
17+
- Copy the content of the current README.md on the main branch of the openad-toolkit repo.
18+
- Update the page with the latest OpenAD description from the _source/description.txt file.
19+
- Store result in _output/openad-toolkit/README.md
20+
"""
21+
1222
output_text(
1323
f"<h1>Updating <yellow>{filename}</yellow> with OpenAD description</h1>",
1424
pad_top=2,

generator/methods/update_plugins_md.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99

1010
# Update the docs/plugins.md file with the about_plugins description
1111
def update_plugins_md(filename="plugins.md"):
12+
"""
13+
Update the plugins.md file with the latest plugin description for the documentation.
14+
15+
- Copy the content of the current version of the page in /docs
16+
- Update the page with the latest plugin description from the _source/about_plugins.txt file
17+
- Store result in _output/docs/plugins.md
18+
"""
19+
1220
output_text(
1321
f"<h1>Updating <yellow>{filename}</yellow> with about_plugins description</h1>",
1422
pad_top=2,

0 commit comments

Comments
 (0)