Skip to content

Commit 54ace04

Browse files
Add Devcontainer, handle DomainSets 0.7 (#1019)
1 parent 075d2b1 commit 54ace04

9 files changed

Lines changed: 65 additions & 24 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM julia:1.10
2+
3+
RUN apt-get update && apt-get install -y git

.devcontainer/devcontainer.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"customizations": {
3+
"vscode": {
4+
"extensions": [
5+
"julialang.language-julia"
6+
]
7+
}
8+
},
9+
"runArgs": [
10+
"--privileged"
11+
],
12+
"dockerFile": "Dockerfile",
13+
"updateContentCommand": "julia -e 'using Pkg; Pkg.develop(path=\"src/ReinforcementLearningBase\"); Pkg.develop(path=\"src/ReinforcementLearningEnvironments\"); Pkg.develop(path=\"src/ReinforcementLearningCore\"); Pkg.develop(path=\"src/ReinforcementLearningZoo\");'"
14+
}

.github/workflows/ci.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ jobs:
3131
- x64
3232
# - arm64
3333
steps:
34-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@v4
3535
with:
3636
fetch-depth: 100
3737
- uses: julia-actions/setup-julia@v1
3838
with:
3939
version: ${{ matrix.version }}
4040
arch: ${{ matrix.arch }}
41-
- uses: actions/cache@v3
41+
- uses: actions/cache@v4
4242
env:
4343
cache-name: cache-artifacts
4444
with:
@@ -50,7 +50,7 @@ jobs:
5050
${{ runner.os }}-
5151
- name: Get changed files
5252
id: RLBase-changed
53-
uses: tj-actions/changed-files@v41
53+
uses: tj-actions/changed-files@v42
5454
with:
5555
files: |
5656
src/ReinforcementLearningBase/**
@@ -79,14 +79,14 @@ jobs:
7979
- x64
8080
# - arm64
8181
steps:
82-
- uses: actions/checkout@v3
82+
- uses: actions/checkout@v4
8383
with:
8484
fetch-depth: 100
8585
- uses: julia-actions/setup-julia@v1
8686
with:
8787
version: ${{ matrix.version }}
8888
arch: ${{ matrix.arch }}
89-
- uses: actions/cache@v3
89+
- uses: actions/cache@v4
9090
env:
9191
cache-name: cache-artifacts
9292
with:
@@ -98,7 +98,7 @@ jobs:
9898
${{ runner.os }}-
9999
- name: Get changed files
100100
id: RLCore-changed
101-
uses: tj-actions/changed-files@v41
101+
uses: tj-actions/changed-files@v42
102102
with:
103103
files: |
104104
src/ReinforcementLearningCore/**
@@ -130,14 +130,14 @@ jobs:
130130
- x64
131131
# - arm64
132132
steps:
133-
- uses: actions/checkout@v3
133+
- uses: actions/checkout@v4
134134
with:
135135
fetch-depth: 100
136136
- uses: julia-actions/setup-julia@v1
137137
with:
138138
version: ${{ matrix.version }}
139139
arch: ${{ matrix.arch }}
140-
- uses: actions/cache@v3
140+
- uses: actions/cache@v4
141141
env:
142142
cache-name: cache-artifacts
143143
with:
@@ -149,7 +149,7 @@ jobs:
149149
${{ runner.os }}-
150150
- name: Get changed files
151151
id: RLZoo-changed
152-
uses: tj-actions/changed-files@v41
152+
uses: tj-actions/changed-files@v42
153153
with:
154154
files: |
155155
src/ReinforcementLearningZoo/**
@@ -183,14 +183,14 @@ jobs:
183183
- x64
184184
# - arm64
185185
steps:
186-
- uses: actions/checkout@v3
186+
- uses: actions/checkout@v4
187187
with:
188188
fetch-depth: 100
189189
- uses: julia-actions/setup-julia@v1
190190
with:
191191
version: ${{ matrix.version }}
192192
arch: ${{ matrix.arch }}
193-
- uses: actions/cache@v3
193+
- uses: actions/cache@v4
194194
env:
195195
cache-name: cache-artifacts
196196
with:
@@ -202,7 +202,7 @@ jobs:
202202
${{ runner.os }}-
203203
- name: Get changed files
204204
id: RLEnvironments-changed
205-
uses: tj-actions/changed-files@v41
205+
uses: tj-actions/changed-files@v42
206206
with:
207207
files: |
208208
src/ReinforcementLearningEnvironments/**
@@ -238,14 +238,14 @@ jobs:
238238
- x64
239239
# - arm64
240240
steps:
241-
- uses: actions/checkout@v3
241+
- uses: actions/checkout@v4
242242
with:
243243
fetch-depth: 100
244244
- uses: julia-actions/setup-julia@v1
245245
with:
246246
version: ${{ matrix.version }}
247247
arch: ${{ matrix.arch }}
248-
- uses: actions/cache@v3
248+
- uses: actions/cache@v4
249249
env:
250250
cache-name: cache-artifacts
251251
with:
@@ -258,7 +258,7 @@ jobs:
258258
259259
- name: Get changed files
260260
id: RLExperiments-changed
261-
uses: tj-actions/changed-files@v41
261+
uses: tj-actions/changed-files@v42
262262
with:
263263
files: |
264264
src/ReinforcementLearningExperiments/**
@@ -283,12 +283,12 @@ jobs:
283283
name: Documentation
284284
runs-on: ubuntu-latest
285285
steps:
286-
- uses: actions/checkout@v3
286+
- uses: actions/checkout@v4
287287
with:
288288
fetch-depth: 0
289289
- name: Get changed files
290290
id: documentation-changed
291-
uses: tj-actions/changed-files@v41
291+
uses: tj-actions/changed-files@v42
292292
with:
293293
files: |
294294
docs/**

.github/workflows/cspell.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ jobs:
1212
spellchecking:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616
name: Check out the code
17-
- uses: actions/setup-node@v1
17+
- uses: actions/setup-node@v4
1818
name: Run spell check
1919
with:
20-
node-version: "14"
20+
node-version: "21"
2121
- run: npm install -g cspell
2222
- run: cspell --config ./.cspell/cspell.json "**/*.jl" "**/*.md"

src/DistributedReinforcementLearning/.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323
arch:
2424
- x64
2525
steps:
26-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v4
2727
- uses: julia-actions/setup-julia@v1
2828
with:
2929
version: ${{ matrix.version }}
3030
arch: ${{ matrix.arch }}
31-
- uses: actions/cache@v1
31+
- uses: actions/checkout@v4
3232
env:
3333
cache-name: cache-artifacts
3434
with:

src/ReinforcementLearningBase/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1717
AbstractTrees = "0.3, 0.4"
1818
CommonRLInterface = "^0.3.2"
1919
CommonRLSpaces = "0.2"
20-
DomainSets = "0.6"
20+
DomainSets = "0.7"
2121
Reexport = "1"
2222
julia = "1.3"
2323

src/ReinforcementLearningBase/src/base.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import DomainSets
2+
13
#####
24
# printing
35
#####

src/ReinforcementLearningBase/src/space.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
export ArrayProductDomain
22

33
import DomainSets
4+
import Base.==
5+
46
@reexport using DomainSets: ×, (..), fullspace, TupleProductDomain
57

68
struct ArrayProductDomain{A<:AbstractArray,DD<:AbstractArray} <: DomainSets.ProductDomain{A}
@@ -31,6 +33,16 @@ DomainSets.toexternalpoint(d::ArrayProductDomain, y) =
3133

3234
DomainSets.promote_pair(x::AbstractArray, d::DomainSets.Domain{<:AbstractArray}) = x, d
3335

36+
# NOTE: This is a patch to maintain current behavior while using DomainSets >=0.7
37+
function ==(a1::ArrayProductDomain, a2::ArrayProductDomain)
38+
try
39+
return isequaldomain(a1, a2)
40+
catch e
41+
@warn "Use StaticArrays (e.g. SVector, SMatrix, or SArray when constructing `ArrayProductDomain` objects." maxlog=1
42+
return typeof(a1) == typeof(a2)
43+
end
44+
end
45+
3446
#####
3547
export NamedTupleProductDomain
3648

@@ -45,6 +57,16 @@ function NamedTupleProductDomain(; kv...)
4557
NamedTupleProductDomain(t, name2ind)
4658
end
4759

60+
# NOTE: This is a patch to maintain current behavior while using DomainSets >=0.7
61+
function ==(a1::NamedTupleProductDomain, a2::NamedTupleProductDomain)
62+
try
63+
return isequaldomain(a1, a2)
64+
catch e
65+
@warn "Use StaticArrays (e.g. SVector, SMatrix, or SArray when constructing `NamedTupleProductDomain` objects." maxlog=1
66+
return typeof(a1) == typeof(a2)
67+
end
68+
end
69+
4870
DomainSets.components(d::NamedTupleProductDomain) = components(d.tuple_product_domain)
4971
Base.getindex(d::NamedTupleProductDomain, x::Symbol) = components(d)[d.name2ind[x]]
5072
Base.getindex(d::NamedTupleProductDomain, x::Int) = components(d)[x]

src/ReinforcementLearningEnvironments/src/environments/3rd_party/atari.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function Base.show(io::IO, m::MIME"image/png", env::AtariEnv)
167167
show(io, m, p)
168168
end
169169

170-
Base.show(io::IO, t::MIME"text/plain", env::AbstractEnv) = show(
170+
Base.show(io::IO, t::MIME"text/plain", env::AtariEnv) = show(
171171
IOContext(io, :is_show_state => false, :is_show_state_space => false),
172172
MIME"text/markdown"(),
173173
env,

0 commit comments

Comments
 (0)