Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusgh committed May 14, 2024
1 parent d05e1ad commit 698df7a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE.md)
[![Python](https://img.shields.io/badge/python-3.11-purple.svg)](https://www.python.org/)
![PyPI](https://img.shields.io/pypi/v/thermontfa)
[![PyPI](https://img.shields.io/pypi/v/thermontfa)](https://test.pypi.org/project/thermontfa/)


This repository contains a material routine written in *Python* for the thermo-elasto-plastic Nonuniform Transformation Field Analysis (**ThermoNTFA**) published in ...
Expand All @@ -15,9 +15,9 @@ TODO: abstract

## Documentation

TODO: deployment of documentation on Github
TODO: deployment of documentation via DAE Github organization

The documentation of this software, including examples on how to use **ThermoNTFA**, can be found under [Documentation](https://DataAnalyticsEngineering.github.io/ThermoNTFA/).
The documentation of this software, including examples on how to use **ThermoNTFA**, can be found under [Documentation](https://juliusgh.github.io/ThermoNTFA).<!--(https://DataAnalyticsEngineering.github.io/ThermoNTFA/).-->

## Features

Expand Down
3 changes: 3 additions & 0 deletions data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ThermoNTFA - Data

TODO: write documentation about data sets and how to obtain these
2 changes: 2 additions & 0 deletions data/results/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
Empty file removed data/results/.gitkeep
Empty file.
28 changes: 14 additions & 14 deletions thermontfa/tabular_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class TabularInterpolation:
Tabular interpolation for the thermo-mechanical NTFA
Performs a linear interpolation of the NTFA system matrices for a given temperature
given tabular data for sufficiently many temperature points.
It can be initialized for given data or based on a HDF5 file.
given tabular data at sufficiently many temperature points.
It can be initialized with given tabular data or based on a HDF5 file (:code:`*.h5`).
"""

temp_min: float = 0.0
Expand All @@ -48,12 +48,12 @@ def __init__(
const_extrapolate: bool = False,
) -> None:
"""
Initialize the tabular interpolator for given `data` at prescribed temperatures `temps`.
Initialize the tabular interpolator for given :code:`data` at prescribed temperatures :code:`temps`.
:param temps: temperature points on which tabular data is available.
The shape of the `numpy` array is expected to be `(N_t,)`.
The shape of the :code:`numpy` array is expected to be :code:`(N_t,)`.
:type temps: np.ndarray
:param data: tabular data, e.g., a batch of NTFA system matrices with shape `(N_t, ...)`.
:param data: tabular data, e.g., a batch of NTFA system matrices with shape :code:`(N_t, ...)`.
:type data: np.ndarray
:param const_extrapolate: If true, a constant extrapolation instead of a linear extrapolation is performed.
The default value is false.
Expand Down Expand Up @@ -92,16 +92,16 @@ def from_h5(
const_extrapolate: bool = False,
) -> Self:
"""
Initialize the tabular interpolator based on tabular data stored in a HDF5 file (*.h5).
Initialize the tabular interpolator based on tabular data stored in a HDF5 file (:code:`*.h5`).
This is a factory method and returns a new instance of the `TabularInterpolation` class.
It is expected that the HDF5 file contains a data set with path `dset_temps` that contains
This is a factory method and returns a new instance of the :code:`TabularInterpolation` class.
It is expected that the HDF5 file contains a data set with path :code:`dset_temps` that contains
a list of the temperature points on which tabular data is available. The shape of this
dataset is expected to be `(N_t,)`.
Additionaly, the HDF5 file must contain a data set with path `dset_data` that contains the
tabular data, e.g., a batch of NTFA system matrices with shape `(N_t, ...)`.
dataset is expected to be :code:`(N_t,)`.
Additionaly, the HDF5 file must contain a data set with path :code:`dset_data` that contains the
tabular data, e.g., a batch of NTFA system matrices with shape :code:`(N_t, ...)`.
The order of axes/dimensions of the data set with path `dset_data` can be changed by transposing
to the axis order given in `transpose_dims`.
to the axis order given in :code:`transpose_dims`.
:param file_name: path of the HDF5 file
:type file_name: str
Expand All @@ -113,7 +113,7 @@ def from_h5(
:type const_extrapolate: bool
:param transpose_dims: axis order for transposition
:type transpose_dims: Tuple[int, ...], optional
:return: new instance of the `TabularInterpolation` class
:return: new instance of the :code:`TabularInterpolation` class
:rtype: TabularInterpolation
"""
with h5py.File(file_name, "r") as file:
Expand All @@ -128,7 +128,7 @@ def from_h5(

def interpolate(self, temp: float) -> np.ndarray:
"""
Perform a linear interpolation based on the available tabular data at a given temperature `temp`
Perform a linear interpolation based on the available tabular data at a given temperature :code:`temp`
:param temp: temperature point for interpolation
:type temp: float
Expand Down

0 comments on commit 698df7a

Please sign in to comment.