ecmwf / earthkit-data

A format-agnostic Python interface for geospatial data
Apache License 2.0
55 stars 13 forks source link

from_source should fail when try to load empty file #319

Closed sandorkertesz closed 7 months ago

sandorkertesz commented 7 months ago

With this PR from_source throws an exception when the input is an empty file. Previously, the result was a TextReader.

The consequence of this change is that when reading/downloading multiple files now it is enough to have an empty file out of many valid ones and the program fail if the exception is uncaught.