From ac8786cfbef1148756fc9c35aa4e9654343214fb Mon Sep 17 00:00:00 2001 From: Oliver Schulz Date: Thu, 25 Jul 2024 08:46:43 +0200 Subject: [PATCH 1/2] Fix const parameter handling in bat_report --- src/statistics/report.jl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/statistics/report.jl b/src/statistics/report.jl index ea8a3f27a..5aa80c320 100644 --- a/src/statistics/report.jl +++ b/src/statistics/report.jl @@ -56,11 +56,13 @@ function marginal_table(smplv::DensitySampleVector) end -function fixed_parameter_table(smplv::DensitySampleVector) +function _rpt_table_of_constparvals(smplv::DensitySampleVector) vs = elshape(smplv.v) - parkeys = Symbol.(get_fixed_names(vs)) - parvalues = [getproperty(vs, f).shape.value for f in parkeys] - TypedTables.Table(parameter = parkeys, value = string.(parvalues)) + # Need to convert, otherwise these can become Vector{Union{}} if parkeys is empty: + parkeys = convert(Vector{Symbol}, Symbol.(get_fixed_names(vs)))::Vector{Symbol} + parvalues = convert(Vector{Any}, [getproperty(vs, f).shape.value for f in parkeys]) + str_parvalues = convert(Vector{String}, string.(parvalues))::Vector{String} + TypedTables.Table(parameter = parkeys, value = str_parvalues) end @@ -92,7 +94,7 @@ function bat_report!(md::Markdown.MD, smplv::DensitySampleVector) marg_headermap = Dict(:parameter => "Parameter", :mean => "Mean", :std => "Std. dev.", :global_mode => "Gobal mode", :marginal_mode => "Marg. mode", :credible_intervals => "Cred. interval", :marginal_histogram => "Histogram") push!(md.content, BAT.markdown_table(Tables.columns(mod_marg_tbl), headermap = marg_headermap, align = [:l, :l, :l, :l, :l, :c, :l])) - fixed_tbl = fixed_parameter_table(smplv) + fixed_tbl = _rpt_table_of_constparvals(smplv) if !isempty(fixed_tbl) markdown_append!(md, """ ### Fixed parameters From a9c2f023e2c7489e15f53d75543c4d5fd0af9b2a Mon Sep 17 00:00:00 2001 From: Oliver Schulz Date: Thu, 25 Jul 2024 08:52:44 +0200 Subject: [PATCH 2/2] Update CI --- .github/workflows/CompatHelper.yml | 2 +- .github/workflows/TagBot.yml | 13 ------------- .github/workflows/ci.yml | 16 ++++++++-------- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index 091816104..8ad0284cf 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -15,7 +15,7 @@ jobs: run: which julia continue-on-error: true - name: Install Julia, but only if it is not already available in the PATH - uses: julia-actions/setup-julia@v1 + uses: julia-actions/setup-julia@v2 with: version: '1' arch: ${{ runner.arch }} diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index 90dc1009d..f38961114 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -8,18 +8,7 @@ on: lookback: default: 3 permissions: - actions: read - checks: read contents: write - deployments: read - issues: read - discussions: read - packages: read - pages: read - pull-requests: read - repository-projects: read - security-events: read - statuses: read jobs: TagBot: if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' @@ -28,6 +17,4 @@ jobs: - uses: JuliaRegistries/TagBot@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - # Edit the following line to reflect the actual name of the GitHub Secret containing your private key ssh: ${{ secrets.DOCUMENTER_KEY }} - # ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1023363d4..e3c2fdf76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,13 +48,13 @@ jobs: arch: x64 steps: - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: julia-actions/cache@v1 - with: - cache-packages: "false" + - uses: julia-actions/cache@v2 + #with: + # cache-packages: "false" - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 with: @@ -72,12 +72,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/setup-julia@v2 with: version: '1' - - uses: julia-actions/cache@v1 - with: - cache-packages: "false" + - uses: julia-actions/cache@v2 + #with: + # cache-packages: "false" - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-docdeploy@v1 env: