Skip to content

Conversation

@araffin
Copy link
Member

@araffin araffin commented May 19, 2025

Description

See Stable-Baselines-Team/stable-baselines3-contrib#294

Motivation and Context

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)

Checklist:

  • I've read the CONTRIBUTION guide (required)
  • I have updated the changelog accordingly (required).
  • My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • I have updated the documentation accordingly.
  • I have reformatted the code using make format (required)
  • I have checked the codestyle using make check-codestyle and make lint (required)
  • I have ensured make pytest and make type both pass. (required)

Note: we are using a maximum length of 127 characters per line

@araffin araffin requested a review from Copilot May 19, 2025 09:57
Copy link

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 replaces lambda-based schedules with dedicated schedule classes for improved portability, bumps the version and dependencies to 2.6.1a1, and updates the changelog.

  • Bump sb3_contrib dependency and version to 2.6.1a1
  • Introduce SimpleLinearSchedule and replace linear_schedule/constant_fn with class-based schedules
  • Update imports in exp_manager.py and reflect changes in CHANGELOG.md

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
setup.py Bumped sb3_contrib requirement to >=2.6.1a1
rl_zoo3/version.txt Updated package version to 2.6.1a1
rl_zoo3/utils.py Added SimpleLinearSchedule class and alias function
rl_zoo3/exp_manager.py Switched from linear_schedule/constant_fn to class schedules
CHANGELOG.md Documented breaking changes and schedule refactor
Comments suppressed due to low confidence (2)

rl_zoo3/utils.py:295

  • Add unit tests for SimpleLinearSchedule (e.g., verifying output for given progress_remaining values and the __repr__ string) to ensure correct behavior and prevent regressions.
class SimpleLinearSchedule:

CHANGELOG.md:5

  • The changelog refers to linear_fn, but the actual function is named linear_schedule. Update the entry to match the correct function name to avoid confusion.
- `linear_fn` now returns a `SimpleLinearSchedule` object for better portability

@araffin araffin requested a review from Copilot May 19, 2025 10:18

This comment was marked as resolved.

@araffin araffin requested a review from Copilot May 19, 2025 10:39
Copy link

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 refactors the scheduling functionality by replacing lambda-based schedules with a dedicated schedule class, SimpleLinearSchedule, and updates corresponding tests and dependencies.

  • Introduced a new SimpleLinearSchedule class in rl_zoo3/utils.py
  • Updated tests in tests/test_wrappers.py to validate the new schedule class
  • Updated dependency versions and version.txt accordingly

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_wrappers.py Added tests for new schedule functionality and updated related imports
setup.py Bumped the sb3_contrib dependency version
rl_zoo3/version.txt Updated package version
rl_zoo3/utils.py Replaced lambda-based linear_schedule with SimpleLinearSchedule class
rl_zoo3/exp_manager.py Updated schedule and constant functions usage to use the new classes
CHANGELOG.md Updated release notes to reflect breaking changes and new features
Comments suppressed due to low confidence (1)

rl_zoo3/utils.py:310

  • [nitpick] Consider adding tests to verify the output of repr for SimpleLinearSchedule to ensure future maintainability.
def __repr__(self) -> str:

@araffin araffin merged commit 577616c into master May 19, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants