Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deploy task for gh-pages #28

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 0 additions & 17 deletions .github/workflows/documentation-preview.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
28 changes: 0 additions & 28 deletions .readthedocs.yml

This file was deleted.

Binary file added 63c9c54.zip
Binary file not shown.
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
COSMO Software Cookbook
=======================

`COSMO Software Cookbook <https://software-cookbook.rtfd.io/>`_
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

Expand Down
2 changes: 1 addition & 1 deletion docs/requirements-rascal.txt
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
5 changes: 2 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
--extra-index-url https://luthaf.fr/nightly-wheels/
# Sphinx
sphinx
sphinx_rtd_theme
Expand All @@ -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
8 changes: 4 additions & 4 deletions examples/lode_linear/lode_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


# %%
Expand All @@ -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"])

# %%
#
Expand Down
2 changes: 1 addition & 1 deletion examples/roy_gch/roy_gch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
Loading