Spaces:
Build error
Build error
Remove references to biodiversity to make it more general
Browse files- app.py +2 -4
- utils/indicators.py +1 -1
app.py
CHANGED
@@ -17,15 +17,13 @@ with gr.Blocks() as demo:
|
|
17 |
with gr.Row():
|
18 |
view_btn = gr.Button(value="Show project map")
|
19 |
calc_btn = gr.Button(value="Calculate!")
|
20 |
-
# save_btn = gr.Button(value="Save")
|
21 |
results_df = gr.Dataframe(
|
22 |
headers=["Year", "Project Name", "Score"],
|
23 |
datatype=["number", "str", "number"],
|
24 |
-
label="
|
25 |
-
row_count=0,
|
26 |
)
|
27 |
calc_btn.click(
|
28 |
-
indexgenerator.
|
29 |
inputs=[start_year, end_year],
|
30 |
outputs=results_df,
|
31 |
)
|
|
|
17 |
with gr.Row():
|
18 |
view_btn = gr.Button(value="Show project map")
|
19 |
calc_btn = gr.Button(value="Calculate!")
|
|
|
20 |
results_df = gr.Dataframe(
|
21 |
headers=["Year", "Project Name", "Score"],
|
22 |
datatype=["number", "str", "number"],
|
23 |
+
label="Scores by year",
|
|
|
24 |
)
|
25 |
calc_btn.click(
|
26 |
+
indexgenerator.calculate_score,
|
27 |
inputs=[start_year, end_year],
|
28 |
outputs=results_df,
|
29 |
)
|
utils/indicators.py
CHANGED
@@ -294,7 +294,7 @@ class IndexGenerator:
|
|
294 |
|
295 |
return fig
|
296 |
|
297 |
-
def
|
298 |
years = []
|
299 |
for year in range(start_year, end_year):
|
300 |
row_exists = dq.check_if_project_exists_for_year(self.project_name, year)
|
|
|
294 |
|
295 |
return fig
|
296 |
|
297 |
+
def calculate_score(self, start_year, end_year):
|
298 |
years = []
|
299 |
for year in range(start_year, end_year):
|
300 |
row_exists = dq.check_if_project_exists_for_year(self.project_name, year)
|