We could add geometry to the baseclass as a union of the three main geometries that we use now:
class Dataset(BaseModel, ABC):
dataset: str
years: Timerange.
geometry: Point | Area | PointList
resample: ResampleConfig
Then, for each data source, we could suffice with a single class with multiple loaders, e.g.
class EOBS(Dataset):
def download():
if isinstance(self.geometry, Area):
self._download_area()
That would lead to a cleaner interface for the user. With a bit of work, we could try to make the geometry adhere (almost) to geojson.
Challenge: options for area or multipoint might need different other fields on the class.
Opportunity: perhaps we could use multimethod to overload the load function for different geometries?
192 already made a first step in this direction by treating Point and Points the same, and standardizing behaviour when points, area, or both are given.
We could add geometry to the baseclass as a union of the three main geometries that we use now:
Then, for each data source, we could suffice with a single class with multiple loaders, e.g.
That would lead to a cleaner interface for the user. With a bit of work, we could try to make the geometry adhere (almost) to geojson.
Challenge: options for area or multipoint might need different other fields on the class. Opportunity: perhaps we could use multimethod to overload the load function for different geometries?