Skip to content
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

Historical data client iterator #1

Conversation

david-natingga-frequenz

Extend the client to stream historical weather forecast data.

Add examples to demonstrate:

  • How to stream live data with the client based on Christoph's example.
  • How to stream the historical data with the client.

This is draft. The pagination needs to be implemented within the client. Right now the historical data streaming does not return any response.

cwasicki and others added 30 commits December 14, 2023 16:23
This commit updates the Dockerfile in `.github/containers/test-installation` to
prepare for the integration of the `frequenz-client-base-python` repository in
upcoming features. The modifications expand the CI test Docker image to support
this specific repository's requirements.

File modified:
- `.github/containers/test-installation/Dockerfile`

The enhancement of the Docker image is a critical step in aligning our CI
testing environment with the needs of the `frequenz-client-base-python`
repository. This repository will play a significant role in future developments,
and its integration requires a Docker image equipped with additional tools and
dependencies for Git repository management. By updating the Dockerfile, we
ensure that our CI tests remain effective and are fully prepared for the
complexities and functionalities introduced by integrating the
`frequenz-client-base-python` repo. This proactive update is essential for
maintaining the efficiency and accuracy of our CI processes in light of these
new developments.

Signed-off-by: noah-kreutzer-frequenz <[email protected]>
…requenz-floss#64)

This commit updates the Dockerfile in
`.github/containers/test-installation` to prepare for the integration of
the `frequenz-client-base-python` repository in upcoming features. The
modifications expand the CI test Docker image to support this specific
repository's requirements.

File modified:
- `.github/containers/test-installation/Dockerfile`

The enhancement of the Docker image is a critical step in aligning our
CI testing environment with the needs of the
`frequenz-client-base-python` repository. This repository will play a
significant role in future developments, and its integration requires a
Docker image equipped with additional tools and dependencies for Git
repository management. By updating the Dockerfile, we ensure that our CI
tests remain effective and are fully prepared for the complexities and
functionalities introduced by integrating the
`frequenz-client-base-python` repo. This proactive update is essential
for maintaining the efficiency and accuracy of our CI processes in light
of these new developments.
This commit copies the location.proto from the
frequenz-api-common repo into this repo.

Signed-off-by: TalweSingh <[email protected]>
This commit copies the pagination params
proto files from the frequenz-api-common repo into this repo.

Signed-off-by: TalweSingh <[email protected]>
Instead of importing from the frequenz-api-common repo,
the weather.proto imports from the local files instead.

Signed-off-by: TalweSingh <[email protected]>
Signed-off-by: TalweSingh <[email protected]>
Signed-off-by: TalweSingh <[email protected]>
…s#65)

The weather API uses protobuf types `location` and `pagination` defined
in `frequenz-api-common` v0.5.0. But Frequenz SDK v0.25 is not
compatible with `frequenz-api-common` v0.5.0.

For the weather API client to be able to work with the SDK, this PR
temporarily removes the dependency on `frequenz-api-common`, and adds
the definitions for `location` and `pagination` into this repo.

This will be reverted once the SDK has been updated to use a newer
version of `frequenz-api-common`.
This commit introduces a simple Weather API client, leveraging the
frequenz-client-base-python framework.

The client is designed to handle requests consisting of location and
feature object lists. It efficiently communicates with the server
using the frequenz-client-base-python, receiving a grpc stream from
the weather service.

Additionally, the client features a receiver that filters the stream
as required and organizes the data into a 3D numpy array. This setup
ensures efficient handling and structuring of weather data.

Comprehensive tests have been added to validate the functionality of
the types defined for this implementation. Tests for the client still
need to be implemented.

- Utilizes frequenz-client-base-python for server communication
- Receives and processes grpc stream from weather service
- Filters stream data based on demand
- Structures data into a 3D numpy array
- Includes tests for validation of new types

Signed-off-by: noah-kreutzer-frequenz <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
This PR adds a high level client for the weather API.

It currently only provides a channel-based interface for streaming
live weather forecasts.  Support for historical data will be added
in subsequent PRs.
Signed-off-by: Sahas Subramanian <[email protected]>
This adds the northward and eastward components for wind at 10 m
altitude.
We do so by customizing the noxfile repo config to include the
`py/frequenz/client` directory as a source path.

Signed-off-by: Leandro Lucarella <[email protected]>
- mypy: Check also the `frequenz.client.weather` package
- Run other linters to the client code
Rather than a namespace path.

Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Also improve typing of 3D numpy array.

Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
nox checks weren't running on the client code, so these were not caught
earlier. that has been resolved since, and this PR updates the code to
comply with the checks.
cwasicki and others added 10 commits January 4, 2024 10:35
Altitude usually refers to above sea level.
Signed-off-by: Sahas Subramanian <[email protected]>
The template is cleared and a summary is added. This commit will be the
base of the v0.2.0 release.
According to issue frequenz-floss#77 a refined version of to_ndarray_vfl() to_ndarray_vfl_refined() was added to the repo.
to_ndarray_vfl_refined() in comparision to the base function takes the validity_times to filter for
in form of a list of datetime objects instead of a list of timedelta relative to the request.

Signed-off-by: noah-kreutzer-frequenz <[email protected]>
Restructure the test_types.py to reuse certain test variables and aligne with the pylint requirements

Signed-off-by: noah-kreutzer-frequenz <[email protected]>
… (frequenz-floss#80)

According to issue frequenz-floss#77 a refined version of to_ndarray_vfl()
to_ndarray_vfl_refined() was added to the repo. to_ndarray_vfl_refined()
in comparision to the base function takes the validity_times to filter
for in form of a list datetime Time objects instead of a list of
timedelta relative to the request.
Add examples to demonstrate:
- How to stream live data with the client.
- How to stream the historical data with the client.
@david-natingga-frequenz
Copy link
Author

Made here by mistake. The actual PR is here: frequenz-floss#85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants