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

feat: support interface of environment customization #310

Merged
merged 23 commits into from
Apr 9, 2024

Conversation

Gaiejj
Copy link
Member

@Gaiejj Gaiejj commented Apr 3, 2024

Description

  • Supports interfaces for customized environments;
  • Provides corresponding API documentation;
  • Releases tutorials for customized environments in both Chinese and English.

Motivation and Context

The environment customization interface is an important feature (see #291, #285, #305) OmniSafe Team. As a toolkit to accelerate SafeRL research, we offer a flexible environment customization interface with the following characteristics:

  • Almost unrestricted creation of customized environments
  • Parameter passing for environment creation
  • Recording of environment training information

Most importantly, users can embed their environments into the OmniSafe training framework with little to no modification of OmniSafe's source code. We provide detailed API documentation and tutorials for the SafeRL community to reference.

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

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

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

Checklist

Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!

  • I have read the CONTRIBUTION guide. (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 code using make lint. (required)
  • I have ensured make test pass. (required)

Copy link

codecov bot commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 72.47706% with 30 lines in your changes are missing coverage. Please review.

Project coverage is 96.56%. Comparing base (51a2692) to head (673ce70).

Files Patch % Lines
omnisafe/envs/custom_env.py 59.18% 20 Missing ⚠️
omnisafe/adapter/offpolicy_adapter.py 66.67% 1 Missing ⚠️
omnisafe/adapter/online_adapter.py 93.33% 1 Missing ⚠️
omnisafe/adapter/onpolicy_adapter.py 50.00% 1 Missing ⚠️
omnisafe/algorithms/off_policy/ddpg.py 66.67% 1 Missing ⚠️
...isafe/algorithms/on_policy/base/policy_gradient.py 75.00% 1 Missing ⚠️
omnisafe/envs/core.py 90.91% 1 Missing ⚠️
omnisafe/envs/mujoco_env.py 66.67% 1 Missing ⚠️
omnisafe/envs/safety_gymnasium_modelbased.py 66.67% 1 Missing ⚠️
omnisafe/evaluator.py 83.33% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #310      +/-   ##
==========================================
- Coverage   96.89%   96.56%   -0.33%     
==========================================
  Files         138      139       +1     
  Lines        7000     7089      +89     
==========================================
+ Hits         6782     6845      +63     
- Misses        218      244      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Gaiejj Gaiejj marked this pull request as ready for review April 3, 2024 14:47
tests/test_registry.py Outdated Show resolved Hide resolved
omnisafe/envs/core.py Outdated Show resolved Hide resolved
omnisafe/envs/core.py Outdated Show resolved Hide resolved
muchvo
muchvo previously approved these changes Apr 8, 2024
Copy link
Collaborator

@muchvo muchvo left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Collaborator

@muchvo muchvo left a comment

Choose a reason for hiding this comment

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

LGTM.

@Gaiejj Gaiejj merged commit efe7d9c into PKU-Alignment:main Apr 9, 2024
4 checks passed
@Gaiejj Gaiejj mentioned this pull request Apr 21, 2024
12 tasks
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.

None yet

2 participants