Skip to content
Snippets Groups Projects
Commit 97a63a0e authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Move new excel files to test data and fix excel parsing code to do 1 file access per function call.

Use bulk inserts after deleting the data, instead of merges. Merge within the code where necessary.
parent c348608a
Branches
Tags
No related merge requests found
import logging
import openpyxl
from pathlib import Path
from compendium_v2.conversion import mapping
from compendium_v2.db.presentation_model_enums import CarryMechanism, ConnectivityCoverage, MonitoringMethod, \
UserCategory, FeeType, YesNoPlanned
from compendium_v2.environment import setup_logging
from compendium_v2.resources import get_resource_file_path
setup_logging()
logger = logging.getLogger(__name__)
EXCEL_FILE_ORGANISATION = get_resource_file_path("2021_Organisation_DataSeries.xlsx")
EXCEL_FILE_USERS = get_resource_file_path("2022_Connected_Users_DataSeries.xlsx")
EXCEL_FILE_NETWORKS = get_resource_file_path("2022_Networks_DataSeries.xlsx")
EXCEL_FILE_NREN_SERVICES = get_resource_file_path("NREN-Services-prefills_2023_Recovered.xlsx")
EXCEL_FILE_ORGANISATION = openpyxl.load_workbook(str(Path(__file__).resolve(
).parent.parent / "resources" / "2021_Organisation_DataSeries.xlsx"), data_only=True, read_only=True)
EXCEL_FILE_USERS = openpyxl.load_workbook(str(Path(__file__).resolve(
).parent.parent / "resources" / "2022_Connected_Users_DataSeries.xlsx"), data_only=True, read_only=True)
EXCEL_FILE_NETWORKS = openpyxl.load_workbook(str(Path(__file__).resolve(
).parent.parent / "resources" / "2022_Networks_DataSeries.xlsx"), data_only=True, read_only=True)
EXCEL_FILE_NREN_SERVICES = openpyxl.load_workbook(str(Path(__file__).resolve(
).parent.parent / "resources" / "NREN-Services-prefills_2023_Recovered.xlsx"), data_only=True, read_only=True)
def fetch_budget_excel_data():
# load the xlsx file
sheet_name = "1. Budget"
wb = openpyxl.load_workbook(EXCEL_FILE_ORGANISATION, data_only=True, read_only=True)
# select the active worksheet
ws = wb[sheet_name]
# iterate over the rows in the worksheet
for row in range(14, 58):
for col in range(3, 9):
# extract the data from the row
nren = ws.cell(row=row, column=2).value
budget = ws.cell(row=row, column=col).value
year = ws.cell(row=13, column=col).value
ws = EXCEL_FILE_ORGANISATION["1. Budget"]
for row in ws.iter_rows(min_row=14, max_row=58, min_col=1, max_col=8):
nren = row[1].value
for i, year in zip(range(3, 8), reversed(range(2016, 2021))):
budget = row[i].value
if budget is not None:
budget = round(budget / 1000000, 2)
assert isinstance(nren, str) and isinstance(budget, float) and isinstance(year, int)
yield nren.upper(), budget, year
def fetch_funding_excel_data():
# load the xlsx file
wb = openpyxl.load_workbook(EXCEL_FILE_ORGANISATION, data_only=True, read_only=True)
# select the active worksheet
sheet_name = "2. Income Sources"
ws = wb[sheet_name]
ws2 = wb["Income Sources table"]
ws = EXCEL_FILE_ORGANISATION["2. Income Sources"]
ws2 = EXCEL_FILE_ORGANISATION["Income Sources table"]
def hard_number_convert(s, source_name, nren, year):
if s is None:
......@@ -60,15 +50,16 @@ def fetch_funding_excel_data():
# iterate over the rows in the worksheet
def create_points_for_year_until_2017(start_row, end_row, year, col_nren, col_start):
for row in range(start_row, end_row):
for row in ws.iter_rows(min_row=start_row, max_row=end_row, min_col=col_nren, max_col=col_start+5):
offset = col_start - col_nren
# extract the data from the row
nren = ws.cell(row=row, column=col_nren).value
client_institution = ws.cell(row=row, column=col_start).value
commercial = ws.cell(row=row, column=col_start + 1).value
geant_subsidy = ws.cell(row=row, column=col_start + 2).value
gov_public_bodies = ws.cell(row=row, column=col_start + 3).value
other_european_funding = ws.cell(row=row, column=col_start + 4).value
other = ws.cell(row=row, column=col_start + 5).value
nren = row[0].value
client_institution = row[offset].value
commercial = row[offset+1].value
geant_subsidy = row[offset+2].value
gov_public_bodies = row[offset+3].value
other_european_funding = row[offset+4].value
other = row[offset+5].value
client_institution = hard_number_convert(client_institution, "client institution", nren, year)
commercial = hard_number_convert(commercial, "commercial", nren, year)
......@@ -84,14 +75,15 @@ def fetch_funding_excel_data():
yield (nren.upper(), year, client_institution, european_funding, gov_public_bodies, commercial, other)
def create_points_for_year_from_2018(sheet, start_row, end_row, year, nren_col, col_start):
for row in range(start_row, end_row):
for row in sheet.iter_rows(min_row=start_row, max_row=end_row, min_col=nren_col, max_col=col_start+4):
offset = col_start - nren_col
# extract the data from the row
nren = sheet.cell(row=row, column=nren_col).value
client_institution = sheet.cell(row=row, column=col_start).value
european_funding = sheet.cell(row=row, column=col_start + 1).value
gov_public_bodies = sheet.cell(row=row, column=col_start + 2).value
commercial = sheet.cell(row=row, column=col_start + 3).value
other = sheet.cell(row=row, column=col_start + 4).value
nren = row[0].value
client_institution = row[offset].value
european_funding = row[offset+1].value
gov_public_bodies = row[offset+2].value
commercial = row[offset+3].value
other = row[offset+4].value
client_institution = hard_number_convert(client_institution, "client institution", nren, year)
european_funding = hard_number_convert(european_funding, "european funding", nren, year)
......@@ -123,12 +115,7 @@ def fetch_funding_excel_data():
def fetch_charging_structure_excel_data():
# load the xlsx file
wb = openpyxl.load_workbook(EXCEL_FILE_ORGANISATION, data_only=True, read_only=True)
# select the active worksheet
sheet_name = "3. Charging mechanism"
ws = wb[sheet_name]
ws = EXCEL_FILE_ORGANISATION["3. Charging mechanism"]
# iterate over the rows in the worksheet
def create_points_for_2021(start_row, end_row, year, col_start):
......@@ -190,12 +177,7 @@ def fetch_charging_structure_excel_data():
def fetch_staffing_excel_data():
# load the xlsx file
wb = openpyxl.load_workbook(EXCEL_FILE_ORGANISATION, data_only=True, read_only=True)
# select the active worksheet
sheet_name = "4. Staff"
ws = wb[sheet_name]
ws = EXCEL_FILE_ORGANISATION["4. Staff"]
start_row = 18
end_row = 61
......@@ -208,42 +190,30 @@ def fetch_staffing_excel_data():
return 0
def create_points_for_year(year, nren_column, start_column):
for row in range(start_row, end_row):
offset = start_column - nren_column
for row in ws.iter_rows(min_row=start_row, max_row=end_row, min_col=nren_column, max_col=start_column + 1):
# extract the data from the row
nren = ws.cell(row=row, column=nren_column).value
permanent = ws.cell(row=row, column=start_column).value
nren = row[0].value
if not nren:
continue
permanent = row[offset].value
permanent = convert_number(permanent, nren, year, "permanent ftes")
subcontracted = ws.cell(row=row, column=start_column + 1).value
subcontracted = row[offset+1].value
subcontracted = convert_number(subcontracted, nren, year, "subcontractor ftes")
if permanent + subcontracted > 0:
yield nren.upper(), year, permanent, subcontracted
# For 2016
yield from create_points_for_year(2016, 53, 55)
# For 2017
yield from create_points_for_year(2017, 43, 46)
# For 2018
yield from create_points_for_year(2018, 33, 36)
# For 2019
yield from create_points_for_year(2019, 23, 26)
# For 2020
yield from create_points_for_year(2020, 13, 16)
# For 2021
yield from create_points_for_year(2021, 2, 5)
yield from create_points_for_year(2020, 13, 16)
yield from create_points_for_year(2019, 23, 26)
yield from create_points_for_year(2018, 33, 36)
yield from create_points_for_year(2017, 43, 46)
yield from create_points_for_year(2016, 53, 55)
def fetch_staff_function_excel_data():
# load the xlsx file
wb = openpyxl.load_workbook(EXCEL_FILE_ORGANISATION, data_only=True, read_only=True)
# select the active worksheet
sheet_name = "5. Staff by Function"
ws = wb[sheet_name]
ws = EXCEL_FILE_ORGANISATION["5. Staff by Function"]
start_row = 14
end_row = 58
......@@ -260,17 +230,18 @@ def fetch_staff_function_excel_data():
return convert_number(value, nren, year, description)
def create_points_for_year_until_2019(year, nren_column, start_column):
for row in range(start_row, end_row):
offset = abs(start_column - nren_column)
for row in ws.iter_rows(min_row=start_row, max_row=end_row, min_col=nren_column, max_col=start_column + 5):
# extract the data from the row
nren = ws.cell(row=row, column=nren_column).value
nren = row[0].value
if nren is None:
continue
admin = read_cell_number(row, start_column, nren, year, "admin and finance ftes")
communication = read_cell_number(row, start_column + 1, nren, year, "communication ftes")
infosec = read_cell_number(row, start_column + 2, nren, year, "infosec ftes")
it = read_cell_number(row, start_column + 3, nren, year, "it and software dev ftes")
noc = read_cell_number(row, start_column + 4, nren, year, "NOC and engineering ftes")
others = read_cell_number(row, start_column + 5, nren, year, "other ftes")
admin = convert_number(row[offset].value, nren, year, "admin and finance ftes")
communication = convert_number(row[offset+1].value, nren, year, "communication ftes")
infosec = convert_number(row[offset+2].value, nren, year, "infosec ftes")
it = convert_number(row[offset+3].value, nren, year, "it and software dev ftes")
noc = convert_number(row[offset+4].value, nren, year, "NOC and engineering ftes")
others = convert_number(row[offset+5].value, nren, year, "other ftes")
technical = infosec + it + noc
non_technical = admin + communication + others
......@@ -279,13 +250,13 @@ def fetch_staff_function_excel_data():
yield nren.upper(), year, technical, non_technical
def create_points_for_year(year, nren_column, start_column):
for row in range(start_row, end_row):
# extract the data from the row
nren = ws.cell(row=row, column=nren_column).value
offset = abs(start_column - nren_column)
for row in ws.iter_rows(min_row=start_row, max_row=end_row, min_col=nren_column, max_col=start_column + 1):
nren = row[0].value
if nren is None:
continue
technical = read_cell_number(row, start_column, nren, year, "technical ftes")
non_technical = read_cell_number(row, start_column + 1, nren, year, "non-technical ftes")
technical = convert_number(row[offset].value, nren, year, "technical ftes")
non_technical = convert_number(row[offset+1].value, nren, year, "non-technical ftes")
if technical + non_technical > 0:
yield nren.upper(), year, technical, non_technical
......@@ -306,25 +277,19 @@ def fetch_staff_function_excel_data():
def fetch_ecproject_excel_data():
# load the xlsx file
wb = openpyxl.load_workbook(EXCEL_FILE_ORGANISATION, data_only=True, read_only=True)
# select the active worksheet
sheet_name = "7. EC Projects"
ws = wb[sheet_name]
ws = EXCEL_FILE_ORGANISATION["7. EC Projects"]
start_row = 6
def create_points_for_year(year, start_column, end_row):
for row in range(start_row, end_row):
for row in ws.iter_rows(min_row=start_row, max_row=end_row, min_col=start_column, max_col=start_column + 1):
# extract the data from the row
nren = ws.cell(row=row, column=start_column).value
nren = row[0].value
if nren is None:
continue
project = ws.cell(row=row, column=start_column + 1).value
if project is None:
continue
yield nren.upper(), year, project
project = row[1].value
if project is not None:
yield nren.upper(), year, project
yield from create_points_for_year(2017, 13, 165)
......@@ -338,12 +303,7 @@ def fetch_ecproject_excel_data():
def fetch_organization_excel_data():
# load the xlsx file
wb = openpyxl.load_workbook(EXCEL_FILE_ORGANISATION, data_only=True, read_only=True)
# select the active worksheet
sheet_name = "Organization"
ws = wb[sheet_name]
ws = EXCEL_FILE_ORGANISATION["Organization"]
# iterate over the rows in the worksheet
for row in range(5, 48):
......@@ -356,12 +316,7 @@ def fetch_organization_excel_data():
def fetch_traffic_excel_data():
# load the xlsx file
wb = openpyxl.load_workbook(EXCEL_FILE_NETWORKS, data_only=True, read_only=True)
# select the active worksheet
sheet_name = "Estimated_Traffic TByte"
ws = wb[sheet_name]
ws = EXCEL_FILE_NETWORKS["Estimated_Traffic TByte"]
rows = list(ws.rows)
......@@ -400,8 +355,7 @@ def fetch_traffic_excel_data():
def fetch_nren_services_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_NREN_SERVICES, data_only=True, read_only=True)
ws = wb["Sheet1"]
ws = EXCEL_FILE_NREN_SERVICES["Sheet1"]
rows = list(ws.rows)
titles = rows[0]
......@@ -447,6 +401,8 @@ def fetch_nren_services_excel_data():
def get_category(excel_cat):
if not excel_cat:
return None
if "hospital" in excel_cat.lower():
return UserCategory.hospitals
if "universit" in excel_cat.lower():
return UserCategory.universities
if "research ins" in excel_cat.lower():
......@@ -457,8 +413,6 @@ def get_category(excel_cat):
return UserCategory.iros
if "cultural" in excel_cat.lower() or "librar" in excel_cat.lower():
return UserCategory.cultural
if "hospital" in excel_cat.lower():
return UserCategory.hospitals
if "primary" in excel_cat.lower():
return UserCategory.primary_schools
if "secondary" in excel_cat.lower():
......@@ -471,10 +425,7 @@ def get_category(excel_cat):
def fetch_remit_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_USERS, data_only=True, read_only=True)
sheet_name = "Connectivity Remit"
ws = wb[sheet_name]
rows = list(ws.rows)
ws = EXCEL_FILE_USERS["Connectivity Remit"]
def get_remit(excel_remit):
if not excel_remit:
......@@ -497,32 +448,40 @@ def fetch_remit_excel_data():
result = {}
def create_points_for_year(year, start_column):
for i in range(8, 51):
nren_name = rows[i][start_column].value
def create_points_for_year(year, start_column, cut=False):
category_row = [c.value for c in list(ws.iter_rows(
min_row=8, max_row=8, min_col=start_column+2, max_col=start_column + 21 + (2 if cut else 0)))[0]]
if cut:
category_row = category_row[:4] + category_row[6:]
categories = [get_category(cat) for cat in category_row[::2]]
for row in ws.iter_rows(min_row=9, max_row=52, min_col=start_column+1,
max_col=start_column + 21 + (2 if cut else 0)):
if cut:
row = row[:4] + row[6:]
nren_name = row[0].value
if not nren_name:
continue
nren_name = nren_name.upper()
for col in range(start_column + 2, start_column + 21, 2):
c = col
if year == 2021 and col > 30:
c += 2
category = get_category(rows[7][c].value)
remit = get_remit(rows[i][c].value)
if category and remit:
every_second_value = [c.value for c in row][::2]
remit = [get_remit(val) for val in every_second_value[1:]]
values = dict(zip(categories, remit))
for category, remit in values.items():
if remit:
result[(nren_name, year, category)] = remit
create_points_for_year(2019, 72)
create_points_for_year(2020, 50)
create_points_for_year(2021, 26)
create_points_for_year(2022, 3)
create_points_for_year(2021, 26, cut=True)
create_points_for_year(2020, 50)
create_points_for_year(2019, 72)
return result
def fetch_nr_connected_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_USERS, data_only=True, read_only=True)
sheet_name = "Connected Institutions"
ws = wb[sheet_name]
ws = EXCEL_FILE_USERS["Connected Institutions"]
rows = list(ws.rows)
result = {}
......@@ -546,9 +505,7 @@ def fetch_nr_connected_excel_data():
def fetch_market_share_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_USERS, data_only=True, read_only=True)
sheet_name = "Table Market Share"
ws = wb[sheet_name]
ws = EXCEL_FILE_USERS["Table Market Share"]
rows = list(ws.rows)
result = {}
......@@ -574,9 +531,7 @@ def fetch_market_share_excel_data():
def fetch_users_served_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_USERS, data_only=True, read_only=True)
sheet_name = "Users"
ws = wb[sheet_name]
ws = EXCEL_FILE_USERS["Users"]
rows = list(ws.rows)
result = {}
......@@ -600,9 +555,7 @@ def fetch_users_served_excel_data():
def fetch_typical_speed_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_USERS, data_only=True, read_only=True)
sheet_name = "Table _Typical IP Link capacity"
ws = wb[sheet_name]
ws = EXCEL_FILE_USERS["Table _Typical IP Link capacity"]
rows = list(ws.rows)
result = {}
......@@ -628,9 +581,7 @@ def fetch_typical_speed_excel_data():
def fetch_highest_speed_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_USERS, data_only=True, read_only=True)
sheet_name = "Table _Highest IP Link capacity"
ws = wb[sheet_name]
ws = EXCEL_FILE_USERS["Table _Highest IP Link capacity"]
rows = list(ws.rows)
result = {}
......@@ -656,9 +607,7 @@ def fetch_highest_speed_excel_data():
def fetch_highest_speed_proportion_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_USERS, data_only=True, read_only=True)
sheet_name = "Aver High cap conn Share"
ws = wb[sheet_name]
ws = EXCEL_FILE_USERS["Aver High cap conn Share"]
rows = list(ws.rows)
result = {}
......@@ -681,9 +630,7 @@ def fetch_highest_speed_proportion_excel_data():
def fetch_carriers_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_USERS, data_only=True, read_only=True)
sheet_name = "Traffic carriers"
ws = wb[sheet_name]
ws = EXCEL_FILE_USERS["Traffic carriers"]
rows = list(ws.rows)
def get_carrier(excel_carrier):
......@@ -723,9 +670,7 @@ def fetch_carriers_excel_data():
def fetch_growth_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_NETWORKS, data_only=True, read_only=True)
sheet_name = "Table Traffic Growth % "
ws = wb[sheet_name]
ws = EXCEL_FILE_NETWORKS["Table Traffic Growth % "]
rows = list(ws.rows)
result = {}
......@@ -749,9 +694,7 @@ def fetch_growth_excel_data():
def fetch_average_traffic_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_USERS, data_only=True, read_only=True)
sheet_name = "Average Traffic"
ws = wb[sheet_name]
ws = EXCEL_FILE_USERS["Average Traffic"]
rows = list(ws.rows)
result = {}
......@@ -776,9 +719,7 @@ def fetch_average_traffic_excel_data():
def fetch_peak_traffic_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_USERS, data_only=True, read_only=True)
sheet_name = "Peak traffic"
ws = wb[sheet_name]
ws = EXCEL_FILE_USERS["Peak traffic"]
rows = list(ws.rows)
result = {}
......@@ -803,9 +744,7 @@ def fetch_peak_traffic_excel_data():
def fetch_remote_campuses_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_USERS, data_only=True, read_only=True)
sheet_name = "Foreign Campuses"
ws = wb[sheet_name]
ws = EXCEL_FILE_USERS["Foreign Campuses"]
rows = list(ws.rows)
def create_points_for_year(year, start_column):
......@@ -831,9 +770,7 @@ def fetch_remote_campuses_excel_data():
def fetch_dark_fibre_iru_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_NETWORKS, data_only=True, read_only=True)
sheet_name = "Dark Fibre"
ws = wb[sheet_name]
ws = EXCEL_FILE_NETWORKS["Dark Fibre"]
rows = list(ws.rows)
def parse_int(excel_value):
......@@ -871,9 +808,7 @@ def fetch_dark_fibre_iru_excel_data():
def fetch_dark_fibre_installed_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_NETWORKS, data_only=True, read_only=True)
sheet_name = "Dark Fibre"
ws = wb[sheet_name]
ws = EXCEL_FILE_NETWORKS["Dark Fibre"]
rows = list(ws.rows)
def parse_int(excel_value):
......@@ -905,9 +840,7 @@ def fetch_dark_fibre_installed_excel_data():
def fetch_iru_duration_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_NETWORKS, data_only=True, read_only=True)
sheet_name = "IRU duration"
ws = wb[sheet_name]
ws = EXCEL_FILE_NETWORKS["IRU duration"]
rows = list(ws.rows)
result = {}
......@@ -938,9 +871,7 @@ def fetch_iru_duration_excel_data():
def fetch_passive_monitoring_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_NETWORKS, data_only=True, read_only=True)
sheet_name = "Traffic monitoring"
ws = wb[sheet_name]
ws = EXCEL_FILE_NETWORKS["Traffic monitoring"]
rows = list(ws.rows)
def create_points_for_year(year, start_column):
......@@ -966,9 +897,7 @@ def fetch_passive_monitoring_excel_data():
def fetch_largest_link_capacity_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_NETWORKS, data_only=True, read_only=True)
sheet_name = "Largest IP Trunk capacity"
ws = wb[sheet_name]
ws = EXCEL_FILE_NETWORKS["Largest IP Trunk capacity"]
rows = list(ws.rows)
result = {}
......@@ -993,9 +922,7 @@ def fetch_largest_link_capacity_excel_data():
def fetch_typical_backbone_capacity_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_NETWORKS, data_only=True, read_only=True)
sheet_name = "Typical IP Trunk capacity"
ws = wb[sheet_name]
ws = EXCEL_FILE_NETWORKS["Typical IP Trunk capacity"]
rows = list(ws.rows)
result = {}
......@@ -1020,9 +947,7 @@ def fetch_typical_backbone_capacity_excel_data():
def fetch_non_r_e_peers_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_NETWORKS, data_only=True, read_only=True)
sheet_name = "Peering-Non R& Network"
ws = wb[sheet_name]
ws = EXCEL_FILE_NETWORKS["Peering-Non R& Network"]
rows = list(ws.rows)
def create_points_for_year(year, start_column):
......@@ -1045,9 +970,7 @@ def fetch_non_r_e_peers_excel_data():
def fetch_ops_automation_excel_data():
wb = openpyxl.load_workbook(EXCEL_FILE_NETWORKS, data_only=True, read_only=True)
sheet_name = "Automation"
ws = wb[sheet_name]
ws = EXCEL_FILE_NETWORKS["Automation"]
rows = list(ws.rows)
def create_points_for_year(year, start_column):
......
This diff is collapsed.
from pathlib import Path
def get_resource_file_path(filename: str) -> Path:
resource_dir = Path(__file__).resolve().parent
return resource_dir / filename
File added
File added
File added
import os
import openpyxl
from sqlalchemy import select, func
from compendium_v2 import db
from compendium_v2.db import presentation_models
from compendium_v2.publishers.survey_publisher_legacy_excel import _cli
EXCEL_FILE = os.path.join(os.path.dirname(__file__), "data", "2021_Organisation_DataSeries.xlsx")
def test_excel_publisher(app_with_survey_db, mocker):
mocker.patch('compendium_v2.publishers.excel_parser.EXCEL_FILE_ORGANISATION', EXCEL_FILE)
EXCEL_FILE_ORGANISATION = openpyxl.load_workbook(os.path.join(os.path.dirname(
__file__), "data", "2021_Organisation_DataSeries.xlsx"), data_only=True, read_only=True)
EXCEL_FILE_USERS = openpyxl.load_workbook(os.path.join(os.path.dirname(
__file__), "data", "2022_Connected_Users_DataSeries.xlsx"), data_only=True, read_only=True)
EXCEL_FILE_NETWORKS = openpyxl.load_workbook(os.path.join(os.path.dirname(
__file__), "data", "2022_Networks_DataSeries.xlsx"), data_only=True, read_only=True)
EXCEL_FILE_NREN_SERVICES = openpyxl.load_workbook(os.path.join(os.path.dirname(
__file__), "data", "NREN-Services-prefills_2023_Recovered.xlsx"), data_only=True, read_only=True)
mocker.patch('compendium_v2.publishers.excel_parser.EXCEL_FILE_ORGANISATION', EXCEL_FILE_ORGANISATION)
mocker.patch('compendium_v2.publishers.excel_parser.EXCEL_FILE_USERS', EXCEL_FILE_USERS)
mocker.patch('compendium_v2.publishers.excel_parser.EXCEL_FILE_NETWORKS', EXCEL_FILE_NETWORKS)
mocker.patch('compendium_v2.publishers.excel_parser.EXCEL_FILE_NREN_SERVICES', EXCEL_FILE_NREN_SERVICES)
with app_with_survey_db.app_context():
nren_names = ['SURF', 'KIFU', 'University of Malta', 'ASNET-AM', 'SIKT', 'LAT', 'RASH', 'AzScienceNet', 'GRNET',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment