File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -61,10 +61,10 @@ def __contains__(self, key: object) -> bool:
6161 return key in self ._index
6262
6363 def __iter__ (self ) -> Iterator [str ]:
64- return iter (self ._index )
64+ return iter (self .items )
6565
6666 def __len__ (self ) -> int :
67- return len (self ._index )
67+ return len (self .items )
6868
6969 def __str__ (self ) -> str :
7070 return f"{ self .key_field } s: { list (self ._index .keys ())} "
@@ -146,6 +146,9 @@ def default_coords_from_model(cls, model: Component | PyMCStateSpace) -> Self:
146146 coords = [Coord (dimension = dim , labels = labels ) for dim , labels in dim_to_labels ]
147147 return cls (coords )
148148
149+ def to_dict (self ):
150+ return {coord .dimension : coord .labels for coord in self .items if len (coord .labels ) > 0 }
151+
149152
150153@dataclass (frozen = True )
151154class State (Property ):
You can’t perform that action at this time.
0 commit comments