Changes between Version 1 and Version 2 of BlocksAndSlots


Ignore:
Timestamp:
Jan 23, 2013, 4:22:58 PM (8 years ago)
Author:
flip
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BlocksAndSlots

    v1 v2  
    55== The Slots ==
    66
    7 At present, there are four ''slots'' in the blocks container. Their names are raw, prep, spectral and fit. (At some point, a fifth slot for spatial processing will probably be added between prep and spectral.)
     7At present, there are four ''slots'' in the blocks container. Their names are raw, prep, spectral and fit. At some point, a fifth slot for spatial processing will probably be added between prep and spectral. (Note: don't confuse the term "slots" with Python's special `__slots__` attribute. The slots described here have nothing to do with the Python attribute.)
    88
    99The blocks are stored in an ordered dictionary that is keyed by the slot names ("raw", "prep", etc.).
     
    2323All blocks in a given slot must subclass (derive from) the identity class for that slot. For instance, BlockPrepFidsum inherits from BlockPrepIdentity. The identity class (in combination with the base Block class) describes the minimum implementation for a block of that type.
    2424
    25 In addition, deriving from a particular identity class allows other code in Analysis to know in which slot a block instance resides by using `isinstance()`. Remember that `isinstance(A, B)` returns True if A is of class B or a subclass thereof.
     25Deriving from a particular identity class allows other code in Analysis to know in which slot a block instance resides by using `isinstance()`. Remember that `isinstance(A, B)` returns True if A is of class B or a subclass thereof. For example, this statement returns True --
     26
     27{{{
     28#!python
     29isinstance(block_prep_fidsum.BlockPrepFidsum(), block_prep_identity.BlockPrepIdentity)
     30}}}