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
56b9c64e
Commit
56b9c64e
authored
Oct 15, 2020
by
Bogdan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified dummyUpload file
parent
9f4db2a6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
11 deletions
+25
-11
visualisationPaper.py
...le-stage-discovery-microservice/app/visualisationPaper.py
+1
-0
dummy_upload.py
...ata-hub/semantic-linking-microservice/app/dummy_upload.py
+24
-11
No files found.
src/data-hub/role-stage-discovery-microservice/app/visualisationPaper.py
View file @
56b9c64e
...
...
@@ -43,6 +43,7 @@ import processing.similarityFiles.dataInput as inputData
##################################
def
mainViz
():
#procesing data
...
...
src/data-hub/semantic-linking-microservice/app/dummy_upload.py
View file @
56b9c64e
...
...
@@ -16,14 +16,14 @@ handler = MessageHandler()
def
upload_transaction
(
transaction
):
'''{"type": "new-trace",
"content": {"use_case": "
smart-energy", "table": "smart-energy
", "id": "dd2c5146c919b046d77a32a5cf553d5133163562f7b7e1298c878c575d516025",
"content": {"use_case": "
paper", "table": "paper
", "id": "dd2c5146c919b046d77a32a5cf553d5133163562f7b7e1298c878c575d516025",
"properties": {"Customer": "297", "Energy_Consumption_kWh": "0.177", "Heating_Consumption_kWh": "0.0", "Latitude": "-33.362679", "Longitude": "151.447302", "Postcode": "2261", "Price_AUD_MWh": "58.05", "Solar_Production_kWh": "0.0", "Timestamp": "2013-06-30 00:00:00", "Total_Demand_MWh": "8154.14", "UniqueID": "dd2c5146c919b046d77a32a5cf553d5133163562f7b7e1298c878c575d516025"}
}}'''
uid
=
hashlib
.
sha256
(
f
"{transaction['Customer']}{transaction['Timestamp']}"
.
encode
(
"utf-8"
))
.
hexdigest
()
transaction
[
'UniqueID'
]
=
uid
t
=
{
'use_case'
:
'
smart-energy
'
,
'table'
:
'
smart-energy
'
,
'use_case'
:
'
paper
'
,
'table'
:
'
paper
'
,
'id'
:
uid
,
'properties'
:
transaction
}
...
...
@@ -36,21 +36,34 @@ if __name__ == '__main__':
titles
=
next
(
reader
)
#################
maxCustomers
=
5
maxRows
=
10
##################
old_c
=
None
customersCount
=
0
rowCount
=
0
for
row
in
reader
:
transaction
=
{}
transaction
[
'ApplicationType'
]
=
'
smart-energy
'
transaction
[
'docType'
]
=
'
smart-energy
'
transaction
[
'ApplicationType'
]
=
'
paper
'
transaction
[
'docType'
]
=
'
paper
'
for
idx
in
range
(
len
(
row
)):
transaction
[
titles
[
idx
]]
=
row
[
idx
]
if
int
(
transaction
[
'Customer'
])
<
20
:
continue
if
transaction
[
'Customer'
]
!=
old_c
:
# only upload until 200 for now
customerCount
+=
1
rowCount
=
0
old_c
=
transaction
[
'Customer'
]
print
(
f
"uploading for {old_c}"
)
if
(
rowCount
<
maxRows
):
upload_transaction
(
transaction
)
rowCount
+=
1
if
(
customerCount
>
maxCustomers
-
1
):
print
(
"
\n
MAX customers reached"
)
break
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