Spaces:
Build error
Build error
pgzmnk
commited on
Commit
·
27f7acd
1
Parent(s):
9324baf
Cleanup comments and logs.
Browse files
app.py
CHANGED
@@ -169,6 +169,7 @@ class IndexGenerator:
|
|
169 |
"value": list(map(self.zonal_mean_index, indices)),
|
170 |
"area": self.roi.area().getInfo(), # m^2
|
171 |
"geojson": str(self.roi.getInfo()),
|
|
|
172 |
}
|
173 |
|
174 |
print("data", data)
|
@@ -306,45 +307,7 @@ def push_to_md():
|
|
306 |
ON CONFLICT (year, project_name) DO UPDATE SET value = excluded.value;
|
307 |
"""
|
308 |
)
|
309 |
-
print("
|
310 |
-
|
311 |
-
|
312 |
-
# preview_table()
|
313 |
-
|
314 |
-
|
315 |
-
def filter_map(min_price, max_price, boroughs):
|
316 |
-
filtered_df = df[
|
317 |
-
(df["neighbourhood_group"].isin(boroughs))
|
318 |
-
& (df["price"] > min_price)
|
319 |
-
& (df["price"] < max_price)
|
320 |
-
]
|
321 |
-
names = filtered_df["name"].tolist()
|
322 |
-
prices = filtered_df["price"].tolist()
|
323 |
-
text_list = [(names[i], prices[i]) for i in range(0, len(names))]
|
324 |
-
fig = go.Figure(
|
325 |
-
go.Scattermapbox(
|
326 |
-
customdata=text_list,
|
327 |
-
lat=filtered_df["latitude"].tolist(),
|
328 |
-
lon=filtered_df["longitude"].tolist(),
|
329 |
-
mode="markers",
|
330 |
-
marker=go.scattermapbox.Marker(size=6),
|
331 |
-
hoverinfo="text",
|
332 |
-
hovertemplate="<b>Name</b>: %{customdata[0]}<br><b>Price</b>: $%{customdata[1]}",
|
333 |
-
)
|
334 |
-
)
|
335 |
-
|
336 |
-
fig.update_layout(
|
337 |
-
mapbox_style="open-street-map",
|
338 |
-
hovermode="closest",
|
339 |
-
mapbox=dict(
|
340 |
-
bearing=0,
|
341 |
-
center=go.layout.mapbox.Center(lat=40.67, lon=-73.90),
|
342 |
-
pitch=0,
|
343 |
-
zoom=9,
|
344 |
-
),
|
345 |
-
)
|
346 |
-
|
347 |
-
return fig
|
348 |
|
349 |
|
350 |
with gr.Blocks() as demo:
|
|
|
169 |
"value": list(map(self.zonal_mean_index, indices)),
|
170 |
"area": self.roi.area().getInfo(), # m^2
|
171 |
"geojson": str(self.roi.getInfo()),
|
172 |
+
# to-do: coefficient
|
173 |
}
|
174 |
|
175 |
print("data", data)
|
|
|
307 |
ON CONFLICT (year, project_name) DO UPDATE SET value = excluded.value;
|
308 |
"""
|
309 |
)
|
310 |
+
print("upsert records into motherduck")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
|
312 |
|
313 |
with gr.Blocks() as demo:
|