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

Raise error when GRD file is corrupted #451

Open
santisoler opened this issue Jan 18, 2024 · 1 comment
Open

Raise error when GRD file is corrupted #451

santisoler opened this issue Jan 18, 2024 · 1 comment
Labels
enhancement Idea or request for a new feature good first issue Good for newcomers (doesn’t require deep knowledge of the project)

Comments

@santisoler
Copy link
Member

santisoler commented Jan 18, 2024

Description of the desired feature:

In case the GRD file that is intended to be read is corrupted and there are missing elements in the grid, our hm.load_oasis_montaj_grid function will fail, raising an error complaining about not being able to reshape the grid to the expected shape.

We could improve the user interface by checking if the number of elements in the read 1d array matches the expected shape and raise an error with an informative error message if it doesn't. It could be a ValueError with a message like:

f"Encountered grid with {n} elements that doesn't match the expected shape ({shape}). The '{filename}' file is possibly corrupted."

The idea for this new feature was triggered after a conversation with @marcoutojr

Are you willing to help implement and maintain this feature?

Yes, sure! Although I'd love to see someone else tackling this issue.

@santisoler santisoler added enhancement Idea or request for a new feature good first issue Good for newcomers (doesn’t require deep knowledge of the project) labels Jan 18, 2024
@leouieda
Copy link
Member

Good catch! Nice to see @marcoutojr here 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Idea or request for a new feature good first issue Good for newcomers (doesn’t require deep knowledge of the project)
Projects
None yet
Development

No branches or pull requests

2 participants