Skip to content

Commit

Permalink
Merge pull request #55 from boschresearch/docs-improvements
Browse files Browse the repository at this point in the history
Docs improvements
  • Loading branch information
johannes-mueller authored Dec 12, 2023
2 parents ae9f443 + 8c2af12 commit ab8ae4d
Show file tree
Hide file tree
Showing 20 changed files with 298 additions and 285 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
python -m pip install --upgrade pip
pip install -U setuptools setuptools_scm wheel
pip install -e .[all,docs]
pip install -e ./tools/odbclient
sudo apt-get install pandoc
- name: Build docs
run: sphinx-build -b html docs _build/html
12 changes: 6 additions & 6 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ You need a python installation e.g. a virtual environment with `pip` a recent
(brand new ones might not work) python versions installed. There are several
ways to achieve that.

#### Using anaconda
#### Using miniconda or anaconda

Install anaconda or miniconda [http://anaconda.com] on your computer and create
a virtual environment with the package `pip` installed. See the [conda
Install [miniconda](https://conda.io/miniconda.html) or
[anaconda](http://anaconda.com) on your computer and create a virtual
environment with python installed. See the [conda
documentation](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)
on how to do that. The newly created environment must be activated.

The following command lines should do it
```
conda create -n pylife-env python=3.9 pip --yes
conda create -n pylife-env python=3.11 --yes
conda activate pylife-env
```

Expand All @@ -50,7 +51,6 @@ That installs pyLife with all the dependencies to use pyLife in python
programs. You might want to install some further packages like `jupyter` in
order to work with jupyter notebooks.


There is no conda package as of now, unfortunately.


Expand All @@ -75,7 +75,7 @@ Create an environment – usually a good idea to use a prefixed environment in
your pyLife working directory and activate it.

```
conda create -p .venv python=3.9 pip --yes
conda create -p .venv python=3.11 pip --yes
conda activate ./.venv
```

Expand Down
5 changes: 0 additions & 5 deletions docs/3rd-party-licenses.md

This file was deleted.

5 changes: 5 additions & 0 deletions docs/3rd-party-licenses.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
3rd Party Licenses
==================

.. literalinclude:: ../3rd-party-licenses.txt
:language: text
12 changes: 11 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
vdisplay = Xvfb()
vdisplay.start()

os.environ['PYDEVD_DISABLE_FILE_VALIDATION'] = "1"

ipython_dir = os.path.join(__projectdir__, "_build", "ipythondir")
os.environ['IPYTHONDIR'] = ipython_dir

Expand All @@ -47,10 +49,14 @@
ep.preprocess(nb, {'metadata': {'path': os.path.dirname(fn)}})




# Don't try to use C-code for the pytensor stuff when building the docs.
# Otherwise the demo notebooks fail on readthedocs
os.environ['PYTHONWARNINGS'] = 'ignore'

os.environ["PYVISTA_JUPYTER_BACKEND"] = 'html'

import asyncio

# See https://bugs.python.org/issue37373 :(
Expand Down Expand Up @@ -128,7 +134,11 @@
templates_path = ["_templates"]

# The suffix of source filenames.
source_suffix = [".rst", ".md", ".txt", ".ipynb"]
source_suffix = {
'.rst': 'restructuredtext',
'.txt': 'restructuredtext',
'.md': 'markdown',
}

# The encoding of source files.
# source_encoding = 'utf-8-sig'
Expand Down
1 change: 0 additions & 1 deletion docs/demos/data

This file was deleted.

3 changes: 2 additions & 1 deletion docs/demos/import_mesh_ansys.nblink
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"path": "../../demos/import_mesh_ansys.ipynb"
"path": "../../demos/import_mesh_ansys.ipynb",
"extra-media": ["../../demos/data"]
}
3 changes: 2 additions & 1 deletion docs/demos/import_mesh_vmap.nblink
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"path": "../../demos/import_mesh_vmap.ipynb"
"path": "../../demos/import_mesh_vmap.ipynb",
"extra-media": ["../../demos/data/"]
}
4 changes: 0 additions & 4 deletions docs/demos/stress_strength.nblink

This file was deleted.

10 changes: 5 additions & 5 deletions docs/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ computer, you can use `MyBinder
.. toctree::
:maxdepth: 1

demos/woehler_curve.nblink
demos/load_collective.nblink
demos/stress_strength.nblink
demos/fkm_nonlinear.nblink
demos/fkm_nonlinear_full.nblink
tutorials/woehler_curve.nblink
tutorials/load_collective.nblink
tutorials/stress-strength.rst
tutorials/fkm_nonlinear.nblink
tutorials/fkm_nonlinear_full.nblink
3 changes: 3 additions & 0 deletions docs/tutorials/fkm_nonlinear.nblink
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"path": "../../demos/fkm_nonlinear/fkm_nonlinear.ipynb"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ analysis =

tsfresh =
tsfresh
numpy>=1.23

pymc =
pymc
bambi
numpy<1.26 # https://github.com/pymc-devs/pymc/issues/7043#issuecomment-1837141888

all = %(tsfresh)s %(pymc)s

Expand Down
7 changes: 3 additions & 4 deletions src/pylife/materiallaws/rambgood.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ class RambergOsgood:
Parameters
----------
E : float
Young's Modulus
K : float
The strength coefficient, usually named `K'` or ``K_prime`̀ in FKM nonlinear related formulas.
The strength coefficient, usually named ``K'`` or ``K_prime`` in FKM nonlinear related formulas.
n : float
The strain hardening coefficient, usually named `n'` or ``n_prime`̀ in FKM nonlinear related formulas.
The strain hardening coefficient, usually named ``n'`` or ``n_prime`` in FKM nonlinear related formulas.
Notes
-----
Expand Down Expand Up @@ -156,7 +155,7 @@ def dresiduum(stress):
abs_stress = optimize.newton(
func=residuum,
x0=stress0,
fprime=dresiduum,
fprime=dresiduum,
rtol=rtol, tol=tol
)
return abs_stress * sign_strain
Expand Down
7 changes: 5 additions & 2 deletions src/pylife/mesh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@
__maintainer__ = __author__

from .meshsignal import PlainMesh, Mesh
from .gradient import Gradient
from .gradient import Gradient, Gradient3D
from .hotspot import HotSpot
from .meshmapping import Meshmapper
from .surface import Surface3D

__all__ = [
'PlainMesh',
'Mesh',
'Gradient',
'Gradient3D',
'HotSpot',
'Meshmapper'
'Meshmapper',
'Surface3D'
]
Loading

0 comments on commit ab8ae4d

Please sign in to comment.