Add grid size check for corrupted .grd files (#451)#569
Add grid size check for corrupted .grd files (#451)#569Nanakjoth wants to merge 3 commits intofatiando:mainfrom
Conversation
|
Hi @Nanakjoth. Thanks for taking the time to work on this and opening the PR! I like the error message you added. Before we merge this PR I would like to add some test that checks that the error is being raised when a corrupted file has been passed. We could add the sample corrupted file you used to manually test the function to Would you like to work on that test? |
|
Hi @santisoler, I actually thought about adding it at the same time as the fix but didn’t get around to it, so thanks for suggesting, that helps a lot. Will update the PR shortly! 🚀 |
Summary
Add a simple check in
load_oasis_montaj_gridto raise a clearValueErrorif the number of grid elements does not match the expected shape. This helps users quickly see if a.grdfile is corrupted or incomplete.What changed
.reshape()..grdwith missing elements.Closes #451.