Git Product home page Git Product logo

Comments (7)

jbrea avatar jbrea commented on June 30, 2024 1

Why not just move the type definitions out of the file that is loaded with requires, but leave the rest as is? I could have a look at this in the next few days...

from reinforcementlearningenvironments.jl.

findmyway avatar findmyway commented on June 30, 2024

The reason is that we are using Requires.jl. Once JuliaLang/Pkg.jl#1285 gets resolved, we can switch to the new method.

Though PyCall is declared in [extras], it is only for testing.

from reinforcementlearningenvironments.jl.

AlexLewandowski avatar AlexLewandowski commented on June 30, 2024

I think Requires.jl is not well suited to how it is used for GymEnv (and others). I could not get GymEnv to be extensible in my own module through this package without removing the @require declaration for include("environments/gym.jl"). See this issue, which says that types and structs should not be defined in @require'd code.

It works fine in a REPL of course, but that is of limited use.

from reinforcementlearningenvironments.jl.

findmyway avatar findmyway commented on June 30, 2024

@AlexLewandowski Thanks for the link! I didn't know that when writing this package.

Right now, I don't have a good solution to it.

Previously we have registered several different packages, like ReinforcementLearningEnvironmentGym.jl and some others. Then we created this package with the help of Requires.jl for easier maintenance. Moving structs out of @required is not an option here since each 3-rd party environment has some specific dependencies which are not required by the basic environments. So now we have two options:

  1. Split this package into different sub-packages again.
    Personally I don't want to distribute them into separate repos. A better solution maybe register them in sub-directories in this repo. (Ref: JuliaLang/Pkg.jl#1251)

  2. Or we can wait and see if there're some elegant solutions in JuliaLang/Pkg.jl#1285 .

By the way, could you share more about what you want to extend with GymEnv?

from reinforcementlearningenvironments.jl.

jbrea avatar jbrea commented on June 30, 2024

Moving structs out of @required is not an option here since each 3-rd party environment has some specific dependencies which are not required by the basic environments.

Ah, yes, I see, it may not be as easy as I thought...

from reinforcementlearningenvironments.jl.

findmyway avatar findmyway commented on June 30, 2024

Some environments are just fine to move out. For example, AtariEnv doesn't have any specific types in its definition. And the definition of OpenSpielEnv is just general enough to be moved out.

But for GymEnv and MDPEnv, they have PyObject and POMDP constraint in its parameters. Maybe we are safe to just remove those constraints?

from reinforcementlearningenvironments.jl.

jbrea avatar jbrea commented on June 30, 2024

But for GymEnv and MDPEnv, they have PyObject and POMDP constraint in its parameters. Maybe we are safe to just remove those constraints?

We could check for these constraints in the constructor and make the fields parametric in the type def.

from reinforcementlearningenvironments.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.