Skip to content

Commit ac276d7

Browse files
authored
updated docstring for holography (#316)
* u * u * u
1 parent 24208ce commit ac276d7

2 files changed

Lines changed: 360 additions & 85 deletions

File tree

deeptrack/features.py

Lines changed: 52 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
manipulate features in DeepTrack2, enabling users to build sophisticated data
55
processing pipelines with modular, reusable, and composable components.
66
7-
Main Concepts
7+
Key Features
88
-------------
99
- **Features**
1010
@@ -20,51 +20,79 @@
2020
They enable the construction of pipelines with advanced data flow
2121
requirements.
2222
23-
Key Classes
24-
-----------
25-
- `Feature`:
23+
- **Feature Properties**
24+
25+
Features in DeepTrack2 can have dynamically sampled properties, enabling
26+
parameterization of transformations. These properties are defined at
27+
initialization and can be updated during pipeline execution.
28+
29+
- **Pipeline Composition**
30+
31+
Features can be composed into flexible pipelines using intuitive operators
32+
(`>>`, `&`, etc.), making it easy to define complex data processing
33+
workflows.
34+
35+
- **Lazy Evaluation**
36+
37+
DeepTrack2 supports lazy evaluation of features, ensuring that data is
38+
processed only when needed, which improves performance and scalability.
39+
40+
Module Structure
41+
----------------
42+
Key Classes:
43+
44+
- `Feature`:
45+
2646
Base class for all features in DeepTrack2. Represents a modular data
2747
transformation with properties and methods for customization.
2848
29-
- `StructuralFeature`:
49+
- `StructuralFeature`:
50+
3051
A specialized feature for organizing and managing hierarchical or logical
3152
structures in the pipeline.
3253
33-
- `Value`:
54+
- `Value`:
55+
3456
Stores a constant value as a feature. Useful for passing parameters through
3557
the pipeline.
3658
37-
- `Chain`:
59+
- `Chain`:
60+
3861
Sequentially applies multiple features to the input data (>>).
3962
40-
- `DummyFeature`:
63+
- `DummyFeature`:
64+
4165
A no-op feature that passes the input data unchanged.
4266
4367
- `ArithmeticOperationFeature`:
68+
4469
A parent class for features performing arithmetic operations like addition,
4570
subtraction, multiplication, and division.
4671
47-
Module Highlights
48-
-----------------
49-
- **Feature Properties**
72+
Functions:
5073
51-
Features in DeepTrack2 can have dynamically sampled properties, enabling
52-
parameterization of transformations. These properties are defined at
53-
initialization and can be updated during pipeline execution.
74+
- `propagate_data_to_dependencies`:
5475
55-
- **Pipeline Composition**
76+
def propagate_data_to_dependencies(
77+
feature: Feature,
78+
**kwargs: Any
79+
) -> None
5680
57-
Features can be composed into flexible pipelines using intuitive operators
58-
(`>>`, `&`, etc.), making it easy to define complex data processing
59-
workflows.
81+
Propagates data to all dependencies of a feature, updating their properties
82+
with the provided values.
6083
61-
- **Lazy Evaluation**
84+
- `merge_features`:
6285
63-
DeepTrack2 supports lazy evaluation of features, ensuring that data is
64-
processed only when needed, which improves performance and scalability.
86+
def merge_features(
87+
features: list[Feature],
88+
merge_strategy: int = MERGE_STRATEGY_OVERRIDE,
89+
) -> Feature
90+
91+
Merges multiple features into a single feature using the specified merge
92+
strategy.
6593
66-
Example
67-
-------
94+
Examples
95+
--------
6896
Define a simple pipeline with features:
6997
>>> import deeptrack as dt
7098
>>> import numpy as np
@@ -115,9 +143,6 @@
115143
from deeptrack.sources import SourceItem
116144
from deeptrack.types import ArrayLike, PropertyLike
117145

118-
119-
#TODO: for all features check whether image should be Image, np.ndarray, or both.
120-
121146
MERGE_STRATEGY_OVERRIDE: int = 0
122147
MERGE_STRATEGY_APPEND: int = 1
123148

@@ -4630,7 +4655,7 @@ class SampleToMasks(Feature):
46304655
ValueError
46314656
If `merge_method` is invalid.
46324657
4633-
Example
4658+
Examples
46344659
-------
46354660
>>> import deeptrack as dt
46364661
>>> import matplotlib.pyplot as plt

0 commit comments

Comments
 (0)