add kwarg to handle invalid files in open_mfdataset#9955
add kwarg to handle invalid files in open_mfdataset#9955kmuehlbauer merged 63 commits intopydata:mainfrom pratiman-91:open_mfdataset_enchancement
Conversation
|
Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient. |
|
I'm not the expert, but this looks reasonable! Any other thoughts? Assuming no one thinks it's a bad idea, we would need tests. |
headtr1ck
left a comment
There was a problem hiding this comment.
I think it is a good idea.
But the way it is implemented here seems overly complicated and repetitive.
I would suggest to revert the logic: first build up the list wrapped in a single try and then handle the three cases in the except block.
Co-authored-by: Michael Niklas <mick.niklas@gmail.com>
headtr1ck
left a comment
There was a problem hiding this comment.
Almost there.
Also, we should add tests for this.
|
@headtr1ck Thanks for the suggestions. I have added two tests ( |
|
Hi @headtr1ck, I have been thinking about the handling of |
|
@max-sixty Can you please go through the PR. Thanks! |
|
I'm admittedly much less familiar with this section of the code. nothing seems wrong though! I think we should bias towards merging, so if no one has concerns then I'd vote to merge could we fix the errors in the docs? |
|
It seems like one test failed |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
I have made changes based on your suggestions.
I agree, that would be the case. An important assumption is that removing the files does not affect the overall validity of the datasets. I think it should be up to the user to use that option. |
|
@headtr1ck Can you please review this PR? |
|
You need to merge main and resolve the conflicts |
Thanks @pratiman-91 for the explanation. For cases where unrelated files sneak into the file list for some reason the enhancements in this PR would really help the user to just get |
|
I'm inclined to merge this, but unsure about the CI failures. I'll restart CI, let's see if this was just intermittent. |
|
Thanks @pratiman-91 for sticking with us and congrats to your first contribution! |
|
@max-sixty @kmuehlbauer @headtr1ck Thank you very much for help. It was a nice experience and I learned a lot. |

whats-new.rstAdded new argument in
open_mfdatasetto better handle the invalid files.