Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
87d0b8b
doc: move examples/ to doc/source/examples
jorgepiloto Oct 25, 2023
364548b
feat: improved layout
jorgepiloto Oct 25, 2023
7407e59
doc: migrate notebooks to gallery
jorgepiloto Oct 27, 2023
bea1996
feat: stash
jorgepiloto Nov 2, 2023
64cd1bd
fix: jupyter_server<2.11 for jupytext
jorgepiloto Nov 22, 2023
49fe025
feat: basic gallery of examples
jorgepiloto Nov 22, 2023
fd7ee2f
ci: adapt ci_cd_pr.yml to run doc examples
jorgepiloto Nov 22, 2023
9faa74b
doc: fix spelling issue
jorgepiloto Nov 23, 2023
d15f18c
fix: ci multiline
jorgepiloto Nov 23, 2023
9a27032
ci: run xvfb-run when building examples
jorgepiloto Nov 23, 2023
3922cfd
wip
jorgepiloto Dec 7, 2023
dd4a546
doc: complete example
jorgepiloto Dec 19, 2023
1d8b6e8
doc: complete example
jorgepiloto Dec 19, 2023
67e89b6
fix: remove xvfb-run from doc build
jorgepiloto Dec 20, 2023
94d2863
fix: adapt syntax to latest changes
jorgepiloto Dec 20, 2023
c62998f
fix: env vars and extras
jorgepiloto Dec 20, 2023
6dabd0b
doc: remove unnecesary fiels
jorgepiloto Dec 20, 2023
a745bf7
fix: required env vars
jorgepiloto Dec 20, 2023
530da50
fix: jupyter_server issue
jorgepiloto Dec 20, 2023
30fc3e4
dbg: notebook
jorgepiloto Dec 20, 2023
bec73f6
dbg: notebook content
jorgepiloto Dec 20, 2023
02a2edd
doc: complete notebook
jorgepiloto Dec 20, 2023
1a592be
fix: doc build for examples
jorgepiloto Dec 20, 2023
40f17a4
doc: exclude _static/README.md
jorgepiloto Dec 20, 2023
75ce904
ci: fix logic when including nightly sections
jorgepiloto Dec 20, 2023
0bf5bce
doc: isolate plotter
jorgepiloto Dec 21, 2023
a046c42
fix: tox
jorgepiloto Dec 21, 2023
3f7dd43
feat: add prolog in examples
jorgepiloto Dec 22, 2023
11af50b
fix: font size in code
jorgepiloto Dec 22, 2023
4879bde
feat: generate scripts and notebooks
jorgepiloto Dec 22, 2023
eb5d7a7
feat: generate example artifacts
jorgepiloto Dec 22, 2023
f28d6a5
dbg: test globe and map
jorgepiloto Dec 23, 2023
d9847c3
feat: back to Python files and examples/ at root
jorgepiloto Jan 12, 2024
0e1f148
feat: delete examples within doc/source
jorgepiloto Jan 12, 2024
8ee6b1e
feat: restore file
jorgepiloto Jan 12, 2024
7e4cdb2
maint: remove unnecesary deps
jorgepiloto Jan 12, 2024
423cd1a
fix: duplicated deps
jorgepiloto Jan 12, 2024
7246123
feat: ignore non-processed examples
jorgepiloto Jan 12, 2024
ec166c1
dbg: licensing
jorgepiloto Jan 12, 2024
88c41cf
ci: restore tox.ini file
jorgepiloto Jan 15, 2024
d3196fc
ci: restore tests
jorgepiloto Jan 15, 2024
38d7ba7
doc: update examples path
jorgepiloto Jan 15, 2024
6d1e863
fix: conf.py
jorgepiloto Jan 15, 2024
9ff0995
doc: fix style
jorgepiloto Jan 15, 2024
c9f2cef
fix: remove doc/source/examples
jorgepiloto Jan 15, 2024
3681658
ci: reduce tox.ini verbosity in doc env
jorgepiloto Jan 15, 2024
1b1e586
fix: ignore trash generated by Jupyter
jorgepiloto Jan 15, 2024
3456e0b
fix: thumbnail
jorgepiloto Jan 15, 2024
e8ff160
fix: enable warnings again in tox.ini file
jorgepiloto Jan 15, 2024
41831b9
dbg: capture output in notebook
jorgepiloto Jan 24, 2024
7141b5a
Merge branch 'main' into doc/examples
jorgepiloto Jan 24, 2024
8f4b9f1
dbg: trigger only doc-build in CI/CD
jorgepiloto Jan 24, 2024
932d90c
fix: update jupyter-server version
jorgepiloto Jan 24, 2024
b3ff262
dbg: take snapshot
jorgepiloto Jan 24, 2024
1355a0b
dbg: fix renamings in jupyterwidgets.py
jorgepiloto Jan 24, 2024
920257b
feat: use CSS to remove snapshot label
jorgepiloto Jan 24, 2024
4eacbfe
feat: add show method for WidgetBase class
jorgepiloto Jan 25, 2024
6ba1635
dbg: override __repr__ for notebook capture
jorgepiloto Jan 25, 2024
2fe9018
dbg: add _repr_html method
jorgepiloto Jan 25, 2024
370a6f8
fix: use BUILD_EXMAPLES env to render snaptshots
jorgepiloto Jan 25, 2024
5e7a565
dbg: add plotter at the end
jorgepiloto Jan 25, 2024
2014af5
feat: add plotter methods
jorgepiloto Jan 25, 2024
3a604c2
feat: add visualization extras in tox.in
jorgepiloto Jan 29, 2024
5a7da2d
Merge branch 'main' into doc/examples
jorgepiloto Jan 29, 2024
0d6ac20
fix: remove max memory limit
jorgepiloto Jan 29, 2024
1a2c409
feat: use StkObjectRoot instance rather than STKEngineApplication
jorgepiloto Feb 6, 2024
9c66d74
feat: update camera view
jorgepiloto Feb 6, 2024
ab8340e
feat: update to the latest ansys-sphinx-theme
jorgepiloto Feb 6, 2024
15375b0
fix: avoid using _ in large numbers
jorgepiloto Feb 6, 2024
ddbd873
Merge branch 'main' into doc/examples
jorgepiloto Feb 6, 2024
3a7ba42
fix: example
jorgepiloto Feb 8, 2024
cacbece
Merge branch 'main' into doc/examples
jorgepiloto Feb 8, 2024
502648f
feat: last details in plotters
jorgepiloto Feb 8, 2024
216e68f
feat: add sidecar option in widgets
jorgepiloto Feb 8, 2024
9465a63
fix: missing title arg
jorgepiloto Feb 8, 2024
a7788cc
doc: ensure Python examples are included in output html files
jorgepiloto Feb 8, 2024
70a1758
ci: restore jobs
jorgepiloto Feb 8, 2024
6ed5c74
fix: code style
jorgepiloto Feb 12, 2024
12e4cf3
maint: do not check for code style in notebooks
jorgepiloto Feb 12, 2024
5a21d90
doc: fix sphinx hook
jorgepiloto Feb 12, 2024
8016197
feat: center images in notebooks
jorgepiloto Feb 12, 2024
a9d1d19
fix: spelling
jorgepiloto Feb 12, 2024
88838fd
Merge branch 'main' into doc/examples
jorgepiloto Feb 13, 2024
bdff699
feat: apply suggestions
jorgepiloto Feb 13, 2024
0f5e712
fix: typo in ci_cd_pr.yml
jorgepiloto Feb 13, 2024
bca0acc
Merge branch 'main' into doc/examples
jorgepiloto Feb 15, 2024
5e8e4a5
fix: code-style in docstring
jorgepiloto Feb 15, 2024
64909dc
Merge branch 'main' into doc/examples
jorgepiloto Feb 22, 2024
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
92 changes: 65 additions & 27 deletions .github/workflows/ci_cd_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,61 +65,92 @@ jobs:

doc-build:
name: "Doc build"
runs-on: ubuntu-latest
runs-on: [self-hosted, pystk]
needs: doc-style
timeout-minutes: 30
steps:

- name: "Checkout the project"
uses: actions/checkout@v4

- name: "Generate the name of the Docker image and the container"
run: |
python_image_name=${{ env.STK_DOCKER_IMAGE }}-python${{ env.MAIN_PYTHON_VERSION }}
container_name=stk-python${{ env.MAIN_PYTHON_VERSION }}
echo "STK_PYTHON_IMAGE=$python_image_name" >> $GITHUB_ENV
echo "STK_CONTAINER=$container_name" >> $GITHUB_ENV

- name: "Start the container from the desired image"
run: |
docker run \
--detach -it \
--network="host" \
--name ${{ env.STK_CONTAINER }} \
--env ANSYSLMD_LICENSE_FILE=${{ env.LICENSE_SERVER_PORT }}@${{ secrets.LICENSE_SERVER }} \
--volume ${PWD}:/home/stk/pystk \
${{ env.STK_PYTHON_IMAGE }}

- name: "Install Pandoc inside the container"
run: |
docker exec \
--user root \
--workdir ${{ env.PYSTK_DIR }} \
${{ env.STK_CONTAINER }} /bin/bash -c \
"yum install -y epel-release && yum install -y pandoc --enablerepo=epel"

- name: "Install Tox"
run: |
docker exec \
--workdir ${{ env.PYSTK_DIR }} \
${{ env.STK_CONTAINER }} /bin/bash -c \
"python -m pip install tox && rm -rf .tox"

# Render the documentation including or excluding different sections
# according to the labels of the pull-request.

- name: "Build docs including the 'Examples' section"
id: build-doc-with-examples
uses: ansys/actions/doc-build@v5
if: |
contains(github.event.pull_request.labels.*.name, 'docs:examples') &&
!contains(github.event.pull_request.labels.*.name, 'docs:api')
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
env:
BUILD_API: false
BUILD_EXAMPLES: true
run: |
docker exec \
--workdir ${{ env.PYSTK_DIR }} \
${{ env.STK_CONTAINER }} /bin/bash -c \
"export BUILD_API=false BUILD_EXAMPLES=true && tox -e doc"

- name: "Build docs including the 'API' section"
id: build-doc-with-api
uses: ansys/actions/doc-build@v5
if: |
contains(github.event.pull_request.labels.*.name, 'docs:api') &&
!contains(github.event.pull_request.labels.*.name, 'docs:examples')
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
env:
BUILD_API: true
BUILD_EXAMPLES: false
run: |
docker exec \
--workdir ${{ env.PYSTK_DIR }} \
${{ env.STK_CONTAINER }} /bin/bash -c \
"export BUILD_API=true BUILD_EXAMPLES=false && tox -e doc"

- name: "Build docs excluding 'API' and 'Examples' sections"
id: build-doc-minimum
uses: ansys/actions/doc-build@v5
if: |
!contains(github.event.pull_request.labels.*.name, 'docs:examples') &&
!contains(github.event.pull_request.labels.*.name, 'docs:api')
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
env:
BUILD_API: false
BUILD_EXAMPLES: false
run: |
docker exec \
--workdir ${{ env.PYSTK_DIR }} \
${{ env.STK_CONTAINER }} /bin/bash -c \
"export BUILD_API=false BUILD_EXAMPLES=false && tox -e doc"

- name: "Build docs including 'API' and 'Examples' sections"
id: build-doc-full
uses: ansys/actions/doc-build@v5
if: |
contains(github.event.pull_request.labels.*.name, 'docs:examples') &&
contains(github.event.pull_request.labels.*.name, 'docs:api')
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
env:
BUILD_API: true
BUILD_EXAMPLES: true
run: |
docker exec \
--workdir ${{ env.PYSTK_DIR }} \
${{ env.STK_CONTAINER }} /bin/bash -c \
"export BUILD_API=true BUILD_EXAMPLES=true && tox -e doc"

# If required, combine partially rendered documentation with the nightly
# build artifacts. Upload the generated documentation as an artifact in
Expand All @@ -134,15 +165,15 @@ jobs:

- name: "Include 'API' section from nightly build docs"
if: |
steps.build-doc-with-api.outcome == 'success' ||
steps.build-doc-with-examples.outcome == 'success' ||
steps.build-doc-minimum.outcome == 'success'
run: |
cp -r gh-pages/version/dev/api doc/_build/html/api
cp gh-pages/version/dev/index.html doc/_build/html/index.html

- name: "Include 'Examples' section from nightly build docs"
if: |
steps.build-doc-with-examples.outcome == 'success' ||
steps.build-doc-with-api.outcome == 'success' ||
steps.build-doc-minimum.outcome == 'success'
run: |
cp gh-pages/version/dev/examples.html doc/_build/html/examples.html
Expand All @@ -155,6 +186,13 @@ jobs:
path: doc/_build/html
name: full-documentation-html

- name: "Stop the container"
if: always()
run: |
docker stop ${{ env.STK_CONTAINER }}
docker logs ${{ env.STK_CONTAINER }}
docker rm ${{ env.STK_CONTAINER }}

tests:
name: "Tests Python ${{ matrix.python }}"
runs-on: [self-hosted, pystk]
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,10 @@ distributions/

# Backup files
*.bak

# Examples are kept at the root of the repository but copied at documentation
# build time inside the documentation source directory
doc/source/examples/

# Ignore trash generated by Jupyter Notebook
.Trash-1000/
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repos:
# As per this issue https://github.com/pre-commit/pre-commit/issues/2936,
# it looks like the `--all-files` only listens for the `exclude` option in a
# pre-commit hook, ignoring `pyproject.toml` excludes.
exclude: ^(src/ansys/stk/core/internal/|tests/|doc/_build|doc/styles/)
exclude: ^(src/ansys/stk/core/internal/|tests/|doc/_build|doc/styles/|doc/source/_static)
args: [--ignore-words=./doc/styles/Vocab/ANSYS/accept.txt]
# TODO: pre-commit seems to ignore the configuration declared for codespell
# in the `pyproject.toml` file. For more details, see `[tool.codespell]` in
Expand Down
21 changes: 21 additions & 0 deletions doc/source/_static/css/highlight.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@import "../../ansys-sphinx-theme.css";

/* Do not show number cells */
.nbinput .prompt,
.nboutput .prompt {
display: none;
}

/* Center output notebook images */
.nboutput img {
display: block !important;
margin: 0 auto !important;
}

/* Remove the 'snapshot' label in the JupyterWidget snapshots */
.nboutput img + * {
display: none;
}

/* Ensure that text in the code blocks has the desired font-size */
.highlight { font-size: 1rem; background: #f0f0f0 !important; }
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading