Spaces:
Running
Running
Commit ·
5b82789
1
Parent(s): 689c71b
dockerfile
Browse files- AGENTS.md +1 -1
- Dockerfile +20 -0
- README.md +11 -1
- pyproject.toml +1 -1
- server/app.py +2 -2
- server/{grid_environment.py → environment.py} +0 -0
- server/requirements.txt +7 -6
- submission/README.md +1 -1
- tests/test_grid2op_env.py +1 -1
AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
# Repository Guidelines
|
| 2 |
|
| 3 |
## Project Structure & Module Organization
|
| 4 |
-
The package is rooted at the repository top level. Core models live in `models.py`, the baseline agent in `inference.py`, the client helper in `client.py`, and topology analysis in `graph_analysis.py`. The FastAPI/OpenEnv server lives in `server/` with `app.py`, `
|
| 5 |
|
| 6 |
## Build, Test, and Development Commands
|
| 7 |
Use `uv` for local work.
|
|
|
|
| 1 |
# Repository Guidelines
|
| 2 |
|
| 3 |
## Project Structure & Module Organization
|
| 4 |
+
The package is rooted at the repository top level. Core models live in `models.py`, the baseline agent in `inference.py`, the client helper in `client.py`, and topology analysis in `graph_analysis.py`. The FastAPI/OpenEnv server lives in `server/` with `app.py`, `environment.py`, `tasks.py`, `graders.py`, and logging helpers. Tests are in `tests/`, reference docs in `docs/` and `architecture/`, and submission utilities in `submission/`. Runtime artifacts go under `outputs/logs/` and `outputs/evals/`.
|
| 5 |
|
| 6 |
## Build, Test, and Development Commands
|
| 7 |
Use `uv` for local work.
|
Dockerfile
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
+
|
| 3 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
| 4 |
+
ENV PYTHONUNBUFFERED=1
|
| 5 |
+
ENV PIP_NO_CACHE_DIR=1
|
| 6 |
+
|
| 7 |
+
WORKDIR /app
|
| 8 |
+
|
| 9 |
+
COPY . /app
|
| 10 |
+
|
| 11 |
+
RUN pip install --upgrade pip
|
| 12 |
+
RUN pip install -r server/requirements.txt
|
| 13 |
+
RUN pip install -e .
|
| 14 |
+
|
| 15 |
+
# Pre-download the required Grid2Op dataset at build time.
|
| 16 |
+
RUN python -c "import grid2op; env = grid2op.make('l2rpn_case14_sandbox'); env.close()"
|
| 17 |
+
|
| 18 |
+
EXPOSE 7860
|
| 19 |
+
|
| 20 |
+
CMD ["uvicorn", "grid2op_env.server.app:app", "--host", "0.0.0.0", "--port", "7860"]
|
README.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Grid2Op Environment
|
| 2 |
|
| 3 |
Standalone OpenEnv environment package for the full `PROJECT.md` design.
|
|
@@ -22,7 +32,7 @@ grid2op_env/
|
|
| 22 |
│ └── evals/
|
| 23 |
├── pyproject.toml
|
| 24 |
└── server/
|
| 25 |
-
├──
|
| 26 |
├── tasks.py
|
| 27 |
├── graders.py
|
| 28 |
├── app.py
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Grid2Op Environment
|
| 3 |
+
emoji: "⚡"
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 7860
|
| 8 |
+
pinned: false
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
# Grid2Op Environment
|
| 12 |
|
| 13 |
Standalone OpenEnv environment package for the full `PROJECT.md` design.
|
|
|
|
| 32 |
│ └── evals/
|
| 33 |
├── pyproject.toml
|
| 34 |
└── server/
|
| 35 |
+
├── environment.py
|
| 36 |
├── tasks.py
|
| 37 |
├── graders.py
|
| 38 |
├── app.py
|
pyproject.toml
CHANGED
|
@@ -27,7 +27,7 @@ lightsim = [
|
|
| 27 |
|
| 28 |
[project.scripts]
|
| 29 |
server = "grid2op_env.server.app:main"
|
| 30 |
-
grid2op-smoke = "grid2op_env.server.
|
| 31 |
|
| 32 |
[tool.setuptools]
|
| 33 |
include-package-data = true
|
|
|
|
| 27 |
|
| 28 |
[project.scripts]
|
| 29 |
server = "grid2op_env.server.app:main"
|
| 30 |
+
grid2op-smoke = "grid2op_env.server.environment:smoke_main"
|
| 31 |
|
| 32 |
[tool.setuptools]
|
| 33 |
include-package-data = true
|
server/app.py
CHANGED
|
@@ -20,7 +20,7 @@ try:
|
|
| 20 |
TaskListResponse,
|
| 21 |
)
|
| 22 |
from .graders import grade_episode
|
| 23 |
-
from .
|
| 24 |
from .logging_utils import configure_logging
|
| 25 |
from .tasks import task_list
|
| 26 |
except ImportError:
|
|
@@ -38,7 +38,7 @@ except ImportError:
|
|
| 38 |
TaskListResponse,
|
| 39 |
)
|
| 40 |
from server.graders import grade_episode
|
| 41 |
-
from server.
|
| 42 |
from server.logging_utils import configure_logging
|
| 43 |
from server.tasks import task_list
|
| 44 |
|
|
|
|
| 20 |
TaskListResponse,
|
| 21 |
)
|
| 22 |
from .graders import grade_episode
|
| 23 |
+
from .environment import GridEnvironment
|
| 24 |
from .logging_utils import configure_logging
|
| 25 |
from .tasks import task_list
|
| 26 |
except ImportError:
|
|
|
|
| 38 |
TaskListResponse,
|
| 39 |
)
|
| 40 |
from server.graders import grade_episode
|
| 41 |
+
from server.environment import GridEnvironment
|
| 42 |
from server.logging_utils import configure_logging
|
| 43 |
from server.tasks import task_list
|
| 44 |
|
server/{grid_environment.py → environment.py}
RENAMED
|
File without changes
|
server/requirements.txt
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
-
openenv-core[core]
|
| 2 |
-
grid2op
|
| 3 |
-
numpy
|
| 4 |
-
openai
|
| 5 |
-
python-dotenv
|
| 6 |
-
requests
|
|
|
|
|
|
| 1 |
+
openenv-core[core]
|
| 2 |
+
grid2op
|
| 3 |
+
numpy
|
| 4 |
+
openai
|
| 5 |
+
python-dotenv
|
| 6 |
+
requests
|
| 7 |
+
numba
|
submission/README.md
CHANGED
|
@@ -114,7 +114,7 @@ Must include:
|
|
| 114 |
- ✅ `reset()` produces clean state?
|
| 115 |
- ✅ Action/observation types well-designed and documented?
|
| 116 |
- ✅ Reward function provides useful varying signal (not just sparse)?
|
| 117 |
-
- ✅ Episode boundaries sensible?
|
| 118 |
|
| 119 |
#### Code quality & spec compliance (15%)
|
| 120 |
- ✅ `openenv validate` passes?
|
|
|
|
| 114 |
- ✅ `reset()` produces clean state?
|
| 115 |
- ✅ Action/observation types well-designed and documented?
|
| 116 |
- ✅ Reward function provides useful varying signal (not just sparse)?
|
| 117 |
+
- ✅ Episode boundaries sensible?dob
|
| 118 |
|
| 119 |
#### Code quality & spec compliance (15%)
|
| 120 |
- ✅ `openenv validate` passes?
|
tests/test_grid2op_env.py
CHANGED
|
@@ -24,7 +24,7 @@ from grid2op_env.server.graders import (
|
|
| 24 |
grade_n_minus_1,
|
| 25 |
grade_single_fault,
|
| 26 |
)
|
| 27 |
-
from grid2op_env.server.
|
| 28 |
from grid2op_env.server.tasks import TASKS, inject_scenario_raw
|
| 29 |
|
| 30 |
|
|
|
|
| 24 |
grade_n_minus_1,
|
| 25 |
grade_single_fault,
|
| 26 |
)
|
| 27 |
+
from grid2op_env.server.environment import GridEnvironment
|
| 28 |
from grid2op_env.server.tasks import TASKS, inject_scenario_raw
|
| 29 |
|
| 30 |
|