mirror of
https://gitlab.cern.ch/wotsubo/PSBoardDataBase.git
synced 2025-06-08 05:55:42 +09:00
refactoring: rename crate_database functions (BREAKING)
This commit is contained in:
parent
733fb392c3
commit
656848f850
6 changed files with 26 additions and 16 deletions
|
@ -9,7 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- `create_database_from_exported_csvs` now can save a JLD2 cache to store parsed slave logs.
|
- `create_database`(formally `create_database_from_exported_csvs`) now can save a JLD2 cache to store parsed slave logs.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Renamed `create_database_from_exported_csvs` to `create_database` and `create_database` to `create_empty_database`. (!1423)
|
||||||
|
- Exported `create_database`
|
||||||
|
|
||||||
## [0.5.1] - 2025-01-23
|
## [0.5.1] - 2025-01-23
|
||||||
|
|
||||||
|
|
|
@ -12,13 +12,13 @@ Depth = 4
|
||||||
# このリポジトリのソフトウェアについての説明
|
# このリポジトリのソフトウェアについての説明
|
||||||
|
|
||||||
このリポジトリにあるのは、JATHub masterのログファイル、及びGoogle SheetsからエクスポートしたCSVファイルからデータベースを作成するためのコードである。
|
このリポジトリにあるのは、JATHub masterのログファイル、及びGoogle SheetsからエクスポートしたCSVファイルからデータベースを作成するためのコードである。
|
||||||
メインの関数は[`create_database_from_exported_csvs`](@ref)である。
|
メインの関数は[`create_database`](@ref)である。
|
||||||
|
|
||||||
!!! info
|
!!! info
|
||||||
**TLDR**;
|
**TLDR**;
|
||||||
データベースがほしいときは_Masterのログ_と_Slaveのログ_を用意して、[`create_database_from_exported_csvs`](@ref)
|
データベースがほしいときは_Masterのログ_と_Slaveのログ_を用意して、[`create_database`](@ref)
|
||||||
```julia
|
```julia
|
||||||
create_database_from_exported_csvs(
|
create_database(
|
||||||
"database_name.db";
|
"database_name.db";
|
||||||
masterlog_dir = "dir/to/master/logs",
|
masterlog_dir = "dir/to/master/logs",
|
||||||
slavelog_dir = "dir/to/slave/logs"
|
slavelog_dir = "dir/to/slave/logs"
|
||||||
|
@ -39,7 +39,7 @@ backspaceでjulianモードに戻り(左側が`julia>`になってる)、`using
|
||||||
|
|
||||||
`?`を押すとhelpモードに入り、関数名などをいれるとそのドキュメント(下にあるものと同じ)が閲覧できる。
|
`?`を押すとhelpモードに入り、関数名などをいれるとそのドキュメント(下にあるものと同じ)が閲覧できる。
|
||||||
|
|
||||||
`PSBoardDataBase.create_database_from_exported_csvs`を検索すると使い方がわかる。
|
`PSBoardDataBase.create_database`を検索すると使い方がわかる。
|
||||||
|
|
||||||
# テストについて
|
# テストについて
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ Depth = 4
|
||||||
データベースはファイルとして手に入れることができます。
|
データベースはファイルとして手に入れることができます。
|
||||||
QAQCキャンペーンの終了後にMattermostチャンネル上でマニュアルで配布されるものをダウンロードするか、最新のものが欲しい場合は以下の方法で手に入ります。
|
QAQCキャンペーンの終了後にMattermostチャンネル上でマニュアルで配布されるものをダウンロードするか、最新のものが欲しい場合は以下の方法で手に入ります。
|
||||||
|
|
||||||
- このリポジトリのコードを実行する([このページ](./about_software.md)や[`PSBoardDataBase.create_database_from_exported_csvs`](@ref)参照)
|
- このリポジトリのコードを実行する([このページ](./about_software.md)や[`PSBoardDataBase.create_database`](@ref)参照)
|
||||||
- QAQCをやってる部屋のPCにインストールしてあるので、それを実行する
|
- QAQCをやってる部屋のPCにインストールしてあるので、それを実行する
|
||||||
- 知ってる人に頼む
|
- 知ってる人に頼む
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,12 @@ include("import_data.jl")
|
||||||
include("DispatchChecker.jl")
|
include("DispatchChecker.jl")
|
||||||
using .DispatchChecker
|
using .DispatchChecker
|
||||||
|
|
||||||
|
export create_database
|
||||||
|
|
||||||
|
@deprecate create_database_from_exported_csvs(dbpath::AbstractString; kw...) create_database(dbpath; kw...) false
|
||||||
|
|
||||||
"""
|
"""
|
||||||
create_database_from_exported_csvs(
|
create_database(
|
||||||
dbpath::AbstractString;
|
dbpath::AbstractString;
|
||||||
masterlog_dir::AbstractString,
|
masterlog_dir::AbstractString,
|
||||||
slavelog_dir::AbstractString,
|
slavelog_dir::AbstractString,
|
||||||
|
@ -57,13 +61,13 @@ If you want to use alternative CSV or are not online, you can specify the path o
|
||||||
- `hundred_csv`: CSV of 100 tests results 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.
|
- `jathubs_csv`: CSV for jathub list used in QAQC. Used to add skew.
|
||||||
"""
|
"""
|
||||||
function create_database_from_exported_csvs(
|
function create_database(
|
||||||
dbpath::AbstractString;
|
dbpath::AbstractString;
|
||||||
masterlog_dir::AbstractString,
|
masterlog_dir::AbstractString,
|
||||||
slavelog_dir::AbstractString,
|
slavelog_dir::AbstractString,
|
||||||
kw...
|
kw...,
|
||||||
)
|
)
|
||||||
db = create_database(dbpath)
|
db = create_empty_database(dbpath)
|
||||||
|
|
||||||
single_result_df,
|
single_result_df,
|
||||||
runlist_table,
|
runlist_table,
|
||||||
|
|
|
@ -4,21 +4,21 @@
|
||||||
Create new database at `dbpath` and prepare all tables.
|
Create new database at `dbpath` and prepare all tables.
|
||||||
Tables are empty.
|
Tables are empty.
|
||||||
"""
|
"""
|
||||||
function create_database end
|
function create_empty_database end
|
||||||
|
|
||||||
"""
|
"""
|
||||||
create_database(dbpath::AbstractString)
|
create_database(dbpath::AbstractString)
|
||||||
"""
|
"""
|
||||||
function create_database(dbpath::AbstractString)
|
function create_empty_database(dbpath::AbstractString)
|
||||||
db::SQLite.DB = DBInterface.connect(SQLite.DB, dbpath)
|
db::SQLite.DB = DBInterface.connect(SQLite.DB, dbpath)
|
||||||
|
|
||||||
create_database(db)
|
create_empty_database(db)
|
||||||
end
|
end
|
||||||
|
|
||||||
"""
|
"""
|
||||||
create_database(db::SQLite.DB)
|
create_database(db::SQLite.DB)
|
||||||
"""
|
"""
|
||||||
function create_database(db::SQLite.DB)
|
function create_empty_database(db::SQLite.DB)
|
||||||
dirpath = @__DIR__
|
dirpath = @__DIR__
|
||||||
sql_creates::String = read("$dirpath/sql/create_table.sql", String) |> chomp
|
sql_creates::String = read("$dirpath/sql/create_table.sql", String) |> chomp
|
||||||
|
|
||||||
|
|
|
@ -202,7 +202,7 @@ true || include("../src/PSBoardDataBase.jl")
|
||||||
@testset "full integrated test" begin
|
@testset "full integrated test" begin
|
||||||
dbpath = tempname()
|
dbpath = tempname()
|
||||||
jld2path = tempname()
|
jld2path = tempname()
|
||||||
db = PSBoardDataBase.create_database(dbpath)
|
db = PSBoardDataBase.create_empty_database(dbpath)
|
||||||
jld2_slavelog = jldopen(jld2path, "w")
|
jld2_slavelog = jldopen(jld2path, "w")
|
||||||
@info "" db jld2_slavelog
|
@info "" db jld2_slavelog
|
||||||
|
|
||||||
|
@ -264,10 +264,11 @@ true || include("../src/PSBoardDataBase.jl")
|
||||||
|
|
||||||
run(`sqlitebrowser $dbpath`)
|
run(`sqlitebrowser $dbpath`)
|
||||||
|
|
||||||
@test PSBoardDataBase.create_database_from_exported_csvs(
|
@test PSBoardDataBase.create_database(
|
||||||
tempname();
|
tempname();
|
||||||
masterlog_dir = "input/log/",
|
masterlog_dir = "input/log/",
|
||||||
slavelog_dir = "input/slavelogs/",
|
slavelog_dir = "input/slavelogs/",
|
||||||
|
slavelog_result = tempname(),
|
||||||
) isa SQLite.DB
|
) isa SQLite.DB
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue