-
Notifications
You must be signed in to change notification settings - Fork 35
Fixes for 1.0 #23
Fixes for 1.0 #23
Conversation
.travis.yml
Outdated
| - julia -e 'Pkg.clone(pwd()); Pkg.build("Reinforce"); Pkg.test("Reinforce"; coverage=false)' | ||
| # script: | ||
| # - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi | ||
| # - julia -e 'Pkg.clone(pwd()); Pkg.build("Reinforce"); Pkg.test("Reinforce"; coverage=false)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine to just removing the script section.
|
|
||
| function test_ep_iteration() | ||
| info("interface::iteration::maxsteps") | ||
| @info "interface::iteration::maxsteps" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this @info will break the 0.6 support.
(But I'm fine about just dropping 0.6 support.)
Which will you vote fro? dropping or not dropping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually added using Compat: @info here in runtests.jl, so that 0.6 tests pass, but anyway, I think we should drop 0.6 for future changes. I doubt many people, if anyone, are relying on this to work for 0.6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt many people, if anyone, are relying on this to work for 0.6.
There is a tagged stable release for 0.6. So it's okay to drop 0.6 support now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My OpenAIGym PRs also work on 0.6 btw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh okay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh actually, just checked and JuliaML/OpenAIGym.jl/pull/10 works, but the others don't on 0.6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, you mean all the PRs are based on 1.0, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but it's prob a minor change to get them working for 0.6, OTOH 0.6 is old news 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, I will vote for dropping it.
| - linux | ||
| julia: | ||
| - 0.6 | ||
| - 1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and add 0.7?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess if it works on 1.0 it'll work on 0.7 though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah
|
So what's the verdict you want me to do anything more here? |
|
I need some time to test it manually |
|
Got this on 0.7 patch: diff --git a/src/Reinforce.jl b/src/Reinforce.jl
index 9ac3681..91a47ad 100644
--- a/src/Reinforce.jl
+++ b/src/Reinforce.jl
@@ -1,6 +1,3 @@
-
-__precompile__(true)
-
module Reinforce
using Reexport
@@ -70,7 +67,6 @@ finished(env::AbstractEnvironment, s′) = false
Return a list/set/description of valid actions from state `s′`.
"""
-# actions(env::AbstractEnvironment) = actions(env, state(env))
function actions end
# note for developers: you don't need to implement these if you have state/reward fields |
patch: diff --git a/src/envs/mountain_car.jl b/src/envs/mountain_car.jl
index 030fece..803b121 100644
--- a/src/envs/mountain_car.jl
+++ b/src/envs/mountain_car.jl
@@ -6,6 +6,7 @@ module MountainCarEnv
using Reinforce: AbstractEnvironment
using LearnBase: DiscreteSet
+using Random: srand
using RecipesBase
using Distributions
|
|
miner change: diff --git a/src/episodes/iterators.jl b/src/episodes/iterators.jl
index fd906e7..7d8b194 100644
--- a/src/episodes/iterators.jl
+++ b/src/episodes/iterators.jl
@@ -56,8 +56,7 @@ end
@static if VERSION >= v"0.7"
- Base.iterate(ep::Episode) = _next(ep::Episode, _start(ep))
- Base.iterate(ep::Episode, i) = _next(ep::Episode, i)
+ Base.iterate(ep::Episode, i::Integer = _start(ep)) = _next(ep::Episode, i)
else
Base.start(ep::Episode) = _start(ep)
Base.next(ep::Episode, i) = _next(ep, i) |
|
travis stuffs diff --git a/.travis.yml b/.travis.yml
index cebc7d0..7270a8e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,10 +4,7 @@ os:
- linux
julia:
- 0.6
+ - 0.7
- 1.0
- - nightly
-matrix:
- allow_failures:
- - julia: nightly
notifications:
email: false |
|
ah, I want to drop 0.6 support and just write this diff --git a/src/envs/mountain_car.jl b/src/envs/mountain_car.jl
index 030fece..0f1f88e 100644
--- a/src/envs/mountain_car.jl
+++ b/src/envs/mountain_car.jl
@@ -6,6 +6,7 @@ module MountainCarEnv
using Reinforce: AbstractEnvironment
using LearnBase: DiscreteSet
+using Random: seed!
using RecipesBase
using Distributions
@@ -45,7 +46,7 @@ MountainCar(seed=-1) = MountainCar(MountainCarState(0.0, 0.0), 0.0, seed)
function reset!(env::MountainCar)
if env.seed >= 0
- srand(env.seed)
+ seed!(env.seed)
env.seed = -1
end
|
| else | ||
| seed! = srand | ||
| end | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both 0.7 and 1.0 are Random.seed!.
Invoking Random.srand in 0.7 will pop the deprecation warning up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, you're right, i don't know how I got the impression that it wasn't.
iblislin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contributions!
|
Thank you for taking the time to review! |
Fairly minimal set of changes to get this running on 1.0, and still maintain compatibility with 0.6 for now.
Required for JuliaML/OpenAIGym.jl#10 to work.