google-research / clevr_robot_env

CLEVR-Robot: a reinforcement learning environment combining vision, language and control.
Apache License 2.0
129 stars 14 forks source link

Pull request to make library more portable #7

Open ethanabrooks opened 3 years ago

ethanabrooks commented 3 years ago

Hi, I am a researcher at University of Michigan. This environment looks perfect for my research and as part of starting to use it, I added some features that make these packages more portable IMO. I thought it might be worth submitting a pull request in the off chance you decided to integrate the changes.

This pull request looks like it has a lot of changes but they boil down to just three things:

  1. I added poetry to manage dependencies. Poetry makes a lot of build processes a lot easier. For one thing, one poetry package can easily install another poetry package just using its git url (in case you don't want to manage a package on PyPi). It also makes building and publishing to PyPi a lot easier.
  2. I moved all the source code and resource files into a clevr_robot_env/ subdirectory. Poetry seems to expect to have a project subdirectory like this in the root.
  3. I replaced the hard-coded resource paths with importlib.resources which basically allows you to use the import system to access static resources. It looks a little cleaner and I think it might be a little more portable.

I understand any hesitation in accepting a big pull-request like this but I have not touched the underlying logic and I'm using this package successfully as part of another package. If you look at that project's pyproject.toml you can see how it imports the clevr_robot_env package using git.

If you would feel more comfortable with it, I could take out the importlib.resources stuff and just leave the poetry stuff although I am not sure if those resource paths would still work.