forked from frequenz-floss/frequenz-api-weather
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
layout python python3.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
SSH tunnel tested | ||
``` | ||
ssh -N -L 50051:fz-0003.frequenz.io:50051 fz-0003.frequenz.io | ||
ssh -N -L 50051:localhost:50051 fz-0003.frequenz.io | ||
ssh -N -L 50051:0.0.0.0:50051 fz-0003.frequenz.io | ||
``` | ||
|
||
SSH diagnostics | ||
``` | ||
netstat -tuln | grep 50051 | ||
telnet localhost 50051 | ||
nc -vz localhost 50051 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#git+https://github.com/noah-kreutzer-frequenz/frequenz-api-weather@client_noah | ||
#git+https://github.com/cwasicki/frequenz-api-weather@client_wc | ||
git+https://github.com/cwasicki/frequenz-api-weather@noah |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import asyncio | ||
from frequenz.client.weather._client import Client | ||
from frequenz.client.weather._types import ForecastFeature, Location | ||
import grpc.aio as grpcaio | ||
|
||
|
||
|
||
async def main(): | ||
target="localhost:50051" | ||
|
||
client = Client( | ||
grpcaio.insecure_channel(target), # or secure channel with credentials | ||
target, | ||
) | ||
|
||
features = [ | ||
ForecastFeature.V_WIND_COMPONENT_100_METRE, | ||
ForecastFeature.U_WIND_COMPONENT_100_METRE, | ||
] | ||
|
||
locations = [ | ||
Location( | ||
latitude=52.5, | ||
longitude=13.4, | ||
country_code="DE", | ||
), | ||
] | ||
|
||
stream = await client.stream_live_forecast( | ||
features=features, | ||
locations=locations, | ||
) | ||
|
||
async for fc in stream: | ||
print(fc) | ||
print(fc.to_ndarray_vlf()) | ||
print(fc.to_ndarray_vlf( | ||
features=[ForecastFeature.U_WIND_COMPONENT_100_METRE], | ||
)) | ||
|
||
asyncio.run(main()) |