diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..f01b673 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,3 @@ +FROM julia:1.10 + +RUN apt-get update && apt-get install -y git diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..1410550 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,15 @@ +{ + "customizations": { + "vscode": { + "extensions": [ + "julialang.language-julia", + "ms-azuretools.vscode-docker" + ] + } + }, + "runArgs": [ + "--privileged" + ], + "dockerFile": "Dockerfile", + "updateContentCommand": "julia -e 'using Pkg; Pkg.develop(path=\".\");'" +} diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 35a34d1..b8354d8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -5,6 +5,7 @@ on: - main tags: '*' pull_request: + workflow_dispatch: concurrency: # Skip intermediate builds: always. # Cancel intermediate builds: only if it is a pull request build. diff --git a/test/episodes.jl b/test/episodes.jl index ef7855c..7c297d5 100644 --- a/test/episodes.jl +++ b/test/episodes.jl @@ -116,7 +116,8 @@ using Test @test eb.sampleable_inds == [1,1,1,1,1,0,0] @test eb[:action][6] == 6 @test eb[:next_action][5] == 6 - @test eb[6][:reward] == 0 #6 is not a valid index, the reward there is dummy, filled as zero + @test eb[:reward][6] == 0 #6 is not a valid index, the reward there is dummy, filled as zero + @test_throws BoundsError eb[6] #6 is not a valid index, the reward there is dummy, filled as zero ep2_len = 0 for (j,i) = enumerate(8:11) ep2_len += 1 diff --git a/test/traces.jl b/test/traces.jl index f30b311..26ba16c 100644 --- a/test/traces.jl +++ b/test/traces.jl @@ -167,8 +167,10 @@ end @test t1[:reward][1] == 5 @test size(Base.getindex(t1, :reward)) == (1,) - @test size(Base.getindex(t1, 1).state) == (2,3) + push!(t1, Val(:state), ones(2,3)) + + @test t1[:state][1] == ones(2,3) t2 = Traces(; a=[2, 3], b=[false, true]) push!(t2, Val(:a), 5)