Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix open-agent setup error. #1785

Merged
merged 2 commits into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions zoo/policies/open-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,4 @@ Since we make use of Rust code-generation and compilation at run-time, you'll ne

The easiest way to get up and running is to follow the instructions at https://rustup.rs/

## Precompiled Binaries

The open_agent-X.XXX.whl files contained here are precompiled agent policies, these policy wheels can be rebuilt using `./setup.py` located in this same folder.

The purpose is for `./tests/test_open_agent.py` to have static policy binaries to test with.

Build the docs and see `docs/readme.rst:4.3.2 RLlib Example`.
After that you may need to call `pip install . # with -e if preferred` up to 2 times. The first time will get the base dependencies, the second time will rebuild the solver. The solver will be output to the `../python-bindings-open-agent-solver` directory.
7 changes: 6 additions & 1 deletion zoo/policies/open-agent/open_agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
)
from smarts.core.coordinates import Heading

from .version import SOLVER_VERSION, VERSION
with open(
Path(__file__).parent.absolute() / "metadata.json", mode="r", encoding="ascii"
) as f:
meta = json.load(f)
VERSION = meta.get("VERSION")
SOLVER_VERSION = meta.get("SOLVER_VERSION")

CONFIG_PATH = Path(__file__).parent / "config.json"

Expand Down
4 changes: 4 additions & 0 deletions zoo/policies/open-agent/open_agent/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"VERSION": "0.1.195",
"SOLVER_VERSION": "0.0.9"
}
3 changes: 0 additions & 3 deletions zoo/policies/open-agent/open_agent/version.py

This file was deleted.

10 changes: 9 additions & 1 deletion zoo/policies/open-agent/setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import json
from pathlib import Path

from open_agent.version import VERSION
from setuptools import setup

with open(
Path(__file__).parent.absolute() / "open_agent/metadata.json",
mode="rt",
encoding="ascii",
) as f:
meta = json.load(f)
VERSION = meta.get("VERSION")

try:
import glob
import shutil
Expand Down