-
Notifications
You must be signed in to change notification settings - Fork 30
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
return kwargs from adapter.to_file funtions #456
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.
This issue indeed wasn't clear at all. What I think we want to return in the to_file
methods are any keyword arguments required to read back the data into an identical object. To read self-describing formats like netcdf and geotiff to a xarray.Dataset this is not necessary, but to properly read a csv back to a pandas.DataFrame you need to know the index column. I guess the required "return kwargs" can be specified per driver, but would need to try to be sure.
For the CSV I've added the index_col to the kwargs that is returned, so I think it should be all good now. If we can think of any attributes needed later we can always add them |
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 added a small comment, let me know if you have questions.
Co-authored-by: DirkEilander <[email protected]>
Co-authored-by: DirkEilander <[email protected]>
@DirkEilander Perhaps a tangential question, but I noticed that the |
not to @savente93 :
|
@DirkEilander implemented what we discussed. Should be good to go now. |
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.
Made a small change to actually use the returned driver_kwargs.
Otherwise good to be merged!
Issue addressed
Fixes #182
Explanation
The description wasn't super clear about how this was supposed to be used but it was super quick to do, so I just took the liberty. For now the returned source_kwargs in the export function is unused, but hopefully, those (i.e. @DirkEilander) can use it now that it is available. This PR doesn't actually add any functionality, therefore I don't think tests or doc updates are necessary.
Checklist
main
Additional Notes (optional)
Add any additional notes or information that may be helpful.