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
...
@@ -43,6 +43,7 @@ import processing.similarityFiles.dataInput as inputData
##################################
##################################
def
mainViz
():
def
mainViz
():
#procesing data
#procesing data
...
...
src/data-hub/semantic-linking-microservice/app/dummy_upload.py
View file @
56b9c64e
...
@@ -16,14 +16,14 @@ handler = MessageHandler()
...
@@ -16,14 +16,14 @@ handler = MessageHandler()
def
upload_transaction
(
transaction
):
def
upload_transaction
(
transaction
):
'''{"type": "new-trace",
'''{"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"}
"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
()
uid
=
hashlib
.
sha256
(
f
"{transaction['Customer']}{transaction['Timestamp']}"
.
encode
(
"utf-8"
))
.
hexdigest
()
transaction
[
'UniqueID'
]
=
uid
transaction
[
'UniqueID'
]
=
uid
t
=
{
t
=
{
'use_case'
:
'
smart-energy
'
,
'use_case'
:
'
paper
'
,
'table'
:
'
smart-energy
'
,
'table'
:
'
paper
'
,
'id'
:
uid
,
'id'
:
uid
,
'properties'
:
transaction
'properties'
:
transaction
}
}
...
@@ -36,21 +36,34 @@ if __name__ == '__main__':
...
@@ -36,21 +36,34 @@ if __name__ == '__main__':
titles
=
next
(
reader
)
titles
=
next
(
reader
)
#################
maxCustomers
=
5
maxRows
=
10
##################
old_c
=
None
old_c
=
None
customersCount
=
0
rowCount
=
0
for
row
in
reader
:
for
row
in
reader
:
transaction
=
{}
transaction
=
{}
transaction
[
'ApplicationType'
]
=
'
smart-energy
'
transaction
[
'ApplicationType'
]
=
'
paper
'
transaction
[
'docType'
]
=
'
smart-energy
'
transaction
[
'docType'
]
=
'
paper
'
for
idx
in
range
(
len
(
row
)):
for
idx
in
range
(
len
(
row
)):
transaction
[
titles
[
idx
]]
=
row
[
idx
]
transaction
[
titles
[
idx
]]
=
row
[
idx
]
if
int
(
transaction
[
'Customer'
])
<
20
:
continue
if
transaction
[
'Customer'
]
!=
old_c
:
if
transaction
[
'Customer'
]
!=
old_c
:
# only upload until 200 for now
customerCount
+=
1
rowCount
=
0
old_c
=
transaction
[
'Customer'
]
old_c
=
transaction
[
'Customer'
]
print
(
f
"uploading for {old_c}"
)
print
(
f
"uploading for {old_c}"
)
if
(
rowCount
<
maxRows
):
upload_transaction
(
transaction
)
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