Skip to content

Commit 30549a3

Browse files
authored
refactor: update settings (#84)
1 parent 707981a commit 30549a3

3 files changed

Lines changed: 4 additions & 38 deletions

File tree

src/microsim/schema/modality/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ._simple import Confocal, Identity, Widefield
1+
from ._simple_psf import Confocal, Identity, Widefield
22

33
Modality = Confocal | Widefield | Identity
44

File renamed without changes.

src/microsim/schema/settings.py

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import random
2-
from typing import Any, ClassVar, Literal
2+
from typing import Any, ClassVar
33

44
from pydantic import Field, model_validator
55
from pydantic_settings import BaseSettings, SettingsConfigDict
@@ -35,7 +35,7 @@ class Settings(SimBaseModel, BaseSettings):
3535
default_factory=lambda: random.randint(0, 2**32 - 1)
3636
)
3737
max_psf_radius_aus: float | None = Field(
38-
8,
38+
6,
3939
description=(
4040
"When simulating, restrict generated lateral PSF size to no more than this "
4141
"many Airy units. Decreasing this can *dramatically* speed up simulations, "
@@ -44,18 +44,8 @@ class Settings(SimBaseModel, BaseSettings):
4444
),
4545
)
4646
cache: CacheSettings = Field(default_factory=CacheSettings)
47-
binning_strategy: Literal["equal_area", "equal_space"] = Field(
48-
"equal_space",
49-
description=(
50-
"The strategy to use for binning data. `'equal_area'` will divide the "
51-
"spectrum into intervals with intensity integral, while `'equal_space'` "
52-
"will divide the range of values into equally spaced bins. Note that "
53-
"`'equal_area'` is more accurate, but is not supported in the case of "
54-
"multiple fluorophores."
55-
),
56-
)
5747
spectral_bins_per_emission_channel: int = Field(
58-
4,
48+
1,
5949
description="Number of wavelengths to use (per channel) when simulating the "
6050
"optical image. By default, a single centroid wavelength is used to approximate"
6151
"the emission wavelength. Increasing this will make the simulation more "
@@ -71,30 +61,6 @@ class Settings(SimBaseModel, BaseSettings):
7161
"intensity above this threshold). Then, the spectrum is discretized into "
7262
"spectral_bins_per_emission_channel bins.",
7363
)
74-
num_wavelength_bins: int = Field(
75-
32,
76-
description=(
77-
"Number of bins to use when discretizing the wavelength spectrum."
78-
"It regards the wavelength range for illumination and excitation spectra."
79-
"Increasing this will increase accuracy but also increase memory usage."
80-
),
81-
)
82-
min_wavelength: int = Field(
83-
300,
84-
description=(
85-
"Minimum wavelength to consider in the simulation."
86-
"It is used to define the range of the wavelength spectrum when "
87-
"fluorophores are not defined."
88-
),
89-
)
90-
max_wavelength: int = Field(
91-
800,
92-
description=(
93-
"Maximum wavelength to consider in the simulation."
94-
"It is used to define the range of the wavelength spectrum when "
95-
"fluorophores are not defined."
96-
),
97-
)
9864

9965
model_config: ClassVar[SettingsConfigDict] = SettingsConfigDict(
10066
validate_assignment=True,

0 commit comments

Comments
 (0)