Skip to main content

nanodent

License: MIT GitHub Workflow Status codecov Python

Installation

The Python package nanodent can be installed from PyPI:

python -m pip install nanodent

Development installation

If you want to contribute to the development of nanodent, we recommend the following editable installation from this repository:

git clone https://github.com/thomasisensee/nanodent
cd nanodent
python -m pip install --editable .[dev,docs,lint,tests]

Having done so, the test suite can be run using pytest:

python -m pytest

Quick Start

nanodent loads .hld as the canonical source.

from datetime import datetime, timedelta

import matplotlib.pyplot as plt

from nanodent import (
    load_folder,
    plot_experiments,
    plot_group_timeline,
    save_experiment_plots,
)

study = load_folder("path/to/experiment-folder")
filtered_study = study.classify_quality()
filtered_study = filtered_study.analyze_oliver_pharr()
filtered_study = filtered_study.analyze_hertzian()
hardness_rows = filtered_study.scalar_series("hardness")
pop_in_rows = filtered_study.detect_force_peaks().scalar_series("pop_in_load")
radius_rows = filtered_study.scalar_series("hertzian_radius")
tau_rows = filtered_study.scalar_series("tau_max")
manual_groups = filtered_study.group_by_datetime_ranges(
    [
        (
            datetime(2026, 3, 4, 13, 0, 0),
            datetime(2026, 3, 4, 15, 0, 0),
        ),
    ]
)

timeline_fig, timeline_ax = plot_group_timeline(
    filtered_study,
    max_gap=timedelta(minutes=30),
)

fig, ax = plt.subplots()
plot_experiments(
    ax,
    filtered_study,
    fit_kwargs={"color": "gray", "linestyle": "solid", "linewidth": 2},
    zero_onset=False,
    cmap="rainbow",
)

ax.set_xlabel("Displacement h / nm")
ax.set_ylabel("Force P / μN")

saved = save_experiment_plots(
    filtered_study, "plots/", zero_onset=False
)

filtered_study.save_session("analysis-session.pkl")
resumed_study = load_folder("path/to/experiment-folder").load_session(
    "analysis-session.pkl"
)

Study.classify_quality() keeps all experiments loaded but marks heuristically bad runs as enabled=False with a short disabled_reason, currently including gradual_onset, flat_force, and local-jump outliers such as outlier_disp or outlier_force. Grouping and plotting ignore disabled experiments by default; group summaries include them by default so quality decisions stay visible. Pass include_disabled=True when you want disabled runs included in plots or grouping output. plot_experiments(...) and save_experiment_plots(...) always visualize the test force-displacement curve.

The public API also exposes:

  • load_experiment(path) -> Experiment
  • load_folder(path) -> Study
  • Study.analyze_oliver_pharr(...) -> Study
  • Study.analyze_hertzian(...) -> Study
  • Study.scalar_series(...) -> list[dict[str, Any]]
  • Study.save_session(path) -> Path
  • Study.load_session(path) -> Study
  • Study.group_by_datetime_ranges(...) -> list[ExperimentGroup]
  • Study.group_by_time_gap(...) -> list[ExperimentGroup]
  • plot_group_timeline(...) -> tuple[Figure, Axes]
  • plot_experiments(...) -> Axes
  • save_experiment_plots(...) -> list[Path]

Demo notebook

Use the demo notebook to test the functionality of nanodent and see how it can be used to analyze and visualize nanoindentation experiments.

Acknowledgments

This repository was set up using the SSC Cookiecutter for Python Packages.

Release files for nanodent 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nanodent 0.1.0
File Size Uploaded
nanodent-0.1.0.tar.gz 507.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nanodent 0.1.0
File Interpreter ABI Platform
nanodent-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 556.5 kB

Release files / nanodent-0.1.0.tar.gz

Download URL nanodent-0.1.0.tar.gz
Size 507.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fe846399961d3457d627d00aa81270b5c2590d9fc4fb0d3535affd2ea3d89d63
BLAKE2b-256 checksum
How to use checksums
292eef0fba017037b7ad3cef510b2daa041caae585e06e57668a54a51c4cbec9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / nanodent-0.1.0-py3-none-any.whl

Download URL nanodent-0.1.0-py3-none-any.whl
Size 49.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
358df9d0db9bb385f950cc1370cc1b934f840fa6c891c50524a7a7a8f610c83b
BLAKE2b-256 checksum
How to use checksums
6b8e6a541ff4d7aa07d41272f0d3f51ced8714a21a8eafe7265a4d2104b3c06a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page