-
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
Add types to grid #958
Add types to grid #958
Conversation
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.
Really superb work on a massive file and one of the most fundamental classes. I think I figured out the doc build issue, and comments about them are included on dataframe
and the method directly below it.
_grid_etc1.reverse_row_axis(self, ijk_handedness=ijk_handedness) | ||
self._tmp = {} |
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'm sure you noticed this yourself but beginning to feel there must be a better way to handle things with (or preferably without) self._tmp
. Not relevant to this PR of course but just a general comment
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.
Yes the self._tmp
is applied in _grid_etc1.py
and _grid3d_fence.py
to store some data to speed up execution, but I am sure this can handled in a better way.
Codecov Report
@@ Coverage Diff @@
## main #958 +/- ##
==========================================
- Coverage 80.48% 80.31% -0.17%
==========================================
Files 91 92 +1
Lines 13512 13494 -18
Branches 2227 2227
==========================================
- Hits 10875 10838 -37
- Misses 1910 1929 +19
Partials 727 727
... and 1 file with indirect coverage changes 📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
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.
Nice work 👍
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.
Just a comment about the subgrids type but I think this is good to go after that! Thanks very much for working with the comments and the great work. This is a beast of a file to take on
def subgrids(self): | ||
def subgrids(self) -> Optional[OrderedDict[str, range | list[int]]]: |
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 think this type is still not fully correct, it should be
Optional[OrderedDict[str, range], OrderedDict[str, list[int]]]
, two possible dict types not a single one with two possible values for keys. Relevant for the deprecated init, init, setter, maybe one or two others places. Then you could get rid of the # type: ignore
in subgrids_from_zoneprop
Resovles #892
Resolves #894