Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Trafffic Simulation Storage
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
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
URBANITE
Open
Trafffic Simulation Storage
Commits
bc2bc430
Commit
bc2bc430
authored
2 years ago
by
Gjorgji
Browse files
Options
Downloads
Patches
Plain Diff
Adding kpi hierarchy all cities, added check for info.json
parent
8b3070a9
Branches
master
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/__init__.py
+41
-38
41 additions, 38 deletions
app/__init__.py
app/assets/kpi_hierarchy.json
+52
-3
52 additions, 3 deletions
app/assets/kpi_hierarchy.json
with
93 additions
and
41 deletions
app/__init__.py
+
41
−
38
View file @
bc2bc430
...
...
@@ -151,45 +151,48 @@ def setup_bilbao():
simulations_path
=
Path
(
f
"
{
app
.
dotenv
[
'
DATA_DIR
'
]
}
/
{
app
.
dotenv
[
'
URBANITE_CITY
'
]
}
/simulations
"
)
dirs
=
[
x
for
x
in
simulations_path
.
iterdir
()
if
x
.
is_dir
()]
dirs
.
sort
(
key
=
lambda
t
:
int
(
t
.
name
))
app
.
logger
.
info
(
f
"
Found
{
dirs
}
"
)
# Inser the simulations based on the info.json file
for
d
in
dirs
:
info_json_path
=
d
/
"
info.json
"
if
not
info_json_path
.
exists
():
app
.
logger
.
warning
(
f
"
info.json does not exists for
{
d
.
name
}
! It won
'
t be added to the DB!
"
if
os
.
path
.
exists
(
simulations_path
):
dirs
=
[
x
for
x
in
simulations_path
.
iterdir
()
if
x
.
is_dir
()]
dirs
.
sort
(
key
=
lambda
t
:
int
(
t
.
name
))
app
.
logger
.
info
(
f
"
Found
{
dirs
}
"
)
# Inser the simulations based on the info.json file
for
d
in
dirs
:
info_json_path
=
d
/
"
info.json
"
if
not
info_json_path
.
exists
():
app
.
logger
.
warning
(
f
"
info.json does not exists for
{
d
.
name
}
! It won
'
t be added to the DB!
"
)
continue
with
open
(
info_json_path
)
as
info_file
:
info
=
json
.
load
(
info_file
)
app
.
logger
.
info
(
f
"
Adding:
{
info
[
'
name
'
]
}
"
)
network
:
Network
=
Network
(
name
=
info
[
"
name
"
],
description
=
info
[
"
description
"
],
city
=
bilbao
,
done_osm_processing
=
True
,
donematsim_processing
=
True
,
)
continue
with
open
(
info_json_path
)
as
info_file
:
info
=
json
.
load
(
info_file
)
app
.
logger
.
info
(
f
"
Adding:
{
info
[
'
name
'
]
}
"
)
network
:
Network
=
Network
(
name
=
info
[
"
name
"
],
description
=
info
[
"
description
"
],
city
=
bilbao
,
done_osm_processing
=
True
,
donematsim_processing
=
True
,
)
plan
:
Plan
=
Plan
(
name
=
info
[
"
name
"
],
network
=
network
)
Simulation
(
city
=
bilbao
,
name
=
info
[
"
name
"
],
description
=
info
[
"
description
"
],
plan
=
plan
,
status
=
Status
.
CREATED
,
)
app
.
logger
.
info
(
f
"
Bilbao simulation:
{
info
[
'
name
'
]
}
"
)
app
.
logger
.
info
(
f
"
Bilbao network:
{
network
}
"
)
app
.
logger
.
info
(
f
"
Bilbao plans:
{
plan
}
"
)
plan
:
Plan
=
Plan
(
name
=
info
[
"
name
"
],
network
=
network
)
Simulation
(
city
=
bilbao
,
name
=
info
[
"
name
"
],
description
=
info
[
"
description
"
],
plan
=
plan
,
status
=
Status
.
CREATED
,
)
app
.
logger
.
info
(
f
"
Bilbao simulation:
{
info
[
'
name
'
]
}
"
)
app
.
logger
.
info
(
f
"
Bilbao network:
{
network
}
"
)
app
.
logger
.
info
(
f
"
Bilbao plans:
{
plan
}
"
)
else
:
app
.
logger
.
info
(
f
"
No simulations folder present, skipping adding simulations from info.json
"
)
def
setup_helsinki
():
...
...
This diff is collapsed.
Click to expand it.
app/assets/kpi_hierarchy.json
+
52
−
3
View file @
bc2bc430
...
...
@@ -24,12 +24,61 @@
"City-wide CO2"
:
"4"
},
"amsterdam"
:
{
"Mobility Policy Quality"
:
"0"
,
"Local"
:
"1"
,
"City-wide"
:
"1"
,
"Local traffic"
:
"2"
,
"Local bike infrastructure"
:
"2"
,
"City-wide traffic"
:
"2"
,
"City-wide bike infrastructure"
:
"2"
,
"Local bike intensity"
:
"3"
,
"Local bike congestion"
:
"3"
,
"Local bike safety"
:
"3"
,
"Local bikeability"
:
"3"
,
"City-wide bike intensity"
:
"3"
,
"City-wide bike congestion"
:
"3"
,
"City-wide bike safety"
:
"3"
,
"City-wide bikeability"
:
"3"
},
"helsinki"
:
{
"Mobility Policy Quality"
:
"0"
,
"Local"
:
"1"
,
"City-wide"
:
"1"
,
"Harbour area traffic flow"
:
"1"
,
"Local Pollution"
:
"2"
,
"Local congestions and bottlenecks"
:
"2"
,
"City-wide Pollution"
:
"2"
,
"City-wide congestions and bottlenecks"
:
"2"
,
"Local Emissions"
:
"3"
,
"Local Acoustic Pollution"
:
"3"
,
"City-wide Emissions"
:
"3"
,
"City-wide Acoustic Pollution"
:
"3"
,
"Local NOx"
:
"4"
,
"Local PM10"
:
"4"
,
"Local CO2"
:
"4"
,
"City-wide NOx"
:
"4"
,
"City-wide PM10"
:
"4"
,
"City-wide CO2"
:
"4"
},
"messina"
:
{
"Mobility Policy Quality"
:
"0"
,
"Local"
:
"1"
,
"City-wide"
:
"1"
,
"Local public transport"
:
"2"
,
"Local trips share"
:
"2"
,
"Local number of bike trips"
:
"2"
,
"City-wide public transport"
:
"2"
,
"City-wide trips share"
:
"2"
,
"City-wide number of bike trips"
:
"2"
,
"Local public transport use"
:
"3"
,
"Local average speed of public transport"
:
"3"
,
"Local share of public transport"
:
"3"
,
"Local share of car trips"
:
"3"
,
"Local share of bicycles"
:
"3"
,
"City-wide public transport use"
:
"3"
,
"City-wide average speed of public transport"
:
"3"
,
"City-wide share of public transport"
:
"3"
,
"City-wide share of car trips"
:
"3"
,
"City-wide share of bicycles"
:
"3"
}
}
\ No newline at end of file
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