Skip to content

Commit

Permalink
denominator verdict extended
Browse files Browse the repository at this point in the history
  • Loading branch information
Si2-Aung committed Jan 24, 2025
1 parent 0a25dc1 commit d582013
Show file tree
Hide file tree
Showing 7 changed files with 317 additions and 281 deletions.
264 changes: 63 additions & 201 deletions notebooks/test_existing_company_reports.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Python-dotenv could not parse statement starting at line 15\n",
"Python-dotenv could not parse statement starting at line 18\n",
"Python-dotenv could not parse statement starting at line 20\n",
"Python-dotenv could not parse statement starting at line 23\n",
"Python-dotenv could not parse statement starting at line 25\n"
]
}
],
"source": [
"from dataland_backend.models.data_type_enum import DataTypeEnum\n",
"\n",
Expand Down Expand Up @@ -70,7 +82,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"BPCE\n"
"Aktiebolaget Electrolux\n"
]
}
],
Expand All @@ -79,7 +91,7 @@
"extracted_yes_no_values = {}\n",
"\n",
"# check yes no values\n",
"for data_id, company_info in zip(data_ids[8:9], company_infos[8:9], strict=False):\n",
"for data_id, company_info in zip(data_ids[0:1], company_infos[0:1], strict=False):\n",
" print(company_info.company_name)\n",
" data = dataland_client.eu_taxonomy_nuclear_and_gas_api.get_company_associated_nuclear_and_gas_data(data_id=data_id)\n",
" data_collection = NuclearAndGasDataCollection(dataset=data.data)\n",
Expand Down Expand Up @@ -107,11 +119,11 @@
"output_type": "stream",
"text": [
"\n",
"Company: BPCE\n",
"Company: Aktiebolaget Electrolux\n",
"nuclear_energy_related_activities_section426: Dataland=YesNo.NO, Extracted=YesNo.NO\n",
"nuclear_energy_related_activities_section427: Dataland=YesNo.YES, Extracted=YesNo.YES\n",
"nuclear_energy_related_activities_section428: Dataland=YesNo.YES, Extracted=YesNo.YES\n",
"fossil_gas_related_activities_section429: Dataland=YesNo.YES, Extracted=YesNo.YES\n",
"nuclear_energy_related_activities_section427: Dataland=YesNo.NO, Extracted=YesNo.NO\n",
"nuclear_energy_related_activities_section428: Dataland=YesNo.NO, Extracted=YesNo.NO\n",
"fossil_gas_related_activities_section429: Dataland=YesNo.NO, Extracted=YesNo.NO\n",
"fossil_gas_related_activities_section430: Dataland=YesNo.NO, Extracted=YesNo.NO\n",
"fossil_gas_related_activities_section431: Dataland=YesNo.NO, Extracted=YesNo.NO\n",
"1.0\n"
Expand Down Expand Up @@ -143,46 +155,56 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Skipping company Aktiebolaget Electrolux due to missing data from Dataland: Error retrieving taxonomy-aligned revenue denominator: 'NoneType' object has no attribute 'value'\n"
]
}
],
"source": [
"numeric_values_dataland = {}\n",
"extracted_numeric_values = {}\n",
"\n",
"# check numeric values\n",
"for data_id, company_info in zip(data_ids[6:7], company_infos[6:7], strict=False):\n",
"for data_id, company_info in zip(data_ids[0:1], company_infos[0:1], strict=False):\n",
" data = dataland_client.eu_taxonomy_nuclear_and_gas_api.get_company_associated_nuclear_and_gas_data(data_id=data_id)\n",
" data_collection = NuclearAndGasDataCollection(dataset=data.data)\n",
" try:\n",
" # get values on Dataland\n",
" if company_info.company_name not in numeric_values_dataland:\n",
" numeric_values_dataland[company_info.company_name] = {}\n",
"\n",
" # get values on Dataland\n",
" if company_info.company_name not in numeric_values_dataland:\n",
" numeric_values_dataland[company_info.company_name] = {}\n",
"\n",
" numeric_values_dataland[company_info.company_name][\"aligned_revenue_denominator\"] = (\n",
" get_taxonomy_aligned_revenue_denominator_values_by_data(data=data_collection)\n",
" )\n",
" numeric_values_dataland[company_info.company_name][\"aligned_capex_denominator\"] = (\n",
" get_taxonomy_aligned_capex_denominator_values_by_data(data=data_collection)\n",
" )\n",
" numeric_values_dataland[company_info.company_name][\"aligned_revenue_numerator\"] = (\n",
" get_taxonomy_aligned_revenue_numerator_values_by_data(data=data_collection)\n",
" )\n",
" numeric_values_dataland[company_info.company_name][\"aligned_capex_numerator\"] = (\n",
" get_taxonomy_aligned_capex_numerator_values_by_data(data=data_collection)\n",
" )\n",
" numeric_values_dataland[company_info.company_name][\"not_aligned_revenue\"] = (\n",
" get_taxonomy_eligible_but_not_aligned_revenue_values_by_data(data=data_collection)\n",
" )\n",
" numeric_values_dataland[company_info.company_name][\"not_aligned_capex\"] = (\n",
" get_taxonomy_eligible_but_not_aligned_capex_values_by_data(data=data_collection)\n",
" )\n",
" numeric_values_dataland[company_info.company_name][\"non_eligible_revenue\"] = (\n",
" get_taxonomy_non_eligible_revenue_values_by_data(data=data_collection)\n",
" )\n",
" numeric_values_dataland[company_info.company_name][\"non_eligible_capex\"] = (\n",
" get_taxonomy_non_eligible_capex_values_by_data(data=data_collection)\n",
" )\n",
" numeric_values_dataland[company_info.company_name][\"aligned_revenue_denominator\"] = (\n",
" get_taxonomy_aligned_revenue_denominator_values_by_data(data=data_collection)\n",
" )\n",
" numeric_values_dataland[company_info.company_name][\"aligned_capex_denominator\"] = (\n",
" get_taxonomy_aligned_capex_denominator_values_by_data(data=data_collection)\n",
" )\n",
" numeric_values_dataland[company_info.company_name][\"aligned_revenue_numerator\"] = (\n",
" get_taxonomy_aligned_revenue_numerator_values_by_data(data=data_collection)\n",
" )\n",
" numeric_values_dataland[company_info.company_name][\"aligned_capex_numerator\"] = (\n",
" get_taxonomy_aligned_capex_numerator_values_by_data(data=data_collection)\n",
" )\n",
" numeric_values_dataland[company_info.company_name][\"not_aligned_revenue\"] = (\n",
" get_taxonomy_eligible_but_not_aligned_revenue_values_by_data(data=data_collection)\n",
" )\n",
" numeric_values_dataland[company_info.company_name][\"not_aligned_capex\"] = (\n",
" get_taxonomy_eligible_but_not_aligned_capex_values_by_data(data=data_collection)\n",
" )\n",
" numeric_values_dataland[company_info.company_name][\"non_eligible_revenue\"] = (\n",
" get_taxonomy_non_eligible_revenue_values_by_data(data=data_collection)\n",
" )\n",
" numeric_values_dataland[company_info.company_name][\"non_eligible_capex\"] = (\n",
" get_taxonomy_non_eligible_capex_values_by_data(data=data_collection)\n",
" )\n",
" except AttributeError as e:\n",
" print(f\"Skipping company {company_info.company_name} due to missing data from Dataland: {e}\")\n",
"\n",
" # get values from AI\n",
" try:\n",
Expand All @@ -209,176 +231,16 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Company: Berliner Volksbank eG\n",
"Section 0: Dataland=0, Extracted=0.0\n",
"Section 1: Dataland=0, Extracted=0.0\n",
"Section 2: Dataland=0, Extracted=0.0\n",
"Section 3: Dataland=0, Extracted=0.0\n",
"Section 4: Dataland=0, Extracted=0.0\n",
"Section 5: Dataland=0, Extracted=0.0\n",
"Section 6: Dataland=0, Extracted=0.0\n",
"Section 7: Dataland=0, Extracted=0.0\n",
"Section 8: Dataland=0, Extracted=0.0\n",
"Section 9: Dataland=0, Extracted=0.0\n",
"Section 10: Dataland=0, Extracted=0.0\n",
"Section 11: Dataland=0, Extracted=0.0\n",
"Section 12: Dataland=0, Extracted=0.0\n",
"Section 13: Dataland=0, Extracted=0.0\n",
"Section 14: Dataland=0, Extracted=0.0\n",
"Section 15: Dataland=0, Extracted=0.0\n",
"Section 16: Dataland=0, Extracted=0.0\n",
"Section 17: Dataland=0, Extracted=0.0\n",
"Section 18: Dataland=0.1, Extracted=0.1\n",
"Section 19: Dataland=0.1, Extracted=0.1\n",
"Section 20: Dataland=0, Extracted=0.0\n",
"Section 21: Dataland=0.1, Extracted=0.1\n",
"Section 22: Dataland=0.1, Extracted=0.1\n",
"Section 23: Dataland=0, Extracted=0.0\n",
"Section 24: Dataland=0, Extracted=0.0\n",
"Section 25: Dataland=0, Extracted=0.0\n",
"Section 26: Dataland=0, Extracted=0.0\n",
"Section 27: Dataland=0, Extracted=0.0\n",
"Section 28: Dataland=0, Extracted=0.0\n",
"Section 29: Dataland=0, Extracted=0.0\n",
"Section 30: Dataland=0, Extracted=0.0\n",
"Section 31: Dataland=0, Extracted=0.0\n",
"Section 32: Dataland=0, Extracted=0.0\n",
"Section 33: Dataland=0, Extracted=0.0\n",
"Section 34: Dataland=0, Extracted=0.0\n",
"Section 35: Dataland=0, Extracted=0.0\n",
"Section 36: Dataland=0, Extracted=0.0\n",
"Section 37: Dataland=0, Extracted=0.0\n",
"Section 38: Dataland=0, Extracted=0.0\n",
"Section 39: Dataland=0, Extracted=0.0\n",
"Section 40: Dataland=0, Extracted=0.0\n",
"Section 41: Dataland=0, Extracted=0.0\n",
"Section 42: Dataland=0.1, Extracted=0.1\n",
"Section 43: Dataland=0.1, Extracted=0.1\n",
"Section 44: Dataland=0, Extracted=0.0\n",
"Section 45: Dataland=0.1, Extracted=0.1\n",
"Section 46: Dataland=0.1, Extracted=0.1\n",
"Section 47: Dataland=0, Extracted=0.0\n",
"Section 48: Dataland=0, Extracted=0.0\n",
"Section 49: Dataland=0, Extracted=0.0\n",
"Section 50: Dataland=0, Extracted=0.0\n",
"Section 51: Dataland=0, Extracted=0.0\n",
"Section 52: Dataland=0, Extracted=0.0\n",
"Section 53: Dataland=0, Extracted=0.0\n",
"Section 54: Dataland=0, Extracted=0.0\n",
"Section 55: Dataland=0, Extracted=0.0\n",
"Section 56: Dataland=0, Extracted=0.0\n",
"Section 57: Dataland=0, Extracted=0.0\n",
"Section 58: Dataland=0, Extracted=0.0\n",
"Section 59: Dataland=0, Extracted=0.0\n",
"Section 60: Dataland=0, Extracted=0.0\n",
"Section 61: Dataland=0, Extracted=0.0\n",
"Section 62: Dataland=0, Extracted=0.0\n",
"Section 63: Dataland=0, Extracted=0.0\n",
"Section 64: Dataland=0, Extracted=0.0\n",
"Section 65: Dataland=0, Extracted=0.0\n",
"Section 66: Dataland=100, Extracted=100.0\n",
"Section 67: Dataland=100, Extracted=100.0\n",
"Section 68: Dataland=0, Extracted=0.0\n",
"Section 69: Dataland=100, Extracted=100.0\n",
"Section 70: Dataland=100, Extracted=100.0\n",
"Section 71: Dataland=0, Extracted=0.0\n",
"Section 72: Dataland=0, Extracted=0.0\n",
"Section 73: Dataland=0, Extracted=0.0\n",
"Section 74: Dataland=0, Extracted=0.0\n",
"Section 75: Dataland=0, Extracted=0.0\n",
"Section 76: Dataland=0, Extracted=0.0\n",
"Section 77: Dataland=0, Extracted=0.0\n",
"Section 78: Dataland=0, Extracted=0.0\n",
"Section 79: Dataland=0, Extracted=0.0\n",
"Section 80: Dataland=0, Extracted=0.0\n",
"Section 81: Dataland=0, Extracted=0.0\n",
"Section 82: Dataland=0, Extracted=0.0\n",
"Section 83: Dataland=0, Extracted=0.0\n",
"Section 84: Dataland=0, Extracted=0.0\n",
"Section 85: Dataland=0, Extracted=0.0\n",
"Section 86: Dataland=0, Extracted=0.0\n",
"Section 87: Dataland=0, Extracted=0.0\n",
"Section 88: Dataland=0, Extracted=0.0\n",
"Section 89: Dataland=0, Extracted=0.0\n",
"Section 90: Dataland=100, Extracted=100.0\n",
"Section 91: Dataland=100, Extracted=100.0\n",
"Section 92: Dataland=0, Extracted=0.0\n",
"Section 93: Dataland=100, Extracted=100.0\n",
"Section 94: Dataland=100, Extracted=100.0\n",
"Section 95: Dataland=0, Extracted=0.0\n",
"Section 96: Dataland=0, Extracted=0.0\n",
"Section 97: Dataland=0, Extracted=0.0\n",
"Section 98: Dataland=0, Extracted=0.0\n",
"Section 99: Dataland=0, Extracted=0.0\n",
"Section 100: Dataland=0, Extracted=0.0\n",
"Section 101: Dataland=0, Extracted=0.0\n",
"Section 102: Dataland=0, Extracted=0.0\n",
"Section 103: Dataland=0, Extracted=0.0\n",
"Section 104: Dataland=0, Extracted=0.0\n",
"Section 105: Dataland=0, Extracted=0.0\n",
"Section 106: Dataland=0, Extracted=0.0\n",
"Section 107: Dataland=0, Extracted=0.0\n",
"Section 108: Dataland=0, Extracted=0.0\n",
"Section 109: Dataland=0, Extracted=0.0\n",
"Section 110: Dataland=0, Extracted=0.0\n",
"Section 111: Dataland=0, Extracted=0.0\n",
"Section 112: Dataland=0, Extracted=0.0\n",
"Section 113: Dataland=0, Extracted=0.0\n",
"Section 114: Dataland=7.82, Extracted=7.82\n",
"Section 115: Dataland=7.82, Extracted=7.82\n",
"Section 116: Dataland=0, Extracted=0.0\n",
"Section 117: Dataland=7.82, Extracted=7.82\n",
"Section 118: Dataland=7.82, Extracted=7.82\n",
"Section 119: Dataland=0, Extracted=0.0\n",
"Section 120: Dataland=0, Extracted=0.0\n",
"Section 121: Dataland=0, Extracted=0.0\n",
"Section 122: Dataland=0, Extracted=0.0\n",
"Section 123: Dataland=0, Extracted=0.0\n",
"Section 124: Dataland=0, Extracted=0.0\n",
"Section 125: Dataland=0, Extracted=0.0\n",
"Section 126: Dataland=0, Extracted=0.0\n",
"Section 127: Dataland=0, Extracted=0.0\n",
"Section 128: Dataland=0, Extracted=0.0\n",
"Section 129: Dataland=0, Extracted=0.0\n",
"Section 130: Dataland=0, Extracted=0.0\n",
"Section 131: Dataland=0, Extracted=0.0\n",
"Section 132: Dataland=0, Extracted=0.0\n",
"Section 133: Dataland=0, Extracted=0.0\n",
"Section 134: Dataland=0, Extracted=0.0\n",
"Section 135: Dataland=0, Extracted=0.0\n",
"Section 136: Dataland=0, Extracted=0.0\n",
"Section 137: Dataland=0, Extracted=0.0\n",
"Section 138: Dataland=7.82, Extracted=7.82\n",
"Section 139: Dataland=7.82, Extracted=7.82\n",
"Section 140: Dataland=0, Extracted=0.0\n",
"Section 141: Dataland=7.82, Extracted=7.82\n",
"Section 142: Dataland=7.82, Extracted=7.82\n",
"Section 143: Dataland=0, Extracted=0.0\n",
"Section 144: Dataland=0, Extracted=0.0\n",
"Section 145: Dataland=0, Extracted=0.0\n",
"Section 146: Dataland=0, Extracted=0.0\n",
"Section 147: Dataland=0, Extracted=0.0\n",
"Section 148: Dataland=0, Extracted=0.0\n",
"Section 149: Dataland=0, Extracted=0.0\n",
"Section 150: Dataland=4.17, Extracted=4.17\n",
"Section 151: Dataland=4.17, Extracted=4.17\n",
"Section 152: Dataland=0, Extracted=0.0\n",
"Section 153: Dataland=0, Extracted=0.0\n",
"Section 154: Dataland=0, Extracted=0.0\n",
"Section 155: Dataland=0, Extracted=0.0\n",
"Section 156: Dataland=0, Extracted=0.0\n",
"Section 157: Dataland=0, Extracted=0.0\n",
"Section 158: Dataland=4.17, Extracted=4.17\n",
"Section 159: Dataland=4.17, Extracted=4.17\n",
"Matching ratio: 100.00%\n"
"Company: Aktiebolaget Electrolux\n",
"Matching ratio: 0.00%\n"
]
}
],
Expand Down
Loading

0 comments on commit d582013

Please sign in to comment.