playNano 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. playnano-0.1.0/.flake8 +6 -0
  2. playnano-0.1.0/.gitattributes +10 -0
  3. playnano-0.1.0/.github/workflows/docs.yaml +39 -0
  4. playnano-0.1.0/.github/workflows/pre-commit.yaml +48 -0
  5. playnano-0.1.0/.github/workflows/test.yaml +54 -0
  6. playnano-0.1.0/.gitignore +45 -0
  7. playnano-0.1.0/.markdownlint.yaml +8 -0
  8. playnano-0.1.0/.pre-commit-config.yaml +50 -0
  9. playnano-0.1.0/CHANGELOG.md +74 -0
  10. playnano-0.1.0/COPYING +674 -0
  11. playnano-0.1.0/PKG-INFO +238 -0
  12. playnano-0.1.0/README.md +185 -0
  13. playnano-0.1.0/docs/Makefile +20 -0
  14. playnano-0.1.0/docs/_generated/generated_module_list.rst +7 -0
  15. playnano-0.1.0/docs/analysis.rst +243 -0
  16. playnano-0.1.0/docs/api/modules.rst +7 -0
  17. playnano-0.1.0/docs/api/playNano.analysis.modules.rst +69 -0
  18. playnano-0.1.0/docs/api/playNano.analysis.rst +46 -0
  19. playnano-0.1.0/docs/api/playNano.analysis.utils.rst +37 -0
  20. playnano-0.1.0/docs/api/playNano.cli.rst +45 -0
  21. playnano-0.1.0/docs/api/playNano.gui.rst +37 -0
  22. playnano-0.1.0/docs/api/playNano.gui.widgets.rst +29 -0
  23. playnano-0.1.0/docs/api/playNano.io.formats.rst +45 -0
  24. playnano-0.1.0/docs/api/playNano.io.rst +53 -0
  25. playnano-0.1.0/docs/api/playNano.processing.rst +61 -0
  26. playnano-0.1.0/docs/api/playNano.rst +41 -0
  27. playnano-0.1.0/docs/changelog.rst +5 -0
  28. playnano-0.1.0/docs/cli.rst +247 -0
  29. playnano-0.1.0/docs/conf.py +95 -0
  30. playnano-0.1.0/docs/custom_analysis_modules.rst +119 -0
  31. playnano-0.1.0/docs/gui.rst +163 -0
  32. playnano-0.1.0/docs/images/GUI_window.png +0 -0
  33. playnano-0.1.0/docs/index.rst +82 -0
  34. playnano-0.1.0/docs/installation.rst +162 -0
  35. playnano-0.1.0/docs/make.bat +35 -0
  36. playnano-0.1.0/docs/notebooks.rst +41 -0
  37. playnano-0.1.0/docs/processing.rst +289 -0
  38. playnano-0.1.0/docs/quickstart.rst +95 -0
  39. playnano-0.1.0/docs/whats_new/index.md +9 -0
  40. playnano-0.1.0/docs/whats_new/v0.1.0.md +52 -0
  41. playnano-0.1.0/enviroment.yaml +21 -0
  42. playnano-0.1.0/notebooks/playnano_demo_notebook.ipynb +522 -0
  43. playnano-0.1.0/notebooks/processing_demo.ipynb +444 -0
  44. playnano-0.1.0/pyproject.toml +147 -0
  45. playnano-0.1.0/src/playNano/__init__.py +11 -0
  46. playnano-0.1.0/src/playNano/_version.py +34 -0
  47. playnano-0.1.0/src/playNano/afm_stack.py +821 -0
  48. playnano-0.1.0/src/playNano/analysis/__init__.py +30 -0
  49. playnano-0.1.0/src/playNano/analysis/base.py +61 -0
  50. playnano-0.1.0/src/playNano/analysis/export.py +35 -0
  51. playnano-0.1.0/src/playNano/analysis/modules/__init__.py +20 -0
  52. playnano-0.1.0/src/playNano/analysis/modules/count_nonzero.py +62 -0
  53. playnano-0.1.0/src/playNano/analysis/modules/dbscan_clustering.py +233 -0
  54. playnano-0.1.0/src/playNano/analysis/modules/feature_detection.py +332 -0
  55. playnano-0.1.0/src/playNano/analysis/modules/k_means_clustering.py +255 -0
  56. playnano-0.1.0/src/playNano/analysis/modules/log_blob_detection.py +142 -0
  57. playnano-0.1.0/src/playNano/analysis/modules/particle_tracking.py +204 -0
  58. playnano-0.1.0/src/playNano/analysis/modules/x_means_clustering.py +390 -0
  59. playnano-0.1.0/src/playNano/analysis/pipeline.py +382 -0
  60. playnano-0.1.0/src/playNano/analysis/utils/__init__.py +1 -0
  61. playnano-0.1.0/src/playNano/analysis/utils/common.py +270 -0
  62. playnano-0.1.0/src/playNano/analysis/utils/frames.py +90 -0
  63. playnano-0.1.0/src/playNano/analysis/utils/particles.py +189 -0
  64. playnano-0.1.0/src/playNano/cli/__init__.py +1 -0
  65. playnano-0.1.0/src/playNano/cli/actions.py +1234 -0
  66. playnano-0.1.0/src/playNano/cli/entrypoint.py +302 -0
  67. playnano-0.1.0/src/playNano/cli/handlers.py +174 -0
  68. playnano-0.1.0/src/playNano/cli/utils.py +633 -0
  69. playnano-0.1.0/src/playNano/errors.py +7 -0
  70. playnano-0.1.0/src/playNano/fonts/Steps-Mono/COPYRIGHT.txt +2 -0
  71. playnano-0.1.0/src/playNano/fonts/Steps-Mono/FONTLOG.md +57 -0
  72. playnano-0.1.0/src/playNano/fonts/Steps-Mono/LICENSE.txt +106 -0
  73. playnano-0.1.0/src/playNano/fonts/Steps-Mono/README.md +38 -0
  74. playnano-0.1.0/src/playNano/fonts/Steps-Mono/Steps-Mono-Thin.otf +0 -0
  75. playnano-0.1.0/src/playNano/fonts/Steps-Mono/Steps-Mono.otf +0 -0
  76. playnano-0.1.0/src/playNano/fonts/basic/FONTLOG.txt +92 -0
  77. playnano-0.1.0/src/playNano/fonts/basic/LICENSE.txt +93 -0
  78. playnano-0.1.0/src/playNano/fonts/basic/README.md +10 -0
  79. playnano-0.1.0/src/playNano/fonts/basic/basic_regular.ttf +0 -0
  80. playnano-0.1.0/src/playNano/gui/__init__.py +1 -0
  81. playnano-0.1.0/src/playNano/gui/main.py +72 -0
  82. playnano-0.1.0/src/playNano/gui/styles/dark_bluegreen.qss +119 -0
  83. playnano-0.1.0/src/playNano/gui/widgets/__init__.py +1 -0
  84. playnano-0.1.0/src/playNano/gui/widgets/controls.py +46 -0
  85. playnano-0.1.0/src/playNano/gui/widgets/viewer.py +237 -0
  86. playnano-0.1.0/src/playNano/gui/window.py +1122 -0
  87. playnano-0.1.0/src/playNano/io/__init__.py +1 -0
  88. playnano-0.1.0/src/playNano/io/data_loaders.py +351 -0
  89. playnano-0.1.0/src/playNano/io/export_data.py +366 -0
  90. playnano-0.1.0/src/playNano/io/formats/__init__.py +1 -0
  91. playnano-0.1.0/src/playNano/io/formats/read_asd.py +91 -0
  92. playnano-0.1.0/src/playNano/io/formats/read_h5jpk.py +430 -0
  93. playnano-0.1.0/src/playNano/io/formats/read_jpk_folder.py +115 -0
  94. playnano-0.1.0/src/playNano/io/formats/read_spm_folder.py +137 -0
  95. playnano-0.1.0/src/playNano/io/gif_export.py +268 -0
  96. playnano-0.1.0/src/playNano/io/loader.py +186 -0
  97. playnano-0.1.0/src/playNano/processing/__init__.py +1 -0
  98. playnano-0.1.0/src/playNano/processing/core.py +34 -0
  99. playnano-0.1.0/src/playNano/processing/filters.py +194 -0
  100. playnano-0.1.0/src/playNano/processing/mask_generators.py +65 -0
  101. playnano-0.1.0/src/playNano/processing/masked_filters.py +192 -0
  102. playnano-0.1.0/src/playNano/processing/pipeline.py +350 -0
  103. playnano-0.1.0/src/playNano/processing/versioning.py +18 -0
  104. playnano-0.1.0/src/playNano/utils/constants.py +13 -0
  105. playnano-0.1.0/src/playNano/utils/io_utils.py +284 -0
  106. playnano-0.1.0/src/playNano/utils/system_info.py +39 -0
  107. playnano-0.1.0/src/playNano/utils/time_utils.py +160 -0
  108. playnano-0.1.0/tests/conftest.py +106 -0
  109. playnano-0.1.0/tests/resources/asd_sample_0.asd +0 -0
  110. playnano-0.1.0/tests/resources/jpk_folder_0/jpk_sample _1.jpk +0 -0
  111. playnano-0.1.0/tests/resources/jpk_folder_0/jpk_sample_0.jpk +0 -0
  112. playnano-0.1.0/tests/resources/jpk_folder_0/jpk_sample_2.jpk +0 -0
  113. playnano-0.1.0/tests/resources/sample_0.h5-jpk +0 -0
  114. playnano-0.1.0/tests/resources/spm_folder_0/000.102 +3108 -20
  115. playnano-0.1.0/tests/resources/spm_folder_0/000.103 +3979 -354
  116. playnano-0.1.0/tests/resources/spm_folder_0/000.104 +2487 -0
  117. playnano-0.1.0/tests/resources/spm_folder_0/000.105 +4299 -8
  118. playnano-0.1.0/tests/test_analysis.py +83 -0
  119. playnano-0.1.0/tests/test_analysis_modules.py +1825 -0
  120. playnano-0.1.0/tests/test_analysis_pipeline.py +343 -0
  121. playnano-0.1.0/tests/test_analysis_utils.py +336 -0
  122. playnano-0.1.0/tests/test_cli.py +1928 -0
  123. playnano-0.1.0/tests/test_filters.py +442 -0
  124. playnano-0.1.0/tests/test_formats.py +677 -0
  125. playnano-0.1.0/tests/test_gui.py +975 -0
  126. playnano-0.1.0/tests/test_io.py +1254 -0
  127. playnano-0.1.0/tests/test_main.py +342 -0
  128. playnano-0.1.0/tests/test_processing.py +64 -0
  129. playnano-0.1.0/tests/test_processing_pipeline.py +587 -0
  130. playnano-0.1.0/tests/test_stack.py +1015 -0
  131. playnano-0.1.0/tests/test_utils.py +220 -0
playnano-0.1.0/.flake8 ADDED
@@ -0,0 +1,6 @@
1
+ # .flake8
2
+ [flake8]
3
+ extend-ignore = D202, D203, D211, D213, E203, E213, E266, E501, W503
4
+ max-line-length = 88
5
+ exclude = .git,__pycache__,build,dist,.venv,docs, docs/**, notebooks, *.ipynb, *.oft, *ttf,
6
+ max-complexity = 22
@@ -0,0 +1,10 @@
1
+ # Enforce Unix-style line endings for source code and docs
2
+ *.py text eol=lf
3
+ *.md text eol=lf
4
+ *.txt text eol=lf
5
+ *.yml text eol=lf
6
+ *.toml text eol=lf
7
+
8
+ # Fonts are binary – no conversion
9
+ *.otf binary
10
+ *.ttf binary
@@ -0,0 +1,39 @@
1
+ name: docs
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.11"
21
+
22
+ - name: Install dependencies
23
+ run: |
24
+ pip install -e .[docs]
25
+
26
+ - name: Build HTML docs
27
+ run: sphinx-build docs docs/_build/html
28
+
29
+ - name: Configure Git
30
+ run: |
31
+ git config user.name "github-actions[bot]"
32
+ git config user.email "github-actions[bot]@users.noreply.github.com"
33
+
34
+ - name: Deploy to GitHub Pages
35
+ if: github.ref == 'refs/heads/main'
36
+ uses: peaceiris/actions-gh-pages@v3
37
+ with:
38
+ github_token: ${{ secrets.GITHUB_TOKEN }}
39
+ publish_dir: docs/_build/html
@@ -0,0 +1,48 @@
1
+ name: Run pre-commit hooks
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+
11
+
12
+ jobs:
13
+ pre-commit:
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - name: Checkout repository
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Set up Python 3.11
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: 3.11
24
+
25
+ - name: Set up Node.js
26
+ uses: actions/setup-node@v4
27
+ with:
28
+ node-version: 20
29
+
30
+ - name: Install pre-commit
31
+ run: pip install pre-commit
32
+
33
+ - name: Install markdownlint-cli
34
+ run: npm install -g markdownlint-cli
35
+
36
+ - name: Clear pre-commit cache
37
+ run: pre-commit clean
38
+
39
+ - name: Cache pre-commit
40
+ uses: actions/cache@v4
41
+ with:
42
+ path: ~/.cache/pre-commit
43
+ key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
44
+ restore-keys: |
45
+ ${{ runner.os }}-pre-commit-
46
+
47
+ - name: Run pre-commit hooks
48
+ run: pre-commit run --all-files --show-diff-on-failure
@@ -0,0 +1,54 @@
1
+ name: Run Tests and Upload Coverage
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ${{ matrix.os }}
14
+ strategy:
15
+ matrix:
16
+ os: [ubuntu-latest, windows-latest, macos-latest]
17
+ python-version: ['3.10', '3.11', '3.12']
18
+ fail-fast: false
19
+
20
+ steps:
21
+ - name: Checkout code
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Set up Python
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: ${{ matrix.python-version }}
28
+
29
+ - name: Install system dependencies on Linux
30
+ if: runner.os == 'Linux'
31
+ run: |
32
+ sudo apt-get update
33
+ sudo apt-get install -y libegl1 libxrender1 libxext6 libx11-6
34
+
35
+ - name: Install dependencies
36
+ run: |
37
+ python -m pip install --upgrade pip
38
+ pip install -e .[dev]
39
+ pip install numpy h5py Pillow matplotlib afmreader
40
+ pip install pytest>=7.0 pytest-cov pytest-qt flake8 pre-commit
41
+
42
+ - name: Run tests with coverage
43
+ run: |
44
+ pytest --cov=playNano --cov-report=xml
45
+
46
+ - name: Upload coverage to Codecov
47
+ if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
48
+ uses: codecov/codecov-action@v4
49
+ with:
50
+ token: ${{ secrets.CODECOV_TOKEN }}
51
+ files: coverage.xml
52
+ flags: unittests
53
+ name: playNano-tests-${{ matrix.os }}-py${{ matrix.python-version }}
54
+ fail_ci_if_error: true
@@ -0,0 +1,45 @@
1
+ # Logs
2
+ *.log
3
+
4
+ # Python cache/compiled files
5
+ __pycache__/
6
+ *.py[cod]
7
+
8
+ # Ruff / linting cache
9
+ .ruff_cache/
10
+
11
+ # OS-specific
12
+ .DS_Store
13
+ Thumbs.db
14
+
15
+ # Editor / IDE settings
16
+ .vscode/
17
+ .idea/
18
+
19
+ # Virtual environments
20
+ .venv/
21
+ env/
22
+ *.env
23
+
24
+ # Test / coverage / CI artifacts
25
+ htmlcov/
26
+ .tox/
27
+ .nox/
28
+ .coverage*
29
+ .cache/
30
+ nosetests.xml
31
+ coverage.xml
32
+ *.cover
33
+ .hypothesis/
34
+ .pytest_cache/
35
+
36
+ # Documentation builds
37
+ docs/_build/
38
+
39
+ # Jupyter notebook checkpoints
40
+ **/.ipynb_checkpoints/
41
+
42
+ # Build & distribution artifacts
43
+ build/
44
+ dist/
45
+ *.egg-info/
@@ -0,0 +1,8 @@
1
+ default: true
2
+
3
+ MD013:
4
+ line_length: 120
5
+
6
+ MD033:
7
+ allowed_elements:
8
+ - div
@@ -0,0 +1,50 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.5.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ exclude: ^(docs/|tests/resources/spm_folder_0|src/playNano/fonts/|LICENSE)
7
+ - id: end-of-file-fixer
8
+ exclude: ^(docs/|tests/resources/spm_folder_0|src/playNano/fonts/|LICENSE)
9
+ - id: check-yaml
10
+ exclude: ^(docs/|src/playNano/fonts/|LICENSE)
11
+ - id: check-added-large-files
12
+ exclude: ^(docs/|src/playNano/fonts/|LICENSE)
13
+
14
+ - repo: https://github.com/pycqa/isort
15
+ rev: 5.12.0
16
+ hooks:
17
+ - id: isort
18
+ args: ["--profile", "black"]
19
+ name: isort (python import sorting)
20
+ language_version: python3.11
21
+ exclude: ^(docs/|src/playNano/fonts/|LICENSE)$
22
+
23
+ - repo: https://github.com/astral-sh/ruff-pre-commit
24
+ rev: v0.3.7
25
+ hooks:
26
+ - id: ruff
27
+ args: ["--fix"]
28
+ additional_dependencies: [ "ruff>=0.0.285" ]
29
+ exclude: ^(docs/|notebooks/|src/playNano/fonts/|LICENSE)$
30
+
31
+ - repo: https://github.com/psf/black
32
+ rev: 23.7.0
33
+ hooks:
34
+ - id: black
35
+ language_version: python3.11
36
+ exclude: ^(docs/|src/playNano/fonts/|LICENSE)$
37
+
38
+ - repo: https://github.com/pycqa/flake8
39
+ rev: 6.0.0
40
+ hooks:
41
+ - id: flake8
42
+ additional_dependencies: [flake8-docstrings]
43
+ exclude: ^(docs/|src/playNano/fonts/|LICENSE)$
44
+
45
+ - repo: https://github.com/DavidAnson/markdownlint-cli2
46
+ rev: v0.18.1
47
+ hooks:
48
+ - id: markdownlint-cli2
49
+ args: [--fix]
50
+ exclude: ^(docs/|src/playNano/fonts/|LICENSE)$
@@ -0,0 +1,74 @@
1
+ <!-- markdownlint-disable MD033 MD024-->
2
+ # Changelog
3
+
4
+ All notable changes to this project will be documented in this file.
5
+
6
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
7
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
+
9
+ ## [Unreleased]
10
+
11
+ ### Added
12
+
13
+ - Next change in the project
14
+
15
+ ## [0.1.0] - 2025-09-17
16
+
17
+ ### Added
18
+
19
+ - First public release 🎉
20
+
21
+ - **AFM data loading & playback**
22
+ - Load HS‑AFM videos from .h5-jpk and .asd files and folders of .spm and .jpk files.
23
+ - Time‑aware frame navigation and consistent pixel/scale metadata.
24
+
25
+ - **Processing pipeline with masks & full provenance**
26
+ - Sequential filters and masks (e.g., plane removal, row/median alignment, polynomial flatten, Gaussian filtering).
27
+ - Each step is recorded with index, name, parameters, timestamps, and environment details under `stack.provenance`.
28
+ - Processed snapshots and masks are stored with ordered keys like `step_<n>_<name>` for reliable inspection and re‑use.
29
+
30
+ - **Reproducible export & re‑import (analysis‑ready)**
31
+ - Save the current stack state (with stages, masks, and provenance) to **HDF5 (`.h5`)** or **NumPy bundles (`.npz`)**.
32
+ - Re‑load bundles later to continue processing and run analyses with the full history intact.
33
+ - Export to **OME‑TIFF** for interoperability and to **GIF** (with optional scale bars)
34
+ for quick sharing and presentation.
35
+
36
+ - **Interactive GUI (PySide6) for exploration**
37
+ - Real‑time playback, frame seeking, and snapshot previews.
38
+ - **Z‑range control** (auto or manual) to maintain consistent height scaling across frames.
39
+ - **Annotations/overlays** (i.e. timestamps, raw data label, scale bar) rendered on top of frames.
40
+ - Built‑in dark theme stylesheet for high‑contrast analysis.
41
+
42
+ - **Analysis framework**
43
+ - Build analysis pipelines from built-in and pluggable analysis modules.
44
+ - Built-in analysis modules (e.g., LoG blob detection, DBSCAN/K‑Means/X‑Means clustering, particle tracking).
45
+ - Produces labeled masks, per‑feature properties (area, min/max/mean, bbox, centroid), and summary statistics.
46
+ - Analysis outputs are keyed and traced in provenance for reproducibility.
47
+
48
+ - **Command Line Interface (CLI)**
49
+ - `playnano` entrypoint to run processing pipelines, export bundles (TIFF/NPZ/HDF5), and create GIFs from the shell.
50
+
51
+ - **Notebooks**
52
+ - Jupyter notebooks included to demonstrate programmatic workflow.
53
+ - Overview notebook covers the whole loading, processing, analysis and export workflow.
54
+ - Processing notebook focuses on processing and export of loaded data.
55
+
56
+ - **Documentation**:
57
+ - Created a Sphinx documentation site on GitHub Pages.
58
+ - **User Guide** covering installation, quick start, GUI and CLI usage, processing, analysis and exports.
59
+ - **API Reference** generated with `sphinx-autoapi` for all packages.
60
+ - **CLI reference** with examples and typical workflows.
61
+ - Furo theme and MyST Markdown configuration for a clean, consistent look.
62
+
63
+ ### Changed
64
+
65
+ - N/A (initial public release).
66
+
67
+ ### Fixed
68
+
69
+ - N/A (initial public release).
70
+
71
+ ---
72
+
73
+ [Unreleased]: https://github.com/derollins/playNano/compare/v0.1.0...HEAD
74
+ [0.1.0]: https://github.com/derollins/playNano/releases/tag/v0.1.0