Skip to content
This repository was archived by the owner on May 2, 2024. It is now read-only.

Add data_source module #92

Merged
merged 12 commits into from
Nov 24, 2023
Merged

Add data_source module #92

merged 12 commits into from
Nov 24, 2023

Conversation

cfkanesan
Copy link
Collaborator

Purpose

The goal is extract the logic regarding the fetching of data from the construction of the xarray dataset. The DataSource class takes over the responsibility of:

  • loading the appropriate GRIB definitions based on the data_scope with a fallback on the request model field
  • dispatching the request to either given datafiles or an FDB instance
  • injecting contextual values into the request

Driving the data loading based on the product descriptions will be handled in a future PR.

Code changes:

  • Add data_source module
  • Breaking: removed the load_fields method from the GribReader class
  • Breaking: the load method of GribReader class now takes a mapping of labels to requests and returns a mapping of labels to xarray.DataArray

@victoria-cherkas victoria-cherkas self-requested a review November 24, 2023 10:25
Copy link
Collaborator

@victoria-cherkas victoria-cherkas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! (minus pre commit fail)

@cfkanesan cfkanesan merged commit 4c374b9 into main Nov 24, 2023
@cfkanesan cfkanesan deleted the data-source branch November 24, 2023 15:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants