5de80d4f7e
modified: INSTALL.md modified: README.md modified: build_release_zip.py modified: compute.py new file: doc/index.html modified: dynamics.py modified: engines/c/main.c modified: engines/cpp/main.cpp modified: engines/fortran/main.f90 modified: examples/case01/input/coord.txt renamed: examples/case01/input/parameters.yaml -> examples/case01/input/input.txt modified: examples/case01/run_dynamics.py new file: examples/case02/input/bond.txt new file: examples/case02/input/connection.txt new file: examples/case02/input/coord.txt new file: examples/case02/input/input.txt new file: examples/case02/run_dynamics.py
37 lines
821 B
Python
37 lines
821 B
Python
"""
|
|
Build a lean Dynamics.zip package for the website download button.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import zipfile
|
|
from pathlib import Path
|
|
|
|
|
|
HERE = Path(__file__).resolve().parent
|
|
ZIP_PATH = HERE.parent / "Dynamics-demo.zip"
|
|
ARC_ROOT = "Dynamics"
|
|
|
|
INCLUDE_FILES = [
|
|
"README.md",
|
|
"dynamics.py",
|
|
"compute.py",
|
|
"sample.py",
|
|
"draw.py",
|
|
"plot_trajectory.py",
|
|
"examples\\case01\\input\\input.txt",
|
|
"examples\\case01\\input\\coord.txt",
|
|
]
|
|
|
|
|
|
def main() -> None:
|
|
with zipfile.ZipFile(ZIP_PATH, "w", compression=zipfile.ZIP_DEFLATED) as archive:
|
|
for relative_name in INCLUDE_FILES:
|
|
path = HERE / relative_name
|
|
archive.write(path, arcname=f"{ARC_ROOT}/{relative_name}")
|
|
print(f"[release] wrote {ZIP_PATH}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|