Skip to content

Commit

Permalink
Merge pull request #1 from DataAnalyticsEngineering/update-documentation
Browse files Browse the repository at this point in the history
Update documentation
  • Loading branch information
juliusgh authored May 14, 2024
2 parents a1c321c + c65c9a5 commit 93e31a8
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 39 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,17 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install pandoc
#uses: docker://pandoc/core:2.9
run: |
sudo apt update
sudo apt install pandoc -y
- name: Install thermontfa
run: pip install .[dev]
- name: Build documentation
run: |
cd docs
make html
TZ=UTC make html
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"sphinx.ext.autosectionlabel",
"nbsphinx",
"sphinx_gallery.load_style",
"nbsphinx_link",
]
myst_enable_extensions = ["dollarmath", "amsmath"]
nbsphinx_allow_errors = True
autodoc_member_order = "bysource"

templates_path = ["_templates"]
exclude_patterns = ["build", "Thumbs.db", ".DS_Store"]
Expand Down
14 changes: 7 additions & 7 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ Examples
--------

.. nbgallery::
examples/material_parameters.nblink
examples/truncate_ntfa_modes.nblink
examples/paper_plots.nblink
examples/generate_inputs.nblink
examples/generate_plots.nblink
examples/NTFA_thermo_paper.nblink
examples/thermoNTFA_example.nblink
examples/material_parameters
examples/truncate_ntfa_modes
examples/paper_plots
examples/generate_inputs
examples/generate_plots
examples/NTFA_thermo_paper
examples/thermoNTFA_example
8 changes: 4 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ TODO: abstract
:maxdepth: 2
:caption: Contents:

Workflow<workflow>
Installation<installation>
ThermoNTFA Documentation<api>
Examples<examples>
workflow
installation
api
examples
MarkdownLinks/license
MarkdownLinks/citation
MarkdownLinks/changelog
Expand Down
36 changes: 25 additions & 11 deletions examples/paper_plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@
"> Felix Fritzen is funded by the German Research Foundation (DFG) --\n",
"> 390740016 (EXC-2075); 406068690 (FR2702/8-1); 517847245 (FR2702/10-1).\n",
"\n",
"## Mode study\n",
"## Training reproduction tests\n",
"## Random loading\n",
"## Stress-driven simulation\n",
"## Twoscale simulation"
"## Imports:"
]
},
{
Expand Down Expand Up @@ -80,6 +76,18 @@
" )"
]
},
{
"cell_type": "markdown",
"id": "bd108d2a",
"metadata": {},
"source": [
"## Mode study\n",
"## Training reproduction tests\n",
"## Random loading\n",
"## Stress-driven simulation\n",
"## Twoscale simulation"
]
},
{
"cell_type": "markdown",
"id": "9ef6456e",
Expand Down Expand Up @@ -785,6 +793,18 @@
" GG.create_dataset(\"xi\", data=xi)"
]
},
{
"cell_type": "markdown",
"id": "46edb92e",
"metadata": {},
"source": [
"1. set the stress to 0\n",
"2. ramp the temperature from 293K\n",
"3. check for q >= q_crit_0, q_crit_1, ...\n",
" e.g. q_crit_0 = 0.002 (i.e. 0.2%)\n",
"4. draw the results of theta"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -794,12 +814,6 @@
},
"outputs": [],
"source": [
"# 1. set the stress to 0\n",
"# 2. ramp the temperature from 293K\n",
"# 3. check for q >= q_crit_0, q_crit_1, ...\n",
"# e.g. q_crit_0 = 0.002 (i.e. 0.2%)\n",
"# draw the results of theta\n",
"\n",
"n_ramp = 1300 - 293 + 1\n",
"with h5py.File(\"ms9p_thermal_rampup.h5\", \"w\") as F:\n",
" eps_idx = None\n",
Expand Down
18 changes: 11 additions & 7 deletions examples/paper_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@
# > Felix Fritzen is funded by the German Research Foundation (DFG) --
# > 390740016 (EXC-2075); 406068690 (FR2702/8-1); 517847245 (FR2702/10-1).
#
# ## Mode study
# ## Training reproduction tests
# ## Random loading
# ## Stress-driven simulation
# ## Twoscale simulation
# ## Imports:

# %%
import os
Expand Down Expand Up @@ -83,6 +79,13 @@ def rel_error(A, A_ref, r_min=None):
)


# %% [markdown]
# ## Mode study
# ## Training reproduction tests
# ## Random loading
# ## Stress-driven simulation
# ## Twoscale simulation

# %% [markdown]
# **Load the NTFA data**

Expand Down Expand Up @@ -612,13 +615,14 @@ def rel_error(A, A_ref, r_min=None):
GG.create_dataset("xi", data=xi)


# %% Figuring when palsticity kicks in using the mixed UMAT
# %% [markdown]
# 1. set the stress to 0
# 2. ramp the temperature from 293K
# 3. check for q >= q_crit_0, q_crit_1, ...
# e.g. q_crit_0 = 0.002 (i.e. 0.2%)
# draw the results of theta
# 4. draw the results of theta

# %% Figuring when palsticity kicks in using the mixed UMAT
n_ramp = 1300 - 293 + 1
with h5py.File("ms9p_thermal_rampup.h5", "w") as F:
eps_idx = None
Expand Down
14 changes: 8 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ dependencies = [

[project.optional-dependencies]
dev = [
'jupytext~=1.16.1',
'jupyterlab~=4.1.8',
'pre_commit~=3.7.0',
'pytest',
'jupyterlab~=4.2.0',
'jupytext~=1.16.2',
'pre-commit~=3.7.1',
'pytest~=8.2.0',
'sphinx',
'myst_parser',
'sphinx_rtd_theme'
'myst-parser~=3.0.1',
'nbsphinx~=0.9.4',
'sphinx-gallery~=0.16.0',
'sphinx-rtd-theme~=2.0.0'
]

[tool.flake8]
Expand Down
2 changes: 1 addition & 1 deletion thermontfa/tabular_interpolation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Tabular interpolation for the NTFA
Tabular interpolation for the thermo-mechanical NTFA
(c) 2024,
Felix Fritzen <fritzen@simtech.uni-stuttgart.de>,
Expand Down
13 changes: 12 additions & 1 deletion thermontfa/thermoNTFA.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
390740016 (EXC-2075); 406068690 (FR2702/8-1); 517847245 (FR2702/10-1).
"""

from typing import Callable, Optional, Tuple
from typing import Callable, Optional, Tuple, List

import h5py
import numpy as np
Expand All @@ -39,6 +39,17 @@ class ThermoMechNTFA:
"""

# TODO: Document properties
file_name: str
group_name: str
sig_y: Callable[[float, float, bool], float]
tol: float
verbose: bool = False
A_bar: TabularInterpolation
C_bar: TabularInterpolation
D_xi: TabularInterpolation
tau_theta: TabularInterpolation
tau_xi: TabularInterpolation
sig_phases: List

def __init__(
self,
Expand Down

0 comments on commit 93e31a8

Please sign in to comment.