Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
67bcbc39
Commit
67bcbc39
authored
Nov 24, 2020
by
Lubber
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
88ef9c6d
a1710550
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
add_custom_type_label.py
...stage-discovery-microservice/app/add_custom_type_label.py
+14
-8
No files found.
src/data-hub/role-stage-discovery-microservice/app/add_custom_type_label.py
View file @
67bcbc39
...
...
@@ -47,18 +47,24 @@ def create_type_label(layer_filename, treshold1, treshold2):
layer_file
.
write
(
json
.
dumps
(
content
))
print_min_max
(
"Solar_Production_Layer.json"
)
create_type_label
(
"Solar_Production_Layer.json"
,
treshold1
=
1.4301666666666666
,
treshold2
=
2.860333333333333
)
#
print_min_max("Solar_Production_Layer.json")
#
create_type_label("Solar_Production_Layer.json",
#
treshold1=1.4301666666666666, treshold2=2.860333333333333)
print_min_max
(
"User_Demand_Layer.json"
)
create_type_label
(
"User_Demand_Layer.json"
,
treshold1
=
1.8306666666666667
,
treshold2
=
3.6608333333333336
)
#
print_min_max("User_Demand_Layer.json")
#
create_type_label("User_Demand_Layer.json",
#
treshold1=1.8306666666666667, treshold2=3.6608333333333336)
def
check_values
():
with
open
(
"
Solar_Production
_Layer.json"
,
'r'
)
as
layer_file
:
with
open
(
"
User_Demand
_Layer.json"
,
'r'
)
as
layer_file
:
content
=
json
.
loads
(
layer_file
.
read
())
d
=
{
'high'
:
0
,
'medium'
:
0
,
'low'
:
0
,
'noise'
:
0
}
for
e
in
content
:
print
(
f
"{e['label']} : {e['type_label']}"
)
d
[
e
[
'type_label'
]]
+=
1
# print(f"{e['label']} : {e['type_label']}")
print
(
d
)
check_values
()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment