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

Add a types module #953

Closed
mferrera opened this issue Nov 1, 2023 · 1 comment
Closed

Add a types module #953

mferrera opened this issue Nov 1, 2023 · 1 comment
Labels
need more investigation refactor Code improvements (~invisible for users)

Comments

@mferrera
Copy link
Collaborator

mferrera commented Nov 1, 2023

Typing certain parameters could be made simpler with a central types module that describes longer unioned types used widely across the codebase. In particular this includes things like

FileLike = Union[str, pathlib.Path, io.BytesIO, io.StringIO
FileFormat = Literal[...]  # roff, roffbin, grid, grdecl...

However this kind of file can become unwieldy without some discipline. It could, for example, but prudent to graduate types to a global file as we go along, first putting them in deeper modules:

# xtgeo.grid3d.types or _types
GridLike = Union[Grid, GridProperty]
@mferrera mferrera added refactor Code improvements (~invisible for users) need more investigation labels Nov 1, 2023
@mferrera
Copy link
Collaborator Author

mferrera commented Nov 9, 2023

Resolved with #958

@mferrera mferrera closed this as completed Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more investigation refactor Code improvements (~invisible for users)
Projects
None yet
Development

No branches or pull requests

1 participant