Skip to content

Commit

Permalink
Update repr methods
Browse files Browse the repository at this point in the history
  • Loading branch information
gerlero committed Mar 29, 2024
1 parent a102c10 commit 582daf9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions foamlib/_dictionaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def __len__(self) -> int:
return len(list(iter(self)))

def __repr__(self) -> str:
return "FoamFile.Dictionary"
return f"FoamFile.Dictionary({self._file}, {self._keywords})"


class FoamFile(_FoamDictionary):
Expand Down Expand Up @@ -201,7 +201,7 @@ def __getitem__(
return ret

def __repr__(self) -> str:
return "FoamFieldFile.BoundariesDictionary"
return f"{type(self).__qualname__}({self._file}, {self._keywords})"

class BoundaryDictionary(_FoamDictionary):
"""An OpenFOAM dictionary representing a boundary condition as a mutable mapping."""
Expand Down Expand Up @@ -260,7 +260,7 @@ def value(self) -> None:
del self["value"]

def __repr__(self) -> str:
return "FoamFieldFile.BoundaryDictionary"
return f"{type(self).__qualname__}({self._file}, {self._keywords})"

def __getitem__(self, key: str) -> Union[FoamFile.Value, _FoamDictionary]:
ret = super().__getitem__(key)
Expand Down

0 comments on commit 582daf9

Please sign in to comment.