1414    from  _pytask .mark  import  Mark 
1515
1616
17- __all__  =  ["MetaNode"  ,  " PNode" , "PPathNode" , "PTask" , "PTaskWithPath" ]
17+ __all__  =  ["PNode" , "PPathNode" , "PTask" , "PTaskWithPath" ]
1818
1919
2020@runtime_checkable  
21- class  MetaNode (Protocol ):
22-     """Protocol for an intersection between  nodes and tasks .""" 
21+ class  PNode (Protocol ):
22+     """Protocol for nodes.""" 
2323
2424    name : str 
2525
2626    @property  
2727    def  signature (self ) ->  str :
2828        """Return the signature of the node.""" 
29-         ...
3029
3130    @abstractmethod  
3231    def  state (self ) ->  str  |  None :
@@ -36,12 +35,6 @@ def state(self) -> str | None:
3635        does not exist, you can also return ``None``. 
3736
3837        """ 
39-         ...
40- 
41- 
42- @runtime_checkable  
43- class  PNode (MetaNode , Protocol ):
44-     """Protocol for nodes.""" 
4538
4639    def  load (self , is_product : bool ) ->  Any :
4740        """Return the value of the node that will be injected into the task. 
@@ -55,11 +48,9 @@ def load(self, is_product: bool) -> Any:
5548            user calling :meth:`PNode.load`. 
5649
5750        """ 
58-         ...
5951
6052    def  save (self , value : Any ) ->  Any :
6153        """Save the value that was returned from a task.""" 
62-         ...
6354
6455
6556@runtime_checkable  
@@ -74,19 +65,32 @@ class PPathNode(PNode, Protocol):
7465
7566
7667@runtime_checkable  
77- class  PTask (MetaNode ,  Protocol ):
68+ class  PTask (Protocol ):
7869    """Protocol for nodes.""" 
7970
71+     name : str 
8072    depends_on : dict [str , PyTree [PNode ]]
8173    produces : dict [str , PyTree [PNode ]]
74+     function : Callable [..., Any ]
8275    markers : list [Mark ]
8376    report_sections : list [tuple [str , str , str ]]
8477    attributes : dict [Any , Any ]
85-     function : Callable [..., Any ]
78+ 
79+     @property  
80+     def  signature (self ) ->  str :
81+         """Return the signature of the node.""" 
82+ 
83+     @abstractmethod  
84+     def  state (self ) ->  str  |  None :
85+         """Return the state of the node. 
86+ 
87+         The state can be something like a hash or a last modified timestamp. If the node 
88+         does not exist, you can also return ``None``. 
89+ 
90+         """ 
8691
8792    def  execute (self , ** kwargs : Any ) ->  Any :
8893        """Return the value of the node that will be injected into the task.""" 
89-         ...
9094
9195
9296@runtime_checkable  
0 commit comments