Skip to content

Commit 716964e

Browse files
authored
Merge pull request #249 from IFCA-Advanced-Computing/dev/gbif_data
Dev/gbif data
2 parents 81b8827 + ffc7c30 commit 716964e

File tree

3 files changed

+16
-33
lines changed

3 files changed

+16
-33
lines changed

plugins/gbif/gbif_data.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -399,12 +399,12 @@ def geographic_percentajes(df):
399399
Geographic: 63.45%
400400
{'Geographic': 63.45, 'Coordinates': 25.6, 'Countries': 15.2, 'CoordinatesUncertainty': 18.9, 'IncorrectCoordinates': 3.75}
401401
"""
402-
__BD_BORDERS = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
403-
# Total de ocurrencias
404-
total_data = len(df)
405-
406-
# Porcentaje de ocurrencias con coordenadas válidas (latitud y longitud presentes)
407402
try:
403+
__BD_BORDERS = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
404+
# Total de ocurrencias
405+
total_data = len(df)
406+
407+
# Porcentaje de ocurrencias con coordenadas válidas (latitud y longitud presentes)
408408
percentaje_coordinates = (
409409
len(df[df["decimalLatitude"].notnull() & df["decimalLongitude"].notnull()])
410410
/ total_data
@@ -459,13 +459,15 @@ def geographic_percentajes(df):
459459
percentaje_incorrect_coordinates = 0
460460

461461
# Porcentaje total de calidad geográfica combinando los porcentajes ponderados
462-
percentaje_geographic = (
463-
0.2 * percentaje_coordinates
464-
+ 0.1 * percentaje_countries
465-
+ 0.05 * percentaje_coordinates_uncertainty
466-
- 0.2 * percentaje_incorrect_coordinates
467-
) / 0.35
468-
462+
percentaje_geographic = 0
463+
try:
464+
percentaje_geographic += 0.2 * percentaje_coordinates
465+
percentaje_geographic += 0.1 * percentaje_countries
466+
percentaje_geographic += 0.05 * percentaje_coordinates_uncertainty
467+
percentaje_geographic -= 0.2 * percentaje_incorrect_coordinates
468+
percentaje_geographic = percentaje_geographic / 0.35
469+
except Exception as e:
470+
logging.error(e)
469471
return {
470472
"Geographic": percentaje_geographic,
471473
"Coordinates": percentaje_coordinates,

plugins/gbif/plugin.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -376,23 +376,3 @@ def data_01(self):
376376
except Exception as e:
377377
logging.error(e)
378378
return (points, msg)
379-
380-
def data_02(self):
381-
"""Data test.
382-
383-
Technical proposal:
384-
385-
Parameters
386-
----------
387-
388-
Returns
389-
-------
390-
points
391-
A number between 0 and 100 to indicate how well this indicator is supported
392-
msg
393-
Message with the results or recommendations to improve this indicator
394-
"""
395-
# TO REDEFINE
396-
points = 100
397-
msg = _("I'm doing nothing")
398-
return (points, msg)

web.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ def evaluator():
300300
logger.debug("RDA_ALL test completed")
301301
resultis = result.json()
302302
for key in resultis:
303-
result = resultis[key]
303+
if key != "evaluator_logs":
304+
result = resultis[key]
304305
result_points = 0
305306
weight_of_tests = 0
306307
for key in result:

0 commit comments

Comments
 (0)