Skip to content

Commit

Permalink
WIP roff
Browse files Browse the repository at this point in the history
  • Loading branch information
mferrera committed Nov 23, 2023
1 parent 4dc7244 commit aa12f39
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/xtgeo/grid3d/_roff_parameter.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from __future__ import annotations

import warnings
from collections import OrderedDict, defaultdict
from collections import defaultdict
from dataclasses import dataclass
from typing import Any

import numpy as np
import roffio
Expand Down Expand Up @@ -44,7 +45,7 @@ class RoffParameter:
code_names: list[str] | None = None
code_values: np.ndarray | None = None

def __eq__(self, other):
def __eq__(self, other: Any) -> bool:
if not isinstance(other, RoffParameter):
return False
return (
Expand All @@ -56,7 +57,7 @@ def __eq__(self, other):
and self.same_codes(other)
)

def same_codes(self, other):
def same_codes(self, other: RoffParameter) -> bool:
"""
Args:
other (RoffParameter): Any roff parameter
Expand All @@ -78,7 +79,7 @@ def same_codes(self, other):
)

@property
def undefined_value(self):
def undefined_value(self) -> int | float:
"""
Returns:
The undefined value for the type of values in the
Expand Down Expand Up @@ -179,7 +180,7 @@ def to_file(self, filelike, roff_format=roffio.Format.BINARY):
filelike (str or byte stream): The file to write to.
roff_format (roffio.Format): The format to write the file in.
"""
data = OrderedDict(
data = dict(
{
"filedata": {"filetype": "parameter"},
"dimensions": {"nX": self.nx, "nY": self.ny, "nZ": self.nz},
Expand Down

0 comments on commit aa12f39

Please sign in to comment.