Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update repr methods #50

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading