Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sneakers-the-rat committed Nov 5, 2024
1 parent c2506e0 commit 2d02135
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 18 deletions.
7 changes: 7 additions & 0 deletions docs/api/devices/camera.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# camera

```{eval-rst}
.. automodule:: miniscope_io.devices.camera
:members:
:undoc-members:
```
11 changes: 11 additions & 0 deletions docs/api/devices/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# devices

```{toctree}
camera
```

```{eval-rst}
.. automodule:: miniscope_io.devices.device
:members:
:undoc-members:
```
9 changes: 2 additions & 7 deletions docs/api/models/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,9 @@ module, inheriting from the relevant parent class. Rule of thumb:
keep what is common common, and what is unique unique.



```{eval-rst}
.. automodule:: miniscope_io.models
:members:
:undoc-members:
```

```{toctree}
:maxdepth: 1
buffer
config
data
Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ reference/object_model
:maxdepth: 1
:caption: API:
api/devices/index
api/formats/index
api/io
api/logging
Expand Down
45 changes: 41 additions & 4 deletions docs/reference/object_model.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,49 @@
# Object Model

```{currentmodule} miniscope_io
```

## Devices

```{autoclasstree} miniscope_io.models.PipelineModel miniscope_io.models.Node miniscope_io.models.Source miniscope_io.models.Sink miniscope_io.models.ProcessingNode miniscope_io.models.Pipeline
A "{class}`.Device`" is the top-level class that one is expected to interact with when recording
data.

It encapsulates a {class}`.Pipeline` object that parameterizes one of several
{class}`.Source` nodes (like the {class}`.okDev`, {class]`.SDCard`, etc.),
zero-to-several {class}`.ProcessingNode`s that transform the source ouput,
and then one or several {class}`.Sink` nodes for saving data, plotting, and so on.

```{autoclasstree} miniscope_io.devices.Device miniscope_io.devices.Camera miniscope_io.devices.Miniscope
:namespace: miniscope_io
```

## Pipeline

A {class}`.Pipeline` is the basic unit of data processing in miniscope-io.

A {class}`.Pipeline` contains a set of {class}`.Node`s, which have three root types:

- {class}`.Source` nodes have outputs but no inputs
- {class}`.Sink` nodes have inputs but no outputs
- {class}`.ProcessingNode`s have both inputs and outputs

Nodes can be connected to any number of `input` or `output` nodes,
and it is the responsibility of the {class}`.Pipeline` class to orchestrate
their run: launching them in a threadqueue, passing data between them, etc.

{class}`.Node`s should not directly call each other, and instead implement
their {meth}`.Node.process` method as a "pure"-ish[^pureish] function that takes
data as input and returns data as output without knowledge of the nodes
that are connected to it.

```{autoclasstree} miniscope_io.models.PipelineModel miniscope_io.models.Node miniscope_io.models.Source miniscope_io.models.Sink miniscope_io.models.ProcessingNode miniscope_io.models.Pipeline
:namespace: miniscope_io
```

## Config

```{todo}
Complete configuration documentation:
- Sources of config - user dir, prepackaged, etc.
- Types of config - device, session, etc.
```

[^pureish]: As in nodes can be stateful and use their instance attributes,
but should not rely on side-effects, implement their own queues, etc.
5 changes: 5 additions & 0 deletions miniscope_io/devices/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
Devices!
"""

from miniscope_io.devices.camera import Camera, Miniscope
from miniscope_io.devices.device import Device

__all__ = ["Camera", "Device", "Miniscope"]
File renamed without changes.
7 changes: 0 additions & 7 deletions miniscope_io/devices/cameras/__init__.py

This file was deleted.

0 comments on commit 2d02135

Please sign in to comment.