Skip to content

Commit

Permalink
rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
junzis committed Oct 30, 2023
1 parent 063a01f commit c0cd850
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ flight = pd.DataFrame(
)

# define the location for local store
mmg = Grid(local_store="/tmp/era5-zarr")
fmg = Grid(local_store="/tmp/era5-zarr")

# obtain weather information
flight_new = mmg.interpolate(flight)
flight_new = fmg.interpolate(flight)

```

Expand Down
6 changes: 3 additions & 3 deletions fastmeteo/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pandas as pd
from . import Grid

mmg = Grid()
fmg = Grid()
app = FastAPI()


Expand All @@ -27,15 +27,15 @@ def serialize(flight_df: pd.DataFrame) -> dict:
@app.post("/submit_flight/", response_model=Dict)
async def submit_flight(flight_request: FlightRequest):
flight = deserialize(flight_request.data)
flight_new = mmg.interpolate(flight)
flight_new = fmg.interpolate(flight)
return serialize(flight_new)


@click.command()
@click.option("--local-store", required="true", help="local era5 zarr store path")
@click.option("--port", default=9800, help="listening on port")
def main(local_store, port):
mmg.set_local_path(local_store)
fmg.set_local_path(local_store)
uvicorn.run(app, host="0.0.0.0", port=port)


Expand Down
4 changes: 2 additions & 2 deletions test/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
)

# define the location for local store
mmg = Grid(local_store="/tmp/era5-zarr")
fmg = Grid(local_store="/tmp/era5-zarr")

# obtain weather information
flight_new = mmg.interpolate(flight)
flight_new = fmg.interpolate(flight)

print(flight)
print(flight_new)

0 comments on commit c0cd850

Please sign in to comment.