Skip to content

Commit 629f757

Browse files
kalidkeclaude
andcommitted
Inherit from SMLMData abstract types for tuple pattern
SMLMSimParams <: AbstractSMLMConfig, SimInfo <: AbstractSMLMInfo, ImageInfo <: AbstractSMLMInfo. Remove unused AbstractSim type. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d10a0fe commit 629f757

File tree

7 files changed

+15
-24
lines changed

7 files changed

+15
-24
lines changed

src/SMLMSim.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ using Distributions
4747
using LinearAlgebra
4848

4949
# Re-export critical types from SMLMData to make them available to users
50-
export AbstractCamera, IdealCamera, SCMOSCamera, AbstractEmitter, Emitter2D, Emitter3D, Emitter2DFit, Emitter3DFit, BasicSMLD
50+
export AbstractCamera, IdealCamera, SCMOSCamera, AbstractEmitter, Emitter2D, Emitter3D, Emitter2DFit, Emitter3DFit, BasicSMLD,
51+
AbstractSMLMConfig, AbstractSMLMInfo
5152

5253
# Include info types before submodules so they can use them
5354
include("types.jl")
@@ -61,7 +62,7 @@ include("interface.jl")
6162
using .Core: CTMC, get_state, get_next, intensity_trace, kinetic_model
6263
using .Core: Molecule, GenericFluor, Pattern, Pattern2D, Pattern3D
6364
using .Core: Nmer2D, Nmer3D, Line2D, Line3D, uniform2D, uniform3D, rotate!
64-
using .Core: AbstractSim, SMLMSimParams # Add abstract types import
65+
using .Core: SMLMSimParams
6566
using .Core: get_track, get_num_tracks, get_tracks # Track utility functions
6667
using .Core: AbstractLabeling, FixedLabeling, PoissonLabeling, BinomialLabeling
6768
using .Core: n_fluorophores, apply_labeling
@@ -92,8 +93,7 @@ using .StaticSMLM: simulate
9293
# Export simulation interfaces
9394
export
9495
# Simulation interfaces
95-
AbstractSim,
96-
SMLMSimParams # Add this export
96+
SMLMSimParams
9797

9898
# Export simulation functions
9999
export

src/core/Core.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ include("track_utils.jl")
3535

3636
# Export abstract types
3737
export
38-
AbstractSim,
3938
SMLMSimParams
4039

4140
# Export molecule types

src/core/abstract_types.jl

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
"""
2-
AbstractSim
3-
4-
Abstract type for all simulation types in SMLMSim.
5-
Concrete subtypes should implement their own simulate methods.
6-
"""
7-
abstract type AbstractSim end
8-
9-
"""
10-
SMLMSimParams <: AbstractSim
2+
SMLMSimParams <: AbstractSMLMConfig
113
124
Abstract type for all SMLM simulation parameter types.
13-
Provides a common parent for different types of SMLM simulations.
5+
Inherits from SMLMData.AbstractSMLMConfig to participate in the
6+
ecosystem-wide (Config, Info, Data) tuple pattern.
147
"""
15-
abstract type SMLMSimParams <: AbstractSim end
8+
abstract type SMLMSimParams <: AbstractSMLMConfig end

src/diffusion/InteractionDiffusion.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ using Printf
5454

5555
# Import the main simulate function to add our method
5656
import ..simulate
57-
import ..Core: AbstractSim
5857
import ..Core: SMLMSimParams
5958
import ..SimInfo
6059

src/interface.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ simulation type and parameters.
77
"""
88

99
# Import the abstract types directly from Core
10-
import ..Core: AbstractSim
10+
import ..Core: SMLMSimParams
1111

1212
# Abstract types are now defined in Core.abstract_types.jl
1313

1414
"""
15-
simulate(sim::AbstractSim; kwargs...)
15+
simulate(sim::SMLMSimParams; kwargs...)
1616
1717
Generic interface for all simulation types.
1818
Dispatches to the appropriate method based on the concrete simulation type.
1919
2020
# Arguments
21-
- `sim::AbstractSim`: The simulation configuration object
21+
- `sim::SMLMSimParams`: The simulation configuration object
2222
- `kwargs...`: Additional keyword arguments specific to the simulation type
2323
2424
# Returns
@@ -36,7 +36,7 @@ params = StaticSMLMConfig(
3636
results = simulate(params)
3737
```
3838
"""
39-
function simulate(sim::AbstractSim; kwargs...)
39+
function simulate(sim::SMLMSimParams; kwargs...)
4040
# This is a generic interface that will dispatch to the
4141
# appropriate method based on the concrete type of sim
4242
error("No simulate method implemented for $(typeof(sim))")

src/static/StaticSMLM.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ using Distributions
2323
import ..Core: Pattern, Pattern2D, Pattern3D, uniform2D, uniform3D
2424
import ..Core: Molecule, GenericFluor, kinetic_model
2525
import ..Core: Nmer2D, Nmer3D
26-
import ..Core: AbstractSim, SMLMSimParams
26+
import ..Core: SMLMSimParams
2727
import ..Core: AbstractLabeling, FixedLabeling, PoissonLabeling, BinomialLabeling
2828
import ..Core: n_fluorophores, apply_labeling
2929
import ..simulate

src/types.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if info.smld_true !== nothing
3434
end
3535
```
3636
"""
37-
struct SimInfo
37+
struct SimInfo <: AbstractSMLMInfo
3838
# Common fields (ecosystem convention)
3939
elapsed_s::Float64
4040
backend::Symbol
@@ -91,7 +91,7 @@ println("Generated \$(info.frames_generated) frames in \$(info.elapsed_s) second
9191
println("Total photons: \$(info.n_photons_total)")
9292
```
9393
"""
94-
struct ImageInfo
94+
struct ImageInfo <: AbstractSMLMInfo
9595
# Common fields
9696
elapsed_s::Float64
9797
backend::Symbol

0 commit comments

Comments
 (0)