Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PSBoardDataBase
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
Show more breadcrumbs
Wataru Otsubo
PSBoardDataBase
Commits
ead17f3d
Commit
ead17f3d
authored
9 months ago
by
Wataru Otsubo
Browse files
Options
Downloads
Patches
Plain Diff
add: skew column to positions
parent
066e0d5e
No related branches found
No related tags found
1 merge request
!1397
Add version info and skew for positions to the database
Pipeline
#8229202
failed
9 months ago
Stage: test
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/PSBoardDataBase.jl
+4
-1
4 additions, 1 deletion
src/PSBoardDataBase.jl
src/import_data.jl
+17
-3
17 additions, 3 deletions
src/import_data.jl
src/sql/create_table.sql
+2
-1
2 additions, 1 deletion
src/sql/create_table.sql
test/runtests.jl
+13
-1
13 additions, 1 deletion
test/runtests.jl
with
36 additions
and
6 deletions
src/PSBoardDataBase.jl
+
4
−
1
View file @
ead17f3d
...
...
@@ -20,6 +20,7 @@ include("import_data.jl")
runlist_csv::AbstractString,
dispatch_csv::AbstractString,
hundred_csv::AbstractString,
jathubs_csv::AbstractString,
masterlog_dir::AbstractString,
)
...
...
@@ -31,6 +32,7 @@ Create database at `dbpath` and import data from CSV and master log files.
- `runlist_csv`: CSV of run lists exported from the Google sheets database
- `dispatch_csv`: CSV of dispatch lists exported from the Google sheets database
- `hundred_csv`: CSV of 100 tests results exported from the Google sheets database
- `jathubs_csv`: CSV for jathub list used in QAQC. Used to add skew.
- `masterlog_dir`: path to the directory (`log`) where all JATHub master log is stored
"""
function
create_database_from_exported_csvs
(
...
...
@@ -39,6 +41,7 @@ function create_database_from_exported_csvs(
runlist_csv
::
AbstractString
,
dispatch_csv
::
AbstractString
,
hundred_csv
::
AbstractString
,
jathubs_csv
::
AbstractString
,
masterlog_dir
::
AbstractString
,
)
db
=
create_database
(
dbpath
)
...
...
@@ -48,7 +51,7 @@ function create_database_from_exported_csvs(
extra_100test_result_df
=
CSV
.
read
(
hundred_csv
,
DataFrame
)
insert_qaqc_campaign_id
(
db
)
insert_qaqc_positions
(
db
)
insert_qaqc_positions
(
db
,
jathubs_csv
)
add_psboard_ids
(
db
,
single_result_df
)
add_qaqc_runlist_from_runlist
(
db
,
runlist_table
)
...
...
This diff is collapsed.
Click to expand it.
src/import_data.jl
+
17
−
3
View file @
ead17f3d
...
...
@@ -45,11 +45,18 @@ function insert_qaqc_campaign_id(db::SQLite.DB)
end
"""
insert_qaqc_positions(db::SQLite.DB)
insert_qaqc_positions(db::SQLite.DB
, jathub_db_table::DataFrame
)
Fill qaqc_positions table in `db`.
Argument `jathub_db_table` is for skew for each positions.
"""
function
insert_qaqc_positions
(
db
::
SQLite
.
DB
)
function
insert_qaqc_positions
(
db
::
SQLite
.
DB
,
jathub_db_table
::
DataFrame
)
dropmissing!
(
jathub_db_table
,
:
psb_position
)
transform!
(
jathub_db_table
,
Symbol
(
"立ち上がり [ns]"
)
=>
ByRow
(
Float64
)
=>
Symbol
(
"立ち上がり [ns]"
),
)
stmt
=
DBInterface
.
prepare
(
db
,
sql
"""
...
...
@@ -58,7 +65,8 @@ function insert_qaqc_positions(db::SQLite.DB)
:id,
:name,
:station,
:position
:position,
:rising_ns
)
"""
,
)
...
...
@@ -69,6 +77,12 @@ function insert_qaqc_positions(db::SQLite.DB)
name
=
[
"B-
$
i-
$
j"
for
i
in
0
:
1
for
j
in
1
:
9
],
station
=
[
fill
(
0
,
9
);
fill
(
1
,
9
)],
position
=
[
collect
(
1
:
9
);
collect
(
1
:
9
)],
rising_ns
=
[
filter
(
:
psb_position
=>
(
s
->
!
ismissing
(
s
)
&&
s
==
"B-
$
i-
$
j"
),
jathub_db_table
,
)
.
var
"立ち上がり [ns]"
|>
first
for
i
in
0
:
1
for
j
in
1
:
9
],
),
)
...
...
This diff is collapsed.
Click to expand it.
src/sql/create_table.sql
+
2
−
1
View file @
ead17f3d
...
...
@@ -93,7 +93,8 @@ CREATE TABLE qaqc_positions (
id
INTEGER
NOT
NULL
PRIMARY
KEY
,
name
TEXT
NOT
NULL
UNIQUE
,
station
INTEGER
NOT
NULL
,
position
INTEGER
NOT
NULL
position
INTEGER
NOT
NULL
,
rising_ns
NUMERIC
NOT
NULL
);
CREATE
VIEW
qaqc_single_run_table
...
...
This diff is collapsed.
Click to expand it.
test/runtests.jl
+
13
−
1
View file @
ead17f3d
using
Test
using
PSBoardDataBase
using
CSV
,
DataFrames
using
SQLite
,
DBInterface
using
Dates
true
||
include
(
"../src/PSBoardDataBase.jl"
)
...
...
@@ -35,9 +36,20 @@ true || include("../src/PSBoardDataBase.jl")
@info
""
db
@test
PSBoardDataBase
.
insert_version_info
(
db
)
|>
isnothing
let
stmt
stmt
=
DBInterface
.
prepare
(
db
,
sql
"""
SELECT * FROM versions
"""
,
)
result
=
DBInterface
.
execute
(
stmt
)
|>
DataFrame
@test
nrow
(
result
)
|>
==
(
1
)
end
@test
PSBoardDataBase
.
insert_qaqc_campaign_id
(
db
)
|>
isnothing
@test
PSBoardDataBase
.
insert_qaqc_positions
(
db
)
|>
isnothing
jathub_list_df
=
CSV
.
read
(
"input/PS board QAQC Data Base - JATHub db.csv"
,
DataFrame
)
@test
PSBoardDataBase
.
insert_qaqc_positions
(
db
,
jathub_list_df
)
|>
isnothing
single_result_df
=
CSV
.
read
(
"input/PS board QAQC Data Base - 本番1回試験・追加検証試験.csv"
,
DataFrame
)
...
...
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