-
Notifications
You must be signed in to change notification settings - Fork 59
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
Adds types _roff_grid.py #920
Conversation
@@ -50,6 +50,7 @@ examples/* | |||
!examples/*.py | |||
!examples/run_examples.sh | |||
_tmp_* | |||
.dmypy.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dmypy is a service that runs mypy as a demon, making mypy checks nearly instant.
Codecov Report
@@ Coverage Diff @@
## main #920 +/- ##
==========================================
- Coverage 80.71% 80.66% -0.06%
==========================================
Files 88 88
Lines 13199 13204 +5
Branches 2177 2177
==========================================
- Hits 10654 10651 -3
- Misses 1833 1847 +14
+ Partials 712 706 -6
... and 5 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
[.venv] [2023.09.01-py38] [jlov@st-linrgs170 xtgeo]$ dmypy check -- --follow-imports=skip src/xtgeo/grid3d/_roff_grid.py
Success: no issues found in 2 source files |
src/xtgeo/grid3d/_roff_grid.py
Outdated
@@ -364,7 +373,7 @@ def to_file(self, filelike, roff_format=roffio.Format.BINARY): | |||
roffio.write(filelike, data, roff_format=roff_format) | |||
|
|||
@staticmethod | |||
def from_file(filelike): | |||
def from_file(filelike: IO) -> RoffGrid: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cant find any closures for this filelike object, this can lead some bugs if the closure only happens when the refcount is zero. I think we should create a task for this for further investigations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe filelike should be Union[str, pathlib.Path, io.BytesIO, io.StringIO]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe filelike should be
Union[str, pathlib.Path, io.BytesIO, io.StringIO]
Yeah, i think your right.
@@ -275,7 +280,7 @@ def xtgeo_zcorn(self): | |||
else: | |||
raise ValueError(f"Unknown error {retval} occurred") | |||
|
|||
def xtgeo_subgrids(self): | |||
def xtgeo_subgrids(self) -> Optional[OrderedDict[str, range]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wonder if we could return emtpy dict here insted of none.
Ignore this PR for now, just getting a feel for the system and workflows.
#895