Skip to content

Avoid direct dependence on earthkit-meteo #892

@Oisin-M

Description

@Oisin-M

What happened?

We currently require earthkit-meteo as an non-optional dependency for earthkit data, even though it is barely used i.e. only here:

def toa_incident_solar_radiation(self, date):
from earthkit.meteo.solar import toa_incident_solar_radiation
date = to_datetime(date)
result = toa_incident_solar_radiation(
date - datetime.timedelta(minutes=30),
date + datetime.timedelta(minutes=30),
self.latitude_(),
self.longitude_(),
intervals_per_hour=2,
)
return result.flatten()
def cos_solar_zenith_angle(self, date):
from earthkit.meteo.solar import cos_solar_zenith_angle
date = to_datetime(date)
result = cos_solar_zenith_angle(
date,
self.latitude_(),
self.longitude_(),
)
return result.flatten()

It would be better to have it optional in order to avoid any circular dependency issues in future should earthkit-meteo require functionality from earthkit-data.

What are the steps to reproduce the bug?

Version

latest

Platform (OS and architecture)

any

Relevant log output

Accompanying data

No response

Organisation

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions