Commit 358a29c3 authored by Charleux Ludovic's avatar Charleux Ludovic 💬
Browse files

Update Dockerfile and documentation for improved setup and clarity

- Added additional Python packages to Dockerfile for enhanced functionality.
- Updated devcontainer.json to include the Live Server extension.
- Revised post_processing.ipynb title for clarity.
- Added "project" section to index.rst for better navigation.
- Created project.md to provide an overview of IndenToolBox.
- Expanded setup.md with detailed installation instructions for VSCode and Git.
- Updated tutorials.md to correct file references for better user guidance.
parent b564f517
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ COPY environment.yml /tmp/environment.yml
RUN umask 0000 && ${MAMBA_BIN_PATH} create -y -n ${CONDA_ENV_NAME}
RUN umask 0000 && ${MAMBA_BIN_PATH} env update --file /tmp/environment.yml
RUN umask 0000 && /opt/conda/envs/${CONDA_ENV_NAME}/bin/pip  install jupyterlab matplotlib ipywidgets notebook jupyterlab-git jupyterlab-code-formatter
RUN umask 0000 && /opt/conda/envs/${CONDA_ENV_NAME}/bin/pip install nbsphinx sphinx_copybutton sphinxcontrib-bibtex
RUN umask 0000 && /opt/conda/envs/${CONDA_ENV_NAME}/bin/pip install nbsphinx sphinx_copybutton sphinxcontrib-bibtex myst_nb sphinx_rtd_theme


COPY postCreateCommand.sh /tmp/postCreateCommand.sh
+2 −1
Original line number Diff line number Diff line
@@ -28,7 +28,8 @@
                "ms-python.pylint",
                "mhutchie.git-graph",
                "mechatroner.rainbow-csv",
                "openai.chatgpt"
                "openai.chatgpt",
                "ms-vscode.live-server"
            ]
        }
    },
+1 −1
Original line number Diff line number Diff line
%% Cell type:markdown id:3ef34832-7e33-4e8f-8e63-5407a120bf7b tags:

# Basic postprocessing
# Basic postprocessing with IndenToolBox

In this example, we'll look at tests carried out on fused quartz samples and measure their modulus.

**Important**: run the `pre_processing.ipynb` file before.

%% Cell type:code id:404d4a5c-2c85-46d2-8740-4680eb7205e3 tags:

``` python
%matplotlib widget
import indentoolbox as itb
import ipywidgets as widgets
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

pd.options.display.float_format = "{:.5e}".format
```

%% Cell type:markdown id:ca08c0b8-f2c6-44ed-b8d6-cad0469fda3b tags:

## Setup

%% Cell type:code id:b4d55889-f973-4554-bd86-47355e301285 tags:

``` python
root_path = "./my_batch"
batch = itb.core.Batch.load(root_path)
batch
```

%% Cell type:markdown id:5005aeab-7544-434c-b4a2-e49ab78391d9 tags:

## First look at the data

%% Cell type:code id:1ad6290e-b6b3-4e9d-ae76-8ce307c46275 tags:

``` python
# THE TIP
batch.tip
```

%% Cell type:code id:d664aa2f-a27c-4b97-90fa-1718b50cae05 tags:

``` python
# TEST DATA
print(batch.tests[0].data)
```

%% Cell type:markdown id:88e3a978-f06b-44d1-a580-c93eb6ac8ef2 tags:

## Basic Plots

%% Cell type:code id:ad7e70c3-15dc-442e-8cd9-8ad09988dedd tags:

``` python
plot_reject = False
colors = "rgb"
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
tests = batch.tests
Ntests = len(tests)
for Nt in range(Ntests):
    test = tests[Nt]
    if plot_reject == False and test.reject == False:
        test_data = test.data
        test_structure = [step.kind() for step in test.steps]
        for step_id, step_data in test_data.groupby("step"):
            ax.plot(
                step_data.disp * 1.0e9,
                step_data.force * 1.0e6,
                "-",
                lw=1.0,
                color=colors[step_id%len(colors)],
            )


ax.grid()
ax.set_xlabel("Displacement, $h$ [nm]")
ax.set_ylabel("Force, $P$ [µN]")
#plt.savefig("experimental_batch.png")
plt.show()

print(test_structure)
```

%% Cell type:markdown id:d02ba248-ce66-4a13-b817-85ce677b674e tags:

## Post-processing

In this section, we post-process our tests to extract basic data from the various steps. Indentoolbox can be used to collectively process one step of data from all trials and export the result as a dataframe. This is a powerful feature for batch processing, as is often the case with indentation.

First, we focus on the parabolic loading step:

%% Cell type:code id:a4e1546e-e9b3-4952-bcaa-c0cf275eef8f tags:

``` python
loading_data = batch.collect_steps(0).parabolic_fit(displim = 50.e-9, htrunc = batch.tip.htrunc)
loading_data.index = loading_data.index.droplevel(1)
```

%% Cell type:markdown id:f443ece1-065c-490e-9abe-321dc44ce0ce tags:

We then turn our attention to the unloading step:

%% Cell type:code id:0113b01c-1a5e-4d68-a7a6-3f698db5b69e tags:

``` python
unloading_data = batch.collect_steps(2).unloading_fit()
unloading_data.index = unloading_data.index.droplevel(1)
print(unloading_data)
```

%% Cell type:markdown id:3884af20-da48-4c67-aec7-1fd9b947f9fc tags:

And we apply the method of Oliver and Pharr to deduce the indentation modulus and then the Young's modulus.

%% Cell type:code id:7db18f0c-9b18-433e-b09b-deab242e5011 tags:

``` python
OP = itb.processing.OliverPharr(data = unloading_data, tip = batch.tip)
print(OP)
```

%% Cell type:code id:c02a3325-e18f-472f-832d-5f5a1a52a505 tags:

``` python
nu_samp = 0.17
```

%% Cell type:code id:b9d437f3-16c9-41e8-871e-0a92df23b3a1 tags:

``` python
OP["Esamp"] = OP.Eeqsamp * (1. - nu_samp**2)
print(OP)
```

%% Cell type:markdown id:13520e87-2535-4d27-a0ea-70e8e80e77d2 tags:

## Reverse analysis

In this section, we use several inverse analysis algorithms to retrieve the mechanical properties of the material under study. As this material is fused quartz, these methods are unsuitable for crystalline metals. See it as a demonstration, but disregard the results.

%% Cell type:code id:ba1156d4-3c90-4cac-b0a4-b9e43d3e1b51 tags:

``` python
test_id = 0
C = loading_data.loc[test_id, "C"]
S = unloading_data.loc[test_id, "S"]
hm = unloading_data.loc[test_id, "hm"]
Pm = loading_data.loc[test_id, "Pm"]
hf = unloading_data.loc[test_id, "hf"]
E_ind = batch.tip.young_modulus
nu_ind = batch.tip.poisson_coefficient
Wrev = unloading_data.loc[test_id, "W"]
Wtot = loading_data.loc[test_id, "W"]
Wirr = Wtot + Wrev
Wfrac = Wirr/Wtot
#Wfrac = 0.9
```

%% Cell type:code id:8a0ac424-c1fe-45b2-bedd-7a872cbceca1 tags:

``` python
gian99 = pd.DataFrame(itb.processing.GIAN99(hm = hm, hf = hf, S = S, C = C, nu = nu_samp, E_ind = E_ind, nu_ind = nu_ind))
print(gian99)
```

%% Cell type:code id:6ffd3513-9752-46d8-9ff4-0ab71ae8ed7a tags:

``` python
dao01 = pd.DataFrame(itb.processing.DAO01(S=S,C=C,Pm=Pm,Wfrac=Wfrac,hm=hm,hf=hf))
print(dao01)
```

%% Cell type:code id:43652db4-1336-4171-85e7-02f872fa4e18 tags:

``` python
casals05 = pd.DataFrame(itb.processing.CASA05(hm=hm, hf=hf, Pm=Pm, S=S, C=C))
print(casals05)
```

%% Cell type:code id:09e5eeba-6f3d-4b50-a30a-b779964b1457 tags:

``` python
```

%% Cell type:code id:e78e926a-a5b7-4288-b152-47e3f3addff4 tags:

``` python
```
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ Get started
   setup
   tutorials
   reference
   project

Indices and tables
==================

docs/source/project.md

0 → 100644
+56 −0
Original line number Diff line number Diff line
# About the Project

Indentation Toolbox (`indentoolbox`) is an open‑source Python toolkit for post‑processing instrumented indentation tests (nano/micro‑indentation). It provides a consistent data model, vendor‑agnostic readers, analysis routines, and plotting helpers so you can go from raw files to clean, reproducible results quickly.

Smart indentation testing post‑processing with Python.

## Goals

- Reproducible workflows: standardize units, metadata, and project structure.
- Vendor‑agnostic ingestion: read common exports (e.g., Hysitron/TI, XP DCMII) into a unified format.
- Robust analysis: compute key quantities (work, hardness, indentation modulus) with transparent methods.
- Educational material: serve as hands‑on support for workshops and courses on indentation testing.

## History

The project started in 2023 to support a tutorial delivered at the French national workshop [Indentation 2023](https://indentation2023.sciencesconf.org/) in Tours. Since then, the toolbox and its tutorials have continued to evolve and are used as teaching material for subsequent events (e.g., [Indentation 2025](https://indentation2025.sciencesconf.org/) in Besançon).

## What you can do with indentoolbox

- Structured data model: `Test`, `Step`, and `Batch` objects, plus `Device`, `Operator`, `Sample` metadata for reproducible analyses.
- Tip models: spheroconical and pyramidal tips with contact area functions; read `.ara` files to build tip objects.
- File readers: load data from Hysitron/TI (including nanoDMA AVG), XP DCMII Excel exports, and folder‑based projects with TOML metadata.
- Processing routines: compliance correction, work of indentation, parabolic and unloading fits, indentation modulus and hardness calculations, averaging across repeated indents, thin‑film utilities.
- Plotting helpers: quick plots of hardness and indentation modulus versus displacement for inspection and reporting.
- Jupyter‑first workflow: explore data and iterate interactively; optional lightweight widgets are available for simple data selection tasks.
- CLI starter: an `indentoolbox init` command scaffolds a basic project structure.

## Who is it for?

- Researchers and engineers in materials science and mechanics working with instrumented indentation.
- Students and workshop attendees who need a clear, hands‑on introduction with reproducible notebooks.
- Labs looking to standardize post‑processing across instruments and teams.

## Design choices

- Consistent SI units: readers convert common vendor exports to SI (e.g., force in N, displacement in m).
- Transparent data structures: container classes serialize to/from TOML/CSV for portability and archiving.
- Extensible architecture: add new tip types, readers, and processing steps without rewriting the core.

```{note}
Current tip support focuses on spheroconical and pyramidal geometries. Additional tip types can be added; contributions are welcome.
```

## Team and credits

- Ludovic Charleux — lead developer
- Emile Roux — co‑developer
- Christian Elmo — co‑developer
- Alessandro Benetto — co‑developer

## Learn more

- Setup and installation: see `docs/source/setup.md`.
- Examples and notebooks: explore the `examples/` folder.
- Workshop lineage: tutorials originated at [Indentation 2023](https://indentation2023.sciencesconf.org/), [Indentation 2025](https://indentation2025.sciencesconf.org/).
- License: GPL‑2.0 (see `LICENSE`).
Loading