Skip to content

Conversation

@shankerram3
Copy link

Fixed all the comments in PR #108

shankerram3 and others added 12 commits October 27, 2025 18:51
Updated README with sample rendering code for wildfree simulation.
Added sections on wildfire simulation motivation, research goals, and citations to the README.
This commit addresses all the review comments from PR meta-pytorch#108:

1. Remove .ipynb_checkpoints directories from version control
   - Deleted all checkpoint files that were accidentally committed

2. Fix hardcoded file paths in README
   - Removed hardcoded path: sys.path.append("/workspace/OpenEnv/src")
   - Changed port from 8020 to 8000 for consistency
   - Removed unnecessary import of WildfireEnvironment from example

3. Standardize environment variable naming
   - Changed WILDFIRE_W to WILDFIRE_WIDTH in server/app.py
   - Changed WILDFIRE_H to WILDFIRE_HEIGHT in server/app.py
   - Now consistent with documentation and other env vars

4. Fix action case consistency
   - Changed "WAIT" to "wait" in README example
   - Ensures consistency with lowercase action names

5. Add note about Jupyter-specific dependencies
   - Added note in README explaining IPython requirements
   - References new standalone example file

6. Add burn_timers to WildfireState dataclass
   - Added burn_timers field to models.py for type safety
   - Prevents runtime attribute assignment outside dataclass

7. Create examples/wildfire.py demonstration file
   - New standalone Python example without Jupyter dependencies
   - Demonstrates basic firefighting strategy
   - Includes visualization using render_grid function

8. Code cleanup
   - Fixed formatting in models.py (moved misplaced comment)
   - Removed unused imports (List, replace) from wildfire_environment.py
   - Improved import organization and PEP 8 compliance
   - Fixed typo: "wildfree" to "wildfire" in README

All changes maintain backward compatibility while improving
code quality and usability.
Address final Copilot AI review comments:

1. Add blank line before render_grid function (PEP 8)
   - Added two blank lines between class and module-level function

2. Fix excessive whitespace in client.py
   - Removed extra spaces after "burned=" in metadata string

3. Fix inconsistent indentation in wildfire_environment.py
   - Corrected state property indentation to use 4-space standard
   - Fixed comment alignment
   - Fixed docstring and return statement indentation

All code now follows PEP 8 style guidelines.
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 2, 2025
@github-actions
Copy link

github-actions bot commented Nov 2, 2025

⚠️ Deployment failed for wildfire_env

  • Space repo:
  • Live URL:

Please resolve your environment.

You can iterate locally or validate fixes by running scripts/deploy_to_hf.sh --env "wildfire_env".

@github-actions
Copy link

github-actions bot commented Nov 2, 2025

✅ Deployment succeeded for wildfire_env

Nice work! Wait for a code review and we're ready to go.

You can iterate locally or validate fixes by running scripts/deploy_to_hf.sh --env "wildfire_env".

@init27 init27 requested a review from Copilot November 2, 2025 19:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new Wildfire Environment to the OpenEnv framework, enabling reinforcement learning research on autonomous wildfire containment strategies. The environment simulates weather-aware fire spread dynamics where agents must strategically use water and firebreaks to contain fires under varying wind and humidity conditions.

Key changes:

  • Implements a grid-based wildfire simulation with 8-directional spread, wind effects, and humidity factors
  • Adds server-side environment (WildfireEnvironment) with configurable parameters and reward shaping
  • Provides HTTP client (WildfireEnv) with visualization utilities for monitoring fire dynamics
  • Integrates with CI/CD pipelines for automated HuggingFace deployment

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/envs/wildfire_env/server/wildfire_environment.py Core simulation engine implementing fire spread, agent actions, and reward computation
src/envs/wildfire_env/models.py Data models for actions, observations, and state
src/envs/wildfire_env/client.py HTTP client and grid rendering utilities
src/envs/wildfire_env/server/app.py FastAPI application setup with environment variable configuration
src/envs/wildfire_env/server/Dockerfile Container configuration for deploying the environment
src/envs/wildfire_env/server/build_docker.sh Docker build automation script
src/envs/wildfire_env/README.md Comprehensive documentation with usage examples and references
examples/wildfire.py Example script demonstrating environment usage and agent strategies
.github/workflows/deploy-hf-env.yml CI/CD workflow updates for wildfire environment
scripts/prepare_hf_deployment.sh Deployment script updates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

✅ Deployment succeeded for wildfire_env

Nice work! Wait for a code review and we're ready to go.

You can iterate locally or validate fixes by running scripts/deploy_to_hf.sh --env "wildfire_env".

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

✅ Deployment succeeded for wildfire_env

Nice work! Wait for a code review and we're ready to go.

You can iterate locally or validate fixes by running scripts/deploy_to_hf.sh --env "wildfire_env".

2 similar comments
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

✅ Deployment succeeded for wildfire_env

Nice work! Wait for a code review and we're ready to go.

You can iterate locally or validate fixes by running scripts/deploy_to_hf.sh --env "wildfire_env".

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

✅ Deployment succeeded for wildfire_env

Nice work! Wait for a code review and we're ready to go.

You can iterate locally or validate fixes by running scripts/deploy_to_hf.sh --env "wildfire_env".

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

✅ Deployment succeeded for wildfire_env

Nice work! Wait for a code review and we're ready to go.

You can iterate locally or validate fixes by running scripts/deploy_to_hf.sh --env "wildfire_env".

This commit addresses critical runtime errors and adds comprehensive
documentation for the wildfire environment.

Bug Fixes:
- Fix TypeError in in_bounds() and idx() functions by adding defensive
  type conversion for all parameters (x, y, w, h) to ensure integers
- Fix IndexError in _apply_water(), _apply_break(), _spread_fire(), and
  reset() by adding bounds checks before accessing grid arrays
- Ensure self.w and self.h are explicitly cast to int during initialization
- Add safety checks in _spread_fire() for ignite_flags array bounds
- Use local w/h variables after type conversion to maintain consistency

Infrastructure:
- Add run_wildfire_docker.sh convenience script with automatic base
  image building and log streaming
- Script builds openenv-base:latest if missing and rebuilds wildfire
  image to ensure latest code is included

Documentation:
- Complete rewrite of wildfire_env/README.md with comprehensive guide
  - Detailed action documentation with rewards and use cases
  - Grid format explanation with code examples
  - Fire spread mechanics and wind effects
  - Complete API reference with examples
  - Four practical code examples (containment, firebreak, visualization, RL)
  - Troubleshooting guide for common issues
  - Configuration options and environment variables
  - Web interface usage guide
  - Performance considerations

All changes are backward compatible and improve environment stability
and usability for both RL agents and developers.
@github-actions
Copy link

github-actions bot commented Nov 4, 2025

✅ Deployment succeeded for wildfire_env

Nice work! Wait for a code review and we're ready to go.

You can iterate locally or validate fixes by running scripts/deploy_to_hf.sh --env "wildfire_env".

claude and others added 18 commits January 4, 2026 19:30
- Fix CMD format: Changed from problematic sh -lc exec form to shell form
  to allow PORT variable expansion required by Hugging Face Spaces
- Update dependency: Changed openenv-core>=0.1.0 to openenv-core[core]>=0.2.0
  to match other standalone environments (snake_env, coding_env)
- Add proxy headers for HF Spaces compatibility
- Resolves ModuleNotFoundError when deploying to Hugging Face Spaces
- Fix Windows console encoding to support Unicode characters in CLI
- Add UTF-8 encoding for file operations in push command
- Create http_env_client.py module with HTTPEnvClient class
- Add compatibility shim for wildfire_env to work with older openenv-core packages
- Update client.py to use compatibility shim as fallback
@shankerram3
Copy link
Author

@burtenshaw hey i have made the necessary changes, please take a look when you are free and let me know if anything else needs to be done. The environment is up and running at https://huggingface.co/spaces/shankerram3/wildfire_env and updated docs/environment.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. New Environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants