Commit 358dee2e authored by Marius Kriegerowski's avatar Marius Kriegerowski
Browse files

optimize imports increase timout

parent d5ec7a38
Pipeline #36971 failed with stage
in 4 minutes and 38 seconds
...@@ -13,12 +13,11 @@ from fastapi import FastAPI, Body, HTTPException ...@@ -13,12 +13,11 @@ from fastapi import FastAPI, Body, HTTPException
from fastapi.responses import FileResponse from fastapi.responses import FileResponse
from geopy.adapters import AioHTTPAdapter from geopy.adapters import AioHTTPAdapter
from geopy.geocoders import Nominatim from geopy.geocoders import Nominatim
from obspy.io.quakeml.core import Unpickler
from starlette.background import BackgroundTask from starlette.background import BackgroundTask
from losscalculator.damage_calculator import damage_calculator from losscalculator.damage_calculator import damage_calculator
from losscalculator.ground_motion import GMField from losscalculator.ground_motion import GMField
from obspy.io.quakeml.core import Unpickler
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -92,6 +91,7 @@ async def region_from_event(event_quakeml: str) -> str: ...@@ -92,6 +91,7 @@ async def region_from_event(event_quakeml: str) -> str:
async with Nominatim( async with Nominatim(
user_agent="losscalculator", user_agent="losscalculator",
adapter_factory=AioHTTPAdapter, adapter_factory=AioHTTPAdapter,
timeout=3,
) as geolocator: ) as geolocator:
location = await geolocator.reverse(f"{origin.latitude},{origin.longitude}") location = await geolocator.reverse(f"{origin.latitude},{origin.longitude}")
...@@ -144,10 +144,7 @@ async def loss(event_quakeml: str = Body(...)): ...@@ -144,10 +144,7 @@ async def loss(event_quakeml: str = Body(...)):
print("created temporary result file", result_filepath) print("created temporary result file", result_filepath)
damage_calculator( damage_calculator(
# exposure_filepath=exposure,
# fragility_source=fragility,
intensity_measure_map_filepath=intensity_map, intensity_measure_map_filepath=intensity_map,
# taxonomy_map_filepath=taxonomy,
gm_field=gm_field, gm_field=gm_field,
use_xml_fragilities=False, use_xml_fragilities=False,
result_filepath=result_filepath, result_filepath=result_filepath,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment