Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nxdblmbackendpython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Alexander Perez
nxdblmbackendpython
Commits
8b3417a7
Commit
8b3417a7
authored
5 years ago
by
Quentin Codelupi
Browse files
Options
Downloads
Patches
Plain Diff
Final Init
parent
ba5d4773
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
README.md
+14
-0
14 additions, 0 deletions
README.md
property-pull.py
+12
-11
12 additions, 11 deletions
property-pull.py
with
28 additions
and
11 deletions
.gitignore
0 → 100644
+
2
−
0
View file @
8b3417a7
pyconf.py
\ No newline at end of file
This diff is collapsed.
Click to expand it.
README.md
0 → 100644
+
14
−
0
View file @
8b3417a7
# Property Pull
Property pull is a Python project for the Cern's BLM section.
It get precise data property for diamond devices by NXCALS and store it in lighter format on a MYSQL DB.
In order to be used in other application.
## Installation
## Usage
## Left to do
This diff is collapsed.
Click to expand it.
property-pull.py
+
12
−
11
View file @
8b3417a7
...
@@ -2,6 +2,7 @@ import json
...
@@ -2,6 +2,7 @@ import json
import
sys
import
sys
import
mysql.connector
import
mysql.connector
import
pyconf
as
cfg
from
cern.nxcals.pyquery.builders
import
*
from
cern.nxcals.pyquery.builders
import
*
from
pyspark
import
SparkConf
from
pyspark
import
SparkConf
...
@@ -18,11 +19,11 @@ _dest_dir = '.'
...
@@ -18,11 +19,11 @@ _dest_dir = '.'
# mysqlDB variables
# mysqlDB variables
mydb
=
mysql
.
connector
.
connect
(
mydb
=
mysql
.
connector
.
connect
(
host
=
'
dbod-testdb-nxdblm.cern.ch
'
,
host
=
cfg
.
mysql
[
'
host
'
]
,
port
=
'
5501
'
,
port
=
cfg
.
mysql
[
'
port
'
]
,
user
=
'
pythonU
ser
'
,
user
=
cfg
.
mysql
[
'
u
ser
'
]
,
passwd
=
'
pythonPusher
'
,
passwd
=
cfg
.
mysql
[
'
passwd
'
]
,
database
=
'
nxcals_blm_data
'
database
=
cfg
.
mysql
[
'
database
'
]
)
)
# id of the sql data's row for this filling
# id of the sql data's row for this filling
...
@@ -66,12 +67,12 @@ def pull_histogram(_start_time, _end_time, _device):
...
@@ -66,12 +67,12 @@ def pull_histogram(_start_time, _end_time, _device):
data
=
{}
data
=
{}
df
=
KeyValuesQuery
.
builder
(
spark
).
system
(
"
CMW
"
)
\
df
=
KeyValuesQuery
.
builder
(
spark
).
system
(
"
CMW
"
)
\
.
startTime
(
_start_time
)
\
.
startTime
(
_start_time
)
\
.
endTime
(
_end_time
)
\
.
endTime
(
_end_time
)
\
.
entity
()
\
.
entity
()
\
.
keyValue
(
"
device
"
,
_device
)
\
.
keyValue
(
"
device
"
,
_device
)
\
.
keyValue
(
"
property
"
,
_property
)
\
.
keyValue
(
"
property
"
,
_property
)
\
.
buildDataset
()
.
buildDataset
()
df
.
printSchema
()
df
.
printSchema
()
...
...
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