Skip to content

Commit

Permalink
docs: example for Get
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrcia committed Nov 17, 2023
1 parent e02ec55 commit 0d63a8f
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions prose/blocks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,14 @@ def __init__(self, *attributes, name: str = "get", arrays: bool = True, **getter
If a list of paths is provided to a :py:class:`~prose.Sequence`, each image is
created at the beginning of the sequence, and deleted at the end, so that
computed data stored as :py:class:`prose.Image` properties are deleted at each iteration.
Using the Get blocks provides a way to retain any daa stored in images before
This :code:`Get` block provides a way to retain any data stored in images before
they are deleted.
When a sequence is finished, this block has a `values` property, a dictionary
where all retained properties are accessible by name, and consist of a list with
a length corresponding to the number of images processed. The parameters of this
dictionary are the args and kwargs provided to the block (see Example).
If Image is constructed from a FITS image, header values can be retrieved using the
syntax "keyword:KEY" (see example todo)
Parameters
----------
*attributes: str
Expand All @@ -111,8 +108,24 @@ def __init__(self, *attributes, name: str = "get", arrays: bool = True, **getter
Example
-------
TODO
.. code-block:: python
from prose import example_image
from prose import blocks
# example image
image = example_image()
# running the block
block = blocks.Get(image_shape = lambda im: im.shape)
block.run(image)
# getting the output
block.image_shape
.. code-block::
[array([600, 600])]
"""
super().__init__(name=name)
new_getters = {}
Expand Down

0 comments on commit 0d63a8f

Please sign in to comment.