From e79d73697efcf4bb02b924254eefd79572069fe9 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Thu, 31 Oct 2024 12:34:39 +0100 Subject: [PATCH] refactor: update settings --- src/microsim/schema/modality/__init__.py | 2 +- .../modality/{_simple.py => _simple_psf.py} | 0 src/microsim/schema/settings.py | 40 ++----------------- 3 files changed, 4 insertions(+), 38 deletions(-) rename src/microsim/schema/modality/{_simple.py => _simple_psf.py} (100%) diff --git a/src/microsim/schema/modality/__init__.py b/src/microsim/schema/modality/__init__.py index 43679bf..2215099 100644 --- a/src/microsim/schema/modality/__init__.py +++ b/src/microsim/schema/modality/__init__.py @@ -1,4 +1,4 @@ -from ._simple import Confocal, Identity, Widefield +from ._simple_psf import Confocal, Identity, Widefield Modality = Confocal | Widefield | Identity diff --git a/src/microsim/schema/modality/_simple.py b/src/microsim/schema/modality/_simple_psf.py similarity index 100% rename from src/microsim/schema/modality/_simple.py rename to src/microsim/schema/modality/_simple_psf.py diff --git a/src/microsim/schema/settings.py b/src/microsim/schema/settings.py index 80fd38f..ec46654 100644 --- a/src/microsim/schema/settings.py +++ b/src/microsim/schema/settings.py @@ -1,5 +1,5 @@ import random -from typing import Any, ClassVar, Literal +from typing import Any, ClassVar from pydantic import Field, model_validator from pydantic_settings import BaseSettings, SettingsConfigDict @@ -35,7 +35,7 @@ class Settings(SimBaseModel, BaseSettings): default_factory=lambda: random.randint(0, 2**32 - 1) ) max_psf_radius_aus: float | None = Field( - 8, + 6, description=( "When simulating, restrict generated lateral PSF size to no more than this " "many Airy units. Decreasing this can *dramatically* speed up simulations, " @@ -44,18 +44,8 @@ class Settings(SimBaseModel, BaseSettings): ), ) cache: CacheSettings = Field(default_factory=CacheSettings) - binning_strategy: Literal["equal_area", "equal_space"] = Field( - "equal_space", - description=( - "The strategy to use for binning data. `'equal_area'` will divide the " - "spectrum into intervals with intensity integral, while `'equal_space'` " - "will divide the range of values into equally spaced bins. Note that " - "`'equal_area'` is more accurate, but is not supported in the case of " - "multiple fluorophores." - ), - ) spectral_bins_per_emission_channel: int = Field( - 4, + 1, description="Number of wavelengths to use (per channel) when simulating the " "optical image. By default, a single centroid wavelength is used to approximate" "the emission wavelength. Increasing this will make the simulation more " @@ -71,30 +61,6 @@ class Settings(SimBaseModel, BaseSettings): "intensity above this threshold). Then, the spectrum is discretized into " "spectral_bins_per_emission_channel bins.", ) - num_wavelength_bins: int = Field( - 32, - description=( - "Number of bins to use when discretizing the wavelength spectrum." - "It regards the wavelength range for illumination and excitation spectra." - "Increasing this will increase accuracy but also increase memory usage." - ), - ) - min_wavelength: int = Field( - 300, - description=( - "Minimum wavelength to consider in the simulation." - "It is used to define the range of the wavelength spectrum when " - "fluorophores are not defined." - ), - ) - max_wavelength: int = Field( - 800, - description=( - "Maximum wavelength to consider in the simulation." - "It is used to define the range of the wavelength spectrum when " - "fluorophores are not defined." - ), - ) model_config: ClassVar[SettingsConfigDict] = SettingsConfigDict( validate_assignment=True,