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

FM reprs, nodes before elements #758

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
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
13 changes: 7 additions & 6 deletions mikeio/dfsu/_layered.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ def __init__(self, filename: str | Path) -> None:
self._items = self._read_items(self._filename)

def __repr__(self) -> str:
out = [f"<mikeio.{self.__class__.__name__}>"]

out.append(f"number of elements: {self.geometry.n_elements}")
out.append(f"number of nodes: {self.geometry.n_nodes}")
out.append(f"projection: {self.geometry.projection_string}")
out.append(f"number of sigma layers: {self.geometry.n_sigma_layers}")
out = [
f"<mikeio.{self.__class__.__name__}>"
f"number of nodes: {self.geometry.n_nodes}",
f"number of elements: {self.geometry.n_elements}",
f"projection: {self.geometry.projection_string}",
f"number of sigma layers: {self.geometry.n_sigma_layers}",
]
if (
self._type == DfsuFileType.DfsuVerticalProfileSigmaZ
or self._type == DfsuFileType.Dfsu3DSigmaZ
Expand Down
2 changes: 1 addition & 1 deletion mikeio/dfsu/_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def _read_header(self, filename: str | Path) -> GeometryFM2D:
def __repr__(self) -> str:
out = [
"<Mesh>",
f"number of elements: {self.n_elements}",
f"number of nodes: {self.n_nodes}",
f"number of elements: {self.n_elements}",
f"projection: {self.geometry.projection_string}",
]
return str.join("\n", out)
Expand Down
2 changes: 1 addition & 1 deletion mikeio/dfsu/_spectral.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def __repr__(self) -> str:
out = [f"<mikeio.{self.__class__.__name__}>"]

if self._type is not DfsuFileType.DfsuSpectral0D:
out.append(f"number of nodes: {self.geometry.n_nodes}")
if self._type is not DfsuFileType.DfsuSpectral1D:
out.append(f"number of elements: {self.geometry.n_elements}")
out.append(f"number of nodes: {self.geometry.n_nodes}")
if self.geometry.is_spectral:
if self.geometry.n_directions > 0:
out.append(f"number of directions: {self.geometry.n_directions}")
Expand Down