From 5e990f046761103db8a98001facca2a1d4ef51a2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 23:24:55 +0000 Subject: [PATCH 1/2] ci(pre-commit.ci): autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/abravalheri/validate-pyproject: v0.25 → 0.26](https://github.com/abravalheri/validate-pyproject/compare/v0.25...0.26) - [github.com/adhtruong/mirrors-typos: v1.47.2 → v1.50.3](https://github.com/adhtruong/mirrors-typos/compare/v1.47.2...v1.50.3) - [github.com/astral-sh/ruff-pre-commit: v0.15.19 → v0.16.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.19...v0.16.10) - [github.com/pre-commit/mirrors-mypy: v2.1.0 → v2.4.0](https://github.com/pre-commit/mirrors-mypy/compare/v2.1.0...v2.4.0) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 13ff634..f6b1e5e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,24 +5,24 @@ ci: repos: - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.25 + rev: '0.26' hooks: - id: validate-pyproject - repo: https://github.com/adhtruong/mirrors-typos - rev: v1.47.2 + rev: v1.50.3 hooks: - id: typos args: [--force-exclude] # omitting --write-changes - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.19 + rev: v0.16.10 hooks: - id: ruff-check - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v2.1.0 + rev: v2.4.0 hooks: - id: mypy files: "^src/" From 361e0821b4151ebb6ee2ccd1941a5bda82249e6d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 23:27:25 +0000 Subject: [PATCH 2/2] style(pre-commit.ci): auto fixes [...] --- README.md | 6 ++---- docs/api.md | 2 +- docs/index.md | 26 ++++++++++++-------------- docs/stages.md | 35 +++++++++++++++++++++++++++-------- 4 files changed, 42 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 8bf10c2..18bb0c7 100644 --- a/README.md +++ b/README.md @@ -77,10 +77,8 @@ from microsim.util import ortho_plot # define the parameters of the simulation sim = ms.Simulation( truth_space=ms.ShapeScaleSpace(shape=(128, 512, 512), scale=(0.02, 0.01, 0.01)), - output_space={'downscale': 8}, - sample=ms.Sample( - labels=[ms.MatsLines(density=0.5, length=30, azimuth=5, max_r=1)] - ), + output_space={"downscale": 8}, + sample=ms.Sample(labels=[ms.MatsLines(density=0.5, length=30, azimuth=5, max_r=1)]), modality=ms.Confocal(pinhole_au=0.2), output_path="au02.tiff", ) diff --git a/docs/api.md b/docs/api.md index 8dab975..dd44d88 100644 --- a/docs/api.md +++ b/docs/api.md @@ -29,7 +29,7 @@ Simulation( truth_space=ms.ShapeScaleSpace(shape=(256, 1024, 1024), scale=(0.02, 0.01, 0.01)), # downscale output to 160nm x 80nm x 80nm pixels with shape (32, 128, 128) output_space=ms.DownscaledSpace(downscale=8), - sample=ms.Sample(labels=[]) # ... + sample=ms.Sample(labels=[]), # ... ) ``` diff --git a/docs/index.md b/docs/index.md index 32850d7..d944e5f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -46,10 +46,8 @@ Construct and run a [`microsim.Simulation`][] object. sim = ms.Simulation( truth_space=ms.ShapeScaleSpace(shape=(128, 512, 512), scale=(0.02, 0.01, 0.01)), - output_space={'downscale': 8}, - sample=ms.Sample( - labels=[ms.MatsLines(density=0.5, length=30, azimuth=5, max_r=1)] - ), + output_space={"downscale": 8}, + sample=ms.Sample(labels=[ms.MatsLines(density=0.5, length=30, azimuth=5, max_r=1)]), modality=ms.Confocal(pinhole_au=0.2), ) result = sim.run() @@ -67,20 +65,20 @@ Construct and run a [`microsim.Simulation`][] object. from microsim.util import ortho_plot sim = Simulation( - truth_space={'shape': (128, 512, 512), 'scale': (0.02, 0.01, 0.01)}, - output_space={'downscale': 8}, + truth_space={"shape": (128, 512, 512), "scale": (0.02, 0.01, 0.01)}, + output_space={"downscale": 8}, sample=dict( labels=[ - { - 'type': 'matslines', - 'density': 0.5, - 'length': 30, - 'azimuth': 5, - 'max_r': 1, + { + "type": "matslines", + "density": 0.5, + "length": 30, + "azimuth": 5, + "max_r": 1, } ] ), - modality={'type': 'confocal', 'pinhole_au': 0.2} + modality={"type": "confocal", "pinhole_au": 0.2}, ) result = sim.run() ortho_plot(result) @@ -126,7 +124,7 @@ the result of the simulation to a file. from microsim import Simulation from pathlib import Path -spec = Path('confocal.json').read_text() +spec = Path("confocal.json").read_text() sim = Simulation.model_validate_json(spec) sim.run() ``` diff --git a/docs/stages.md b/docs/stages.md index 784c3e5..e971dcd 100644 --- a/docs/stages.md +++ b/docs/stages.md @@ -37,7 +37,7 @@ stage, this volume will be downsampled to the final image shape and scale from microsim import Simulation sim = Simulation( - truth_space={'shape': (512, 1024, 1024), 'scale': (0.04, 0.02, 0.02)}, + truth_space={"shape": (512, 1024, 1024), "scale": (0.04, 0.02, 0.02)}, output_space={"downscale": 4}, ) ``` @@ -75,10 +75,15 @@ fluorophores present at each voxel in the volume. sim = Simulation( # ..., sample={ - 'labels': [ + "labels": [ { - 'distribution': {'type': 'matslines', 'density': 0.5, 'length': 30, 'azimuth': 5}, - 'fluorophore': 'EGFP' + "distribution": { + "type": "matslines", + "density": 0.5, + "length": 30, + "azimuth": 5, + }, + "fluorophore": "EGFP", } ], }, @@ -240,9 +245,19 @@ channel 1. This is why both F and C remain at this stage. { "name": "Green", "filters": [ - {"type": "bandpass", "bandcenter": 470, "bandwidth": 40, "placement": "EX"}, + { + "type": "bandpass", + "bandcenter": 470, + "bandwidth": 40, + "placement": "EX", + }, {"type": "longpass", "cuton": 495, "placement": "BS"}, - {"type": "bandpass", "bandcenter": 525, "bandwidth": 50, "placement": "EM"} + { + "type": "bandpass", + "bandcenter": 525, + "bandwidth": 50, + "placement": "EM", + }, ], } ], @@ -350,8 +365,12 @@ bin in the detector. sim = Simulation( # ..., channels=["4yL4ggAo::491"], - objective_lens={"numerical_aperture": 1.4, "immersion_medium_ri": 1.515, 'specimen_ri': 1.33}, - modality={"type": "confocal", 'pinhole_au': 1.2}, + objective_lens={ + "numerical_aperture": 1.4, + "immersion_medium_ri": 1.515, + "specimen_ri": 1.33, + }, + modality={"type": "confocal", "pinhole_au": 1.2}, ) ```