Skip to content

Commit

Permalink
Merge pull request #20 from RobinEnjalbert/doc_fix
Browse files Browse the repository at this point in the history
Migrate the documentation page from RTD to GHP.
  • Loading branch information
RobinEnjalbert authored Nov 27, 2024
2 parents 298b0d6 + abe6a68 commit 4ee3295
Show file tree
Hide file tree
Showing 43 changed files with 47 additions and 52 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: documentation

on: [push, pull_request, workflow_dispatch]

permissions:
contents: write

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies
run: |
pip install sphinx sphinx_rtd_theme sphinx-tabs sphinx_copybutton myst_parser numpy torch
- name: Sphinx build
run: |
sphinx-build docs/src docs/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: docs/build/
force_orphan: true
25 changes: 0 additions & 25 deletions .readthedocs.yaml

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## DeepPhysX

![logo](docs/source/_static/image/logo.png)
![logo](docs/src/_static/image/logo.png)

### Interfacing AI with simulation

Expand All @@ -20,7 +20,7 @@ Then other packages are compatible with this **Core** and a specific **simulatio
* Train an artificial neural network with a synthetic dataset;
* Use the predictions of a trained network in a numerical simulation.

The full list of features is detailed in the [**documentation**](https://deepphysx.readthedocs.io).
The full list of features is detailed in the [**documentation**](https://mimesis-inria.github.io/DeepPhysX/).


### Quick install
Expand All @@ -31,7 +31,7 @@ Thus, **DeepPhysX** is mainly designed for these frameworks, but obviously **oth
The packages corresponding to these frameworks will therefore be used for the default installation.

The easiest way to install is using `pip`, but there are a several way to install and configure a **DeepPhysX**
environment (refer to the [**documentation**](https://deepphysx.readthedocs.io/en/latest/presentation/install.html)
environment (refer to the [**documentation**](https://mimesis-inria.github.io/DeepPhysX/)
for further instructions).

``` bash
Expand All @@ -54,7 +54,7 @@ $ DPX --run <demo> # Run one of the demo scripts

| **Armadillo**<br>`DPX -r armadillo` | **Beam**<br>`DPX -r beam` | **Liver**<br>`DPX -r liver` |
|:-----------------------------------------------------:|:-------------------------------------------:|:---------------------------------------------:|
| ![armadillo](docs/source/_static/image/armadillo.png) | ![beam](docs/source/_static/image/beam.png) | ![liver](docs/source/_static/image/liver.png) |
| ![armadillo](docs/src/_static/image/armadillo.png) | ![beam](docs/src/_static/image/beam.png) | ![liver](docs/src/_static/image/liver.png) |


### References
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
SOURCEDIR = src
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
Expand Down
2 changes: 1 addition & 1 deletion docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set SOURCEDIR=src
set BUILDDIR=build

if "%1" == "" goto help
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 4 additions & 11 deletions docs/source/conf.py → docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,10 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.

from os.path import abspath, join, pardir
import os
import sys

# DeepPhysX root
root = abspath(join(abspath(__file__), pardir, pardir, pardir, 'src', 'Core'))
all_modules = ['AsyncSocket', 'Database', 'Environment', 'Manager', 'Network', 'Pipelines', 'Visualization']

# Import all modules
sys.path.append(root)
for module in all_modules:
sys.path.append(join(root, module))
sys.path.insert(0, os.path.abspath('../../src'))

# -- Project information -----------------------------------------------------

Expand Down Expand Up @@ -51,8 +44,8 @@
# Add any paths that contain templates here, relative to this directory.
# templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# List of patterns, relative to src directory, that match files and
# directories to ignore when looking for src files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions examples/demos/Liver/FC/Environment/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def get_nb_nodes(source_file):
"""
Get the number of node of the object.
:param source_file: Filename of the source object
:param source_file: Filename of the src object
:return: Number of node
"""

Expand All @@ -18,7 +18,7 @@ def find_center(source_file, scale):
"""
Find the center of mass of the object.
:param source_file: Filename of the source object
:param source_file: Filename of the src object
:param scale: Scaling to apply to the objects
:return: Center of mass of the object
"""
Expand All @@ -30,8 +30,8 @@ def find_boundaries(source_file, objects_files_list, scale):
"""
Find the boundary conditions of the liver.
:param source_file: Filename of the source object
:param objects_files_list: List of filenames of objects which intersect the source object
:param source_file: Filename of the src object
:param objects_files_list: List of filenames of objects which intersect the src object
:param scale: Scaling to apply to the objects
:return: Boundary box defined by [xmin, ymin, zmin, xmax, ymax, zmax]
"""
Expand Down
2 changes: 1 addition & 1 deletion examples/demos/Liver/UNet/Environment/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def find_center(source_file, scale):
"""
Find the center of mass of the object.
:param source_file: Filename of the source object
:param source_file: Filename of the src object
:param scale: Scaling to apply to the objects
:return: Center of mass of the object
"""
Expand Down
6 changes: 3 additions & 3 deletions src/Core/Utils/Visualizer/barycentric_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class BarycentricMapping:

def __init__(self, source: Mesh, target: Mesh):
"""
Python implementation of a barycentric mapping between a source mesh and a target mesh.
Python implementation of a barycentric mapping between a src mesh and a target mesh.
:param source: Source mesh
:param target: Target mesh
Expand All @@ -23,7 +23,7 @@ def __init__(self, source: Mesh, target: Mesh):

def init_mapping(self):
"""
Compute barycentric coordinates of target to map source.
Compute barycentric coordinates of target to map src.
"""

# 1. CONVERT SOURCE TO VTK
Expand Down Expand Up @@ -84,7 +84,7 @@ def init_mapping(self):

def apply(self, source_positions):
"""
Apply mapping between new source positions and target with barycentric coordinates.
Apply mapping between new src positions and target with barycentric coordinates.
"""

ABC = np.array(source_positions)[np.array(self.source.cells())[self.index]]
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Utils/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def create_dir(session_dir: str, session_name: str) -> str:

def copy_dir(src_dir: str, dest_dir: str, dest_name: Optional[str] = None, sub_folders: Optional[str] = None) -> str:
"""
Copy the source directory to the destination directory.
Copy the src directory to the destination directory.
:param src_dir: Source directory to copy.
:param dest_dir: Parent of the destination directory to copy.
Expand All @@ -103,7 +103,7 @@ def copy_dir(src_dir: str, dest_dir: str, dest_name: Optional[str] = None, sub_f
dest_name += f'{max_id + 1}'

dest = join(dest_dir, dest_name) if dest_name is not None else dest_dir
print(f"Copying the source directory {src_dir} to {dest} for this session.")
print(f"Copying the src directory {src_dir} to {dest} for this session.")
if sub_folders is None:
copytree(src_dir, dest)
else:
Expand Down

0 comments on commit 4ee3295

Please sign in to comment.