From 984189c64c2ccc793b105519fcc785a1042bc69e Mon Sep 17 00:00:00 2001 From: Milos Gligoric Date: Wed, 17 Jan 2024 04:50:29 -0600 Subject: [PATCH] doc: Add pipeline for documentation --- .github/workflows/documentation.yml | 33 ++++++++++++++++++++++++++ docs/index.rst | 2 +- docs/ndarrays.rst | 8 +++---- docs/{work-units.rst => workunits.rst} | 0 4 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/documentation.yml rename docs/{work-units.rst => workunits.rst} (100%) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 00000000..893dd0f2 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,33 @@ +name: Documentation + +on: + push: + branches: + - main + pull_request: + branches: + - main + +permissions: + contents: write + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - name: Install dependencies + run: | + pip install sphinx sphinx_rtd_theme myst_parser + - name: Sphinx build + run: | + sphinx-build doc _build + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + with: + publish_branch: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: _build/ + force_orphan: true diff --git a/docs/index.rst b/docs/index.rst index d909a613..a0bc37de 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -50,7 +50,7 @@ interest to those already familiar with the Kokkos framework. concepts patterns policies - work-units + workunits ndarrays examples diff --git a/docs/ndarrays.rst b/docs/ndarrays.rst index 8985e866..cb05289e 100644 --- a/docs/ndarrays.rst +++ b/docs/ndarrays.rst @@ -2,7 +2,7 @@ N-dimensional Arrays ==================== -Two common types of arguments given to workunits (:doc:`work-units`) +Two common types of arguments given to workunits (:doc:`workunits`) are those of primitive types and n-dimensional arrays. PyKokkos nicely interoperates with ``numpy`` and ``cupy`` arrays, as well as introduces its own abstraction (``View``) used mostly for research @@ -18,7 +18,7 @@ Interoperability with NumPy --------------------------- ``numpy`` arrays can be directly passed as arguments to workunits -(:doc:`work-units`). As any other argument to a workunit, the arrays +(:doc:`workunits`). As any other argument to a workunit, the arrays are passed as keyword arguments when executing a pattern (:doc:`patterns`). @@ -60,7 +60,7 @@ Interoperability with CuPy -------------------------- ``cupy`` arrays can be directly passed as arguments to workunits -(:doc:`work-units`). As any other argument to a workunit, the arrays +(:doc:`workunits`). As any other argument to a workunit, the arrays are passed as keyword arguments when executing a pattern (:doc:`patterns`). @@ -130,7 +130,7 @@ scalar to all elements of a view. pk.parallel_for(n, add, v=v, x=1) -Recall (:doc:`work-units`) that type annotations are not required. +Recall (:doc:`workunits`) that type annotations are not required. .. toctree:: :maxdepth: 2 diff --git a/docs/work-units.rst b/docs/workunits.rst similarity index 100% rename from docs/work-units.rst rename to docs/workunits.rst