Spaces:
Build error
Build error
Deleted some print statements
Browse files
app.py
CHANGED
@@ -206,7 +206,6 @@ def authenticate_ee(ee_service_account):
|
|
206 |
Huggingface Spaces does not support secret files, therefore authenticate with an environment variable containing the JSON.
|
207 |
"""
|
208 |
logging.info("authenticate_ee")
|
209 |
-
# print(os.environ.keys())
|
210 |
credentials = ee.ServiceAccountCredentials(
|
211 |
ee_service_account, key_data=os.environ["ee_service_account"]
|
212 |
)
|
@@ -244,7 +243,6 @@ def filter_map():
|
|
244 |
prepared_statement = \
|
245 |
con.execute("SELECT geometry FROM project WHERE name = ? LIMIT 1",
|
246 |
["My project name"]).fetchall()
|
247 |
-
print(prepared_statement)
|
248 |
features = \
|
249 |
json.loads(prepared_statement[0][0].replace("\'", "\""))['features']
|
250 |
geometry = features[0]['geometry']
|
@@ -296,8 +294,6 @@ def calculate_biodiversity_score(start_year, end_year, project_name):
|
|
296 |
USE climatebase;
|
297 |
CREATE TABLE IF NOT EXISTS bioindicator (year BIGINT, project_name VARCHAR(255), value DOUBLE, area DOUBLE, score DOUBLE, CONSTRAINT unique_year_project_name UNIQUE (year, project_name));
|
298 |
""")
|
299 |
-
print(con.execute("SELECT * FROM bioindicator WHERE (year > ? AND year <= ? AND project_name = ?)",
|
300 |
-
[start_year, end_year, project_name]).fetchall())
|
301 |
scores = \
|
302 |
con.execute("SELECT * FROM bioindicator WHERE (year > ? AND year <= ? AND project_name = ?)",
|
303 |
[start_year, end_year, project_name]).fetchall().df()
|
|
|
206 |
Huggingface Spaces does not support secret files, therefore authenticate with an environment variable containing the JSON.
|
207 |
"""
|
208 |
logging.info("authenticate_ee")
|
|
|
209 |
credentials = ee.ServiceAccountCredentials(
|
210 |
ee_service_account, key_data=os.environ["ee_service_account"]
|
211 |
)
|
|
|
243 |
prepared_statement = \
|
244 |
con.execute("SELECT geometry FROM project WHERE name = ? LIMIT 1",
|
245 |
["My project name"]).fetchall()
|
|
|
246 |
features = \
|
247 |
json.loads(prepared_statement[0][0].replace("\'", "\""))['features']
|
248 |
geometry = features[0]['geometry']
|
|
|
294 |
USE climatebase;
|
295 |
CREATE TABLE IF NOT EXISTS bioindicator (year BIGINT, project_name VARCHAR(255), value DOUBLE, area DOUBLE, score DOUBLE, CONSTRAINT unique_year_project_name UNIQUE (year, project_name));
|
296 |
""")
|
|
|
|
|
297 |
scores = \
|
298 |
con.execute("SELECT * FROM bioindicator WHERE (year > ? AND year <= ? AND project_name = ?)",
|
299 |
[start_year, end_year, project_name]).fetchall().df()
|