diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..b09b5797 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,51 @@ +name: Documentation + +on: + push: + branches: [main] + tags: ["*"] + pull_request: + # Check all PR + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: setup rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - name: setup Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: install dependencies + run: | + python -m pip install tox + - name: build documentation + run: tox -e docs + + - name: put documentation in the website + run: | + git clone https://github.com/$GITHUB_REPOSITORY --branch gh-pages gh-pages + rm -rf gh-pages/.git + cd gh-pages + + REF_KIND=$(echo $GITHUB_REF | cut -d / -f2) + if [[ "$REF_KIND" == "tags" ]]; then + TAG=${GITHUB_REF#refs/tags/} + mv ../docs/build/html $TAG + else + rm -rf latest + mv ../docs/build/html latest + fi + + - name: deploy to gh-pages + if: github.event_name == 'push' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./gh-pages/ + force_orphan: true diff --git a/.github/workflows/documentation-preview.yml b/.github/workflows/documentation-preview.yml deleted file mode 100644 index e59a5f2b..00000000 --- a/.github/workflows/documentation-preview.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: readthedocs/actions - -on: - pull_request_target: - types: - - opened - -permissions: - pull-requests: write - -jobs: - documentation-links: - runs-on: ubuntu-latest - steps: - - uses: readthedocs/actions/preview@v1 - with: - project-slug: "software-cookbook" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7dacab49..f38dbcef 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,7 +1,7 @@ # Lint tests run on PR # but should not run after push to main because reporting # these after push is meaningless to the building of the package -name: lint +name: Lint on: pull_request: diff --git a/.readthedocs.yml b/.readthedocs.yml deleted file mode 100644 index 3b1193ae..00000000 --- a/.readthedocs.yml +++ /dev/null @@ -1,28 +0,0 @@ -# .readthedocs.yml -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required -version: 2 - -# Set the version of Python and other tools we need -build: - os: ubuntu-22.04 - apt_packages: - - cmake - tools: - python: "3.10" - rust: "1.64" - -# Build documentation in the docs/ directory with Sphinx -sphinx: - configuration: docs/src/conf.py - -# Declare the Python requirements required to build the docs -python: - install: - - method: pip - path: . - - requirements: docs/requirements.txt - - requirements: docs/requirements-rascal.txt - diff --git a/63c9c54.zip b/63c9c54.zip new file mode 100644 index 00000000..5c6010e6 Binary files /dev/null and b/63c9c54.zip differ diff --git a/README.rst b/README.rst index 4bc8f3c1..6eedb718 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,8 @@ COSMO Software Cookbook ======================= -`COSMO Software Cookbook `_ +The source code for the COSMO cookbook is maintained as a GitHub pages site. The home +page is accessible at https://lab-cosmo.github.io/software-cookbook/latest. .. marker-intro-start diff --git a/docs/requirements-rascal.txt b/docs/requirements-rascal.txt index 450b6599..b69845b9 100644 --- a/docs/requirements-rascal.txt +++ b/docs/requirements-rascal.txt @@ -1,5 +1,5 @@ # rascal needs to be in a separate requirements file because we need to specify -# the packages index-url for it te use the prebuilt from +# the packages index-url for it te use the prebuilt from # from https://github.com/Luthaf/nightly-wheels # extra-url does not work here because there is another rascal package on pypi --index-url https://luthaf.fr/nightly-wheels/ diff --git a/docs/requirements.txt b/docs/requirements.txt index f4c54e99..fe4ef1d2 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,3 @@ ---extra-index-url https://luthaf.fr/nightly-wheels/ # Sphinx sphinx sphinx_rtd_theme @@ -20,7 +19,7 @@ scipy scikit-learn skmatter chemiscope -equisolve @ git+https://github.com/lab-cosmo/equisolve.git@71b3dfd +equisolve @ https://github.com/lab-cosmo/equisolve/archive/63c9c54.zip metatensor -rascaline +rascaline @ https://github.com/luthaf/rascaline/archive/581d0ca.zip diff --git a/examples/lode_linear/lode_tutorial.py b/examples/lode_linear/lode_tutorial.py index 22a65c4a..d01e0c3c 100644 --- a/examples/lode_linear/lode_tutorial.py +++ b/examples/lode_linear/lode_tutorial.py @@ -169,10 +169,10 @@ # For linear models only: Sum features up over atoms (``samples``) in the same # structure. -samples_names_to_sum = ["center", "species_center"] +sample_names_to_sum = ["center", "species_center"] -ps_sr = metatensor.sum_over_samples(ps_sr, samples_names=samples_names_to_sum) -ps_lr = metatensor.sum_over_samples(ps_lr, samples_names=samples_names_to_sum) +ps_sr = metatensor.sum_over_samples(ps_sr, sample_names=sample_names_to_sum) +ps_lr = metatensor.sum_over_samples(ps_lr, sample_names=sample_names_to_sum) # %% @@ -188,7 +188,7 @@ descriptor_co = calculator_co.compute(frames, gradients=["positions"]) co = descriptor_co.keys_to_properties(["species_center"]) -co = metatensor.sum_over_samples(co, samples_names=["center"]) +co = metatensor.sum_over_samples(co, sample_names=["center"]) # %% # diff --git a/examples/roy_gch/roy_gch.py b/examples/roy_gch/roy_gch.py index 4690a688..0b90a705 100644 --- a/examples/roy_gch/roy_gch.py +++ b/examples/roy_gch/roy_gch.py @@ -153,7 +153,7 @@ rho2i = rho2i.keys_to_samples(["species_center"]).keys_to_properties( ["species_neighbor_1", "species_neighbor_2"] ) -rho2i_structure = mean_over_samples(rho2i, samples_names=["center", "species_center"]) +rho2i_structure = mean_over_samples(rho2i, sample_names=["center", "species_center"]) np.savez("roy_features.npz", feats=rho2i_structure.block(0).values)