Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compendium-v2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
compendium-v2
Commits
c0fcd16c
Commit
c0fcd16c
authored
2 years ago
by
Remco Tukker
Browse files
Options
Downloads
Patches
Plain Diff
add funding source data for 2021
parent
b0d517c5
No related branches found
No related tags found
1 merge request
!36
add funding source data for 2021
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compendium_v2/background_task/parse_excel_data.py
+14
-10
14 additions, 10 deletions
compendium_v2/background_task/parse_excel_data.py
with
14 additions
and
10 deletions
compendium_v2/background_task/parse_excel_data.py
+
14
−
10
View file @
c0fcd16c
...
...
@@ -40,6 +40,7 @@ def fetch_funding_excel_data():
# select the active worksheet
sheet_name
=
"
2. Income Sources
"
ws
=
wb
[
sheet_name
]
ws2
=
wb
[
"
Income Sources table
"
]
def
hard_number_convert
(
s
,
source_name
,
nren
,
year
):
if
s
is
None
:
...
...
@@ -76,15 +77,15 @@ def fetch_funding_excel_data():
if
nren
is
not
None
:
yield
(
nren
.
upper
(),
year
,
client_institution
,
european_funding
,
gov_public_bodies
,
commercial
,
other
)
def
create_points_for_year_from_2018
(
start_row
,
end_row
,
year
,
col_start
):
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
):
# extract the data from the row
nren
=
w
s
.
cell
(
row
=
row
,
column
=
col_start
).
value
client_institution
=
w
s
.
cell
(
row
=
row
,
column
=
col_start
+
3
).
value
european_funding
=
w
s
.
cell
(
row
=
row
,
column
=
col_start
+
4
).
value
gov_public_bodies
=
w
s
.
cell
(
row
=
row
,
column
=
col_start
+
5
).
value
commercial
=
w
s
.
cell
(
row
=
row
,
column
=
col_start
+
6
).
value
other
=
w
s
.
cell
(
row
=
row
,
column
=
col_start
+
7
).
value
nren
=
s
heet
.
cell
(
row
=
row
,
column
=
nren_col
).
value
client_institution
=
s
heet
.
cell
(
row
=
row
,
column
=
col_start
).
value
european_funding
=
s
heet
.
cell
(
row
=
row
,
column
=
col_start
+
1
).
value
gov_public_bodies
=
s
heet
.
cell
(
row
=
row
,
column
=
col_start
+
2
).
value
commercial
=
s
heet
.
cell
(
row
=
row
,
column
=
col_start
+
3
).
value
other
=
s
heet
.
cell
(
row
=
row
,
column
=
col_start
+
4
).
value
client_institution
=
hard_number_convert
(
client_institution
,
"
client institution
"
,
nren
,
year
)
european_funding
=
hard_number_convert
(
european_funding
,
"
european funding
"
,
nren
,
year
)
...
...
@@ -103,13 +104,16 @@ def fetch_funding_excel_data():
yield
from
create_points_for_year_until_2017
(
8
,
51
,
2017
,
32
,
35
)
# For 2018
yield
from
create_points_for_year_from_2018
(
8
,
51
,
2018
,
21
)
yield
from
create_points_for_year_from_2018
(
ws
,
8
,
51
,
2018
,
21
,
24
)
# For 2019
yield
from
create_points_for_year_from_2018
(
8
,
51
,
2019
,
12
)
yield
from
create_points_for_year_from_2018
(
ws
,
8
,
51
,
2019
,
12
,
15
)
# For 2020
yield
from
create_points_for_year_from_2018
(
8
,
51
,
2020
,
3
)
yield
from
create_points_for_year_from_2018
(
ws
,
8
,
51
,
2020
,
3
,
6
)
# For 2021
yield
from
create_points_for_year_from_2018
(
ws2
,
8
,
51
,
2021
,
11
,
12
)
def
fetch_charging_structure_excel_data
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment