
    ph                     :    S r SSKr " S S\R                  5      rg)zK
A function registry for storing custom measures and partition strategies.
    Nc                   @    \ rS rSrSrSrS rS rS rS r	S r
S	 rS
rg)Registry   zGeneric registry for user-supplied functions.

See ``pyphi.subsystem.PartitionRegistry`` and
``pyphi.distance.MeasureRegistry`` for concrete usage examples.
 c                     0 U l         g Nstoreselfs    H/home/james-whalen/.local/lib/python3.13/site-packages/pyphi/registry.py__init__Registry.__init__   s	    
    c                    ^ ^ UU 4S jnU$ )zdDecorator for registering a function with PyPhi.

Args:
    name (string): The name of the function
c                 &   > U TR                   T'   U $ r   r	   )funcnamer   s    r   register_func(Registry.register.<locals>.register_func   s    #DJJtKr    )r   r   r   s   `` r   registerRegistry.register   s    	 r   c                     [        U 5      $ )z)Return a list of all registered functions)listr   s    r   allRegistry.all"   s    Dzr   c                 ,    [        U R                  5      $ r   )iterr
   r   s    r   __iter__Registry.__iter__&   s    DJJr   c                 ,    [        U R                  5      $ r   )lenr
   r   s    r   __len__Registry.__len__)   s    4::r   c           	           U R                   U   $ ! [         a4    [        SR                  XR                  U R	                  5       5      5      ef = f)NzJ"{}" not found. Try using one of the installed {} {} or register your own.)r
   KeyErrorformatdescr   )r   r   s     r   __getitem__Registry.__getitem__,   sR    	J::d## 	J%%+VD))TXXZ%HJ J	Js	    >Ar	   N)__name__
__module____qualname____firstlineno____doc__r)   r   r   r   r    r$   r*   __static_attributes__r   r   r   r   r      s-    
 D	 Jr   r   )r0   collectionsMappingr   r   r   r   <module>r4      s#   
 &J{"" &Jr   