caddforge-docs 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- caddforge_docs/__init__.py +1 -0
- caddforge_docs/cli.py +20 -0
- caddforge_docs/server.py +124 -0
- caddforge_docs/site/404.html +2118 -0
- caddforge_docs/site/assets/_mkdocstrings.css +237 -0
- caddforge_docs/site/assets/images/favicon.png +0 -0
- caddforge_docs/site/assets/javascripts/bundle.d7400e89.min.js +16 -0
- caddforge_docs/site/assets/javascripts/bundle.d7400e89.min.js.map +7 -0
- caddforge_docs/site/assets/javascripts/workers/search.2c215733.min.js +42 -0
- caddforge_docs/site/assets/javascripts/workers/search.2c215733.min.js.map +7 -0
- caddforge_docs/site/assets/licenses/W3C-Software-and-Document-2015.txt +15 -0
- caddforge_docs/site/assets/licenses/autogrid-COPYING-GPL-2.txt +339 -0
- caddforge_docs/site/assets/licenses/autogrid-GCC-RUNTIME-COPYING-GPL-3.txt +674 -0
- caddforge_docs/site/assets/licenses/autogrid-GCC-RUNTIME-EXCEPTION.txt +73 -0
- caddforge_docs/site/assets/licenses/autogrid-GCC-RUNTIME-NOTICE.txt +24 -0
- caddforge_docs/site/assets/licenses/caddforge-opencosmors-COPYING.txt +674 -0
- caddforge_docs/site/assets/licenses/caddforge-opencosmors-LICENSE.txt +165 -0
- caddforge_docs/site/assets/licenses/caddforge-unidock-tools-LICENSE.txt +202 -0
- caddforge_docs/site/assets/licenses/clipboard-LICENSE.txt +19 -0
- caddforge_docs/site/assets/licenses/escape-html-LICENSE.txt +2 -0
- caddforge_docs/site/assets/licenses/focus-visible-LICENSE.txt +4 -0
- caddforge_docs/site/assets/licenses/fontawesome-LICENSE.txt +165 -0
- caddforge_docs/site/assets/licenses/fuzzaldrin-plus-LICENSE.txt +21 -0
- caddforge_docs/site/assets/licenses/lunr-LICENSE.txt +17 -0
- caddforge_docs/site/assets/licenses/material-LICENSE.txt +20 -0
- caddforge_docs/site/assets/licenses/material-design-color-LICENSE.txt +31 -0
- caddforge_docs/site/assets/licenses/material-shadows-LICENSE.txt +31 -0
- caddforge_docs/site/assets/licenses/mkdocs-material-LICENSE.txt +19 -0
- caddforge_docs/site/assets/licenses/mkdocs-material-extensions-LICENSE.txt +21 -0
- caddforge_docs/site/assets/licenses/mkdocs-section-index-LICENSE.txt +21 -0
- caddforge_docs/site/assets/licenses/mkdocstrings-LICENSE.txt +15 -0
- caddforge_docs/site/assets/licenses/mkdocstrings-python-LICENSE.txt +15 -0
- caddforge_docs/site/assets/licenses/octicons-LICENSE.txt +21 -0
- caddforge_docs/site/assets/licenses/preact-LICENSE.txt +19 -0
- caddforge_docs/site/assets/licenses/properdocs-LICENSE.txt +26 -0
- caddforge_docs/site/assets/licenses/pymdown-extensions-LICENSE.txt +113 -0
- caddforge_docs/site/assets/licenses/rxjs-LICENSE.txt +180 -0
- caddforge_docs/site/assets/licenses/simple-LICENSE.txt +30 -0
- caddforge_docs/site/assets/licenses/tiny-emitter-LICENSE.txt +19 -0
- caddforge_docs/site/assets/licenses/tslib-LICENSE.txt +12 -0
- caddforge_docs/site/assets/licenses/zeno-rocha-components-LICENSE.txt +22 -0
- caddforge_docs/site/assets/stylesheets/main.ec1eaa64.min.css +1 -0
- caddforge_docs/site/assets/stylesheets/main.ec1eaa64.min.css.map +1 -0
- caddforge_docs/site/assets/stylesheets/palette.ab4e12ef.min.css +1 -0
- caddforge_docs/site/assets/stylesheets/palette.ab4e12ef.min.css.map +1 -0
- caddforge_docs/site/core/cli/index.html +2446 -0
- caddforge_docs/site/core/concepts/index.html +2340 -0
- caddforge_docs/site/core/configuration/index.html +2300 -0
- caddforge_docs/site/core/index.html +2170 -0
- caddforge_docs/site/core/jobs-results/index.html +2315 -0
- caddforge_docs/site/core/plugins/index.html +2200 -0
- caddforge_docs/site/core/slurm/index.html +2562 -0
- caddforge_docs/site/development/ci-publishing/index.html +2345 -0
- caddforge_docs/site/development/contributing/index.html +2311 -0
- caddforge_docs/site/development/documentation/index.html +2380 -0
- caddforge_docs/site/development/index.html +2201 -0
- caddforge_docs/site/development/release-notes/index.html +2504 -0
- caddforge_docs/site/development/release-readiness/index.html +2333 -0
- caddforge_docs/site/development/security/index.html +2181 -0
- caddforge_docs/site/development/tool-authoring/index.html +2435 -0
- caddforge_docs/site/examples/index.html +2465 -0
- caddforge_docs/site/examples/manifest.json +158 -0
- caddforge_docs/site/examples/minimize/component_overrides.yaml +14 -0
- caddforge_docs/site/examples/minimize/ligand_only.yaml +13 -0
- caddforge_docs/site/examples/minimize/pipeline_docking.yaml +84 -0
- caddforge_docs/site/examples/minimize/pipeline_scatter.yaml +49 -0
- caddforge_docs/site/examples/minimize/pocket_free_shell_restrained.yaml +13 -0
- caddforge_docs/site/examples/minimize/pocket_restrained.yaml +13 -0
- caddforge_docs/site/examples/minimize/prepared_metal.yaml +14 -0
- caddforge_docs/site/examples/minimize/sidechains_free_backbone_fixed.yaml +13 -0
- caddforge_docs/site/examples/minimize/sidechains_free_backbone_restrained.yaml +13 -0
- caddforge_docs/site/examples/pipelines/descriptor-model-and-candidate-filter.yaml +44 -0
- caddforge_docs/site/examples/pipelines/dock-extract-and-minimize-poses.yaml +85 -0
- caddforge_docs/site/examples/pipelines/docking-screen-and-rescore.yaml +55 -0
- caddforge_docs/site/examples/pipelines/flexible-gnina-to-openbpmd-to-md-to-abfe.yaml +189 -0
- caddforge_docs/site/examples/pipelines/gnina-flexible-complex-artifacts.yaml +52 -0
- caddforge_docs/site/examples/pipelines/minimize-a-multi-pose-sdf.yaml +46 -0
- caddforge_docs/site/examples/pipelines/pose-level-md-selection.yaml +95 -0
- caddforge_docs/site/examples/pipelines/result-collection-and-diagnostics.yaml +55 -0
- caddforge_docs/site/examples/quickstart/diagnostics.yaml +8 -0
- caddforge_docs/site/examples/quickstart/index.html +2172 -0
- caddforge_docs/site/examples/quickstart/pipeline.yaml +23 -0
- caddforge_docs/site/examples/quickstart/run.py +18 -0
- caddforge_docs/site/examples/quickstart/run_pipeline.py +6 -0
- caddforge_docs/site/examples/quickstart/scores.csv +7 -0
- caddforge_docs/site/examples/quickstart/values.csv +31 -0
- caddforge_docs/site/examples/run_tool.py +40 -0
- caddforge_docs/site/examples/tools/datascience-csv-scatter.yaml +17 -0
- caddforge_docs/site/examples/tools/datascience-distribution-diagnostics.yaml +10 -0
- caddforge_docs/site/examples/tools/descriptors-ani-conformers.yaml +9 -0
- caddforge_docs/site/examples/tools/descriptors-ani-psa.yaml +9 -0
- caddforge_docs/site/examples/tools/descriptors-cluster-molecules.yaml +11 -0
- caddforge_docs/site/examples/tools/descriptors-phesa.yaml +7 -0
- caddforge_docs/site/examples/tools/docking-gnina.yaml +12 -0
- caddforge_docs/site/examples/tools/docking-idockya.yaml +8 -0
- caddforge_docs/site/examples/tools/docking-unidock.yaml +12 -0
- caddforge_docs/site/examples/tools/fep-openfe-abfe.yaml +53 -0
- caddforge_docs/site/examples/tools/fep-openfe-rbfe-septop.yaml +23 -0
- caddforge_docs/site/examples/tools/md-center-and-align.yaml +16 -0
- caddforge_docs/site/examples/tools/md-cluster-representative.yaml +16 -0
- caddforge_docs/site/examples/tools/md-extract-frames.yaml +17 -0
- caddforge_docs/site/examples/tools/md-fix-structure.yaml +20 -0
- caddforge_docs/site/examples/tools/md-grand.yaml +28 -0
- caddforge_docs/site/examples/tools/md-inducia.yaml +29 -0
- caddforge_docs/site/examples/tools/md-minimize.yaml +13 -0
- caddforge_docs/site/examples/tools/md-openbpmd.yaml +11 -0
- caddforge_docs/site/examples/tools/md-plain-md.yaml +28 -0
- caddforge_docs/site/examples/tools/ml-explore-classifier.yaml +5 -0
- caddforge_docs/site/examples/tools/ml-model-factory.yaml +32 -0
- caddforge_docs/site/examples/tools/ml-model-zoo.yaml +16 -0
- caddforge_docs/site/examples/tools/ml-pca.yaml +10 -0
- caddforge_docs/site/examples/tools/ml-simple-gp.yaml +17 -0
- caddforge_docs/site/examples/tools/qm-transfer-free-energy.yaml +11 -0
- caddforge_docs/site/explanation/references/index.html +2218 -0
- caddforge_docs/site/explanation/reproducibility/index.html +2306 -0
- caddforge_docs/site/explanation/third-party-notices/index.html +2599 -0
- caddforge_docs/site/getting-started/first-pipeline/index.html +2195 -0
- caddforge_docs/site/getting-started/first-workflow/index.html +2329 -0
- caddforge_docs/site/getting-started/index.html +2200 -0
- caddforge_docs/site/getting-started/installation/index.html +2541 -0
- caddforge_docs/site/gui/index.html +2267 -0
- caddforge_docs/site/gui/plugin-authoring/index.html +2280 -0
- caddforge_docs/site/gui/walkthrough/index.html +2181 -0
- caddforge_docs/site/how-to/jobs/index.html +2195 -0
- caddforge_docs/site/how-to/scatter/index.html +2193 -0
- caddforge_docs/site/how-to/troubleshooting/index.html +2429 -0
- caddforge_docs/site/index.html +2359 -0
- caddforge_docs/site/objects.inv +0 -0
- caddforge_docs/site/pipelines/artifacts/index.html +2314 -0
- caddforge_docs/site/pipelines/built-ins/index.html +2670 -0
- caddforge_docs/site/pipelines/examples/index.html +3186 -0
- caddforge_docs/site/pipelines/index.html +2164 -0
- caddforge_docs/site/pipelines/specification/index.html +2278 -0
- caddforge_docs/site/plugins/datascience/index.html +2405 -0
- caddforge_docs/site/plugins/descriptors/index.html +2609 -0
- caddforge_docs/site/plugins/docking/index.html +2480 -0
- caddforge_docs/site/plugins/fep/index.html +2508 -0
- caddforge_docs/site/plugins/index.html +2216 -0
- caddforge_docs/site/plugins/md/index.html +3795 -0
- caddforge_docs/site/plugins/ml/index.html +2815 -0
- caddforge_docs/site/plugins/qm/index.html +2309 -0
- caddforge_docs/site/plugins/version-matrix/index.html +2449 -0
- caddforge_docs/site/reference/api/index.html +4414 -0
- caddforge_docs/site/reference/index.html +2166 -0
- caddforge_docs/site/search/search_index.json +1 -0
- caddforge_docs/site/sitemap.xml +191 -0
- caddforge_docs/site/sitemap.xml.gz +0 -0
- caddforge_docs-0.3.0.dist-info/METADATA +158 -0
- caddforge_docs-0.3.0.dist-info/RECORD +152 -0
- caddforge_docs-0.3.0.dist-info/WHEEL +4 -0
- caddforge_docs-0.3.0.dist-info/entry_points.txt +2 -0
- caddforge_docs-0.3.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Installed documentation and optional CLI command for CADDForge."""
|
caddforge_docs/cli.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""The optional ``caddforge docs`` command."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
|
|
7
|
+
from .server import serve_documentation, site_directory
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def docs(
|
|
11
|
+
host: str = typer.Option("127.0.0.1", "--host", help="Hostname or IP address to bind."),
|
|
12
|
+
port: int = typer.Option(0, "--port", min=0, max=65535, help="Port; 0 selects a free port."),
|
|
13
|
+
no_browser: bool = typer.Option(False, "--no-browser", help="Serve without opening a browser."),
|
|
14
|
+
) -> None:
|
|
15
|
+
"""Open the installed documentation and serve it until Ctrl+C."""
|
|
16
|
+
try:
|
|
17
|
+
serve_documentation(site_directory(), host=host, port=port, open_browser=not no_browser)
|
|
18
|
+
except (OSError, RuntimeError, ValueError) as exc:
|
|
19
|
+
typer.echo(f"Could not open documentation: {exc}", err=True)
|
|
20
|
+
raise typer.Exit(code=1) from exc
|
caddforge_docs/server.py
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"""Serve installed documentation without build tools or a source checkout."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from functools import partial
|
|
6
|
+
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
|
|
7
|
+
from ipaddress import ip_address
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
import socket
|
|
10
|
+
from threading import Thread
|
|
11
|
+
from typing import BinaryIO, Callable
|
|
12
|
+
import webbrowser
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def site_directory() -> Path:
|
|
16
|
+
"""Locate the site shipped in the installed package."""
|
|
17
|
+
site = Path(__file__).resolve().parent / "site"
|
|
18
|
+
if not (site / "index.html").is_file():
|
|
19
|
+
raise RuntimeError(
|
|
20
|
+
"The installed documentation site is missing. Reinstall caddforge-docs "
|
|
21
|
+
"from a built wheel, or rebuild its editable installation."
|
|
22
|
+
)
|
|
23
|
+
return site
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class DocumentationHandler(SimpleHTTPRequestHandler):
|
|
27
|
+
"""Serve site files quietly, without directory listings."""
|
|
28
|
+
|
|
29
|
+
def log_message(self, format: str, *args: object) -> None:
|
|
30
|
+
"""Keep normal browser requests out of the command's terminal output."""
|
|
31
|
+
|
|
32
|
+
def list_directory(self, path: str) -> BinaryIO | None:
|
|
33
|
+
"""Return a normal missing-page error for directories without an index."""
|
|
34
|
+
self.send_error(404, "Documentation page not found")
|
|
35
|
+
return None
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def create_server(site: Path, host: str, port: int) -> ThreadingHTTPServer:
|
|
39
|
+
"""Bind a site server using IPv4, IPv6, or a resolvable hostname."""
|
|
40
|
+
if not host.strip():
|
|
41
|
+
raise ValueError("--host must be a hostname or IP address")
|
|
42
|
+
addresses = socket.getaddrinfo(host, port, type=socket.SOCK_STREAM, proto=socket.IPPROTO_TCP)
|
|
43
|
+
last_error: OSError | None = None
|
|
44
|
+
seen: set[tuple[int, tuple]] = set()
|
|
45
|
+
for family, _, _, _, address in addresses:
|
|
46
|
+
if family not in (socket.AF_INET, socket.AF_INET6) or (family, address) in seen:
|
|
47
|
+
continue
|
|
48
|
+
seen.add((family, address))
|
|
49
|
+
|
|
50
|
+
class DocumentationServer(ThreadingHTTPServer):
|
|
51
|
+
address_family = family
|
|
52
|
+
|
|
53
|
+
try:
|
|
54
|
+
return DocumentationServer(
|
|
55
|
+
address, partial(DocumentationHandler, directory=str(site.resolve()))
|
|
56
|
+
)
|
|
57
|
+
except OSError as exc:
|
|
58
|
+
last_error = exc
|
|
59
|
+
if last_error is not None:
|
|
60
|
+
raise last_error
|
|
61
|
+
raise OSError(f"No usable listening address for {host!r}")
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def browser_url(server: ThreadingHTTPServer) -> str:
|
|
65
|
+
"""Return a connectable URL, using loopback for wildcard bindings."""
|
|
66
|
+
host, port = server.server_address[:2]
|
|
67
|
+
address = ip_address(host.split("%", 1)[0])
|
|
68
|
+
if address.is_unspecified:
|
|
69
|
+
host = "::1" if address.version == 6 else "127.0.0.1"
|
|
70
|
+
elif address.version == 6 and "%" not in host and len(server.server_address) > 3:
|
|
71
|
+
scope = server.server_address[3]
|
|
72
|
+
if scope:
|
|
73
|
+
host += f"%{scope}"
|
|
74
|
+
if address.version == 6:
|
|
75
|
+
host = "[" + host.replace("%", "%25") + "]"
|
|
76
|
+
return f"http://{host}:{port}/"
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def _wait_for_server(thread: Thread) -> None:
|
|
80
|
+
"""Keep the CLI in the foreground while its HTTP worker serves requests."""
|
|
81
|
+
while thread.is_alive():
|
|
82
|
+
thread.join(timeout=0.25)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def serve_documentation(
|
|
86
|
+
site: Path,
|
|
87
|
+
*,
|
|
88
|
+
host: str,
|
|
89
|
+
port: int,
|
|
90
|
+
open_browser: bool = True,
|
|
91
|
+
emit: Callable[[str], None] = print,
|
|
92
|
+
) -> None:
|
|
93
|
+
"""Open a bound HTTP server and stop it cleanly on Ctrl+C.
|
|
94
|
+
|
|
95
|
+
Args:
|
|
96
|
+
site: Built documentation directory.
|
|
97
|
+
host: Listening hostname or address.
|
|
98
|
+
port: Listening port; zero selects an available port.
|
|
99
|
+
open_browser: Whether to launch the system's default browser.
|
|
100
|
+
emit: Terminal output callback.
|
|
101
|
+
"""
|
|
102
|
+
with create_server(site, host, port) as server:
|
|
103
|
+
url = browser_url(server)
|
|
104
|
+
thread = Thread(target=server.serve_forever, name="caddforge-docs", daemon=True)
|
|
105
|
+
thread.start()
|
|
106
|
+
try:
|
|
107
|
+
listening_host = server.server_address[0]
|
|
108
|
+
if server.address_family == socket.AF_INET6:
|
|
109
|
+
listening_host = f"[{listening_host}]"
|
|
110
|
+
emit(f"Serving documentation on {listening_host}:{server.server_port}")
|
|
111
|
+
emit(f"Documentation: {url}")
|
|
112
|
+
emit("Press Ctrl+C to stop the documentation server.")
|
|
113
|
+
if open_browser:
|
|
114
|
+
try:
|
|
115
|
+
if not webbrowser.open(url, new=2):
|
|
116
|
+
emit(f"Could not open a browser automatically. Open {url} manually.")
|
|
117
|
+
except Exception as exc:
|
|
118
|
+
emit(f"Could not open a browser automatically ({exc}). Open {url} manually.")
|
|
119
|
+
_wait_for_server(thread)
|
|
120
|
+
except KeyboardInterrupt:
|
|
121
|
+
emit("Documentation server stopped.")
|
|
122
|
+
finally:
|
|
123
|
+
server.shutdown()
|
|
124
|
+
thread.join()
|