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

chore: update ci #90

Merged
merged 62 commits into from
Feb 1, 2023
Merged

chore: update ci #90

merged 62 commits into from
Feb 1, 2023

Conversation

Gaiejj
Copy link
Member

@Gaiejj Gaiejj commented Jan 26, 2023

Description

chore: update ci

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)

@Gaiejj Gaiejj marked this pull request as draft January 26, 2023 09:03
@codecov
Copy link

codecov bot commented Jan 26, 2023

Codecov Report

❗ No coverage uploaded for pull request base (dev@6b0c69e). Click here to learn what that means.
Patch has no changes to coverable lines.

❗ Current head 71ed1cd differs from pull request most recent head 94e1abc. Consider uploading reports for the commit 94e1abc to get more accurate results

Additional details and impacted files
@@          Coverage Diff           @@
##             dev      #90   +/-   ##
======================================
  Coverage       ?   63.72%           
======================================
  Files          ?      110           
  Lines          ?     5863           
  Branches       ?        0           
======================================
  Hits           ?     3736           
  Misses         ?     2127           
  Partials       ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -116,7 +116,10 @@ def check_all_configs(configs: NamedTuple, algo_type: str) -> None:
configs (dict): configs to be checked.
algo_type (str): algorithm type.
"""
check_env_configs(configs.env_cfgs, wrapper_type=configs.wrapper_type)
# check_model_configs(configs.model_cfgs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why comment on this line



# pylint: disable-next=too-many-arguments,too-many-locals
# pylint: disable-next=too-many-arguments, too-many-locals
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# pylint: disable-next=too-many-arguments, too-many-locals
# pylint: disable-next=too-many-arguments,too-many-locals

"""Test algorithms"""
env_id = 'SafetyPointGoal1-v0'
custom_cfgs = {'epochs': 1, 'steps_per_epoch': 2000, 'pi_iters': 1, 'critic_iters': 1}
"""Test off policy algorithms"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"""Test off policy algorithms"""
"""Test off policy algorithms."""


@helpers.parametrize(algo=simmer_policy)
def test_simmer_policy(algo):
"""Test Simmer algorithms"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"""Test Simmer algorithms"""
"""Test Simmer algorithms."""

)
def test_on_policy(algo, agent_id, env_id, level):
def test_safety_nvigation(algo, agent_id, env_id, level):
"""Test environments"""
env_id = 'Safety' + agent_id + env_id + level + '-v0'
# env_id = 'PointGoal1'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# env_id = 'PointGoal1'

'env_cfgs': {'num_envs': 1},
}
agent = omnisafe.Agent(algo, env_id, custom_cfgs=custom_cfgs, parallel=1)
# agent.set_seed(seed=0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# agent.set_seed(seed=0)

def test_safety_velocity(algo, agent_id, env_id):
"""Test environments"""
env_id = 'Safety' + agent_id + env_id + '-v4'
# env_id = 'PointGoal1'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# env_id = 'PointGoal1'

# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Test Utils"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"""Test Utils"""
"""Test Utils."""

steps_per_epoch=1000,
num_envs=1,
):
"""Test train"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"""Test train"""
"""Test train."""



def get_answer(gamma: float) -> torch.Tensor:
"""Input gamma and return the answer"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"""Input gamma and return the answer"""
"""Input gamma and return the answer."""

def test_discount_cumsum_torch(
discount: float,
):
"""Test discount_cumsum_torch"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"""Test discount_cumsum_torch"""
"""Test discount_cumsum_torch."""



def test_distributed_tools():
"""Test mpi_fork"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"""Test mpi_fork"""
"""Test mpi_fork."""


@helpers.parametrize(item=[1, 1.0, [1, 2, 3], (1, 2, 3), {'a': 1, 'b': 2}, torch.tensor([1, 2, 3])])
def test_to_ndarray(item):
"""Test to_ndarray"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"""Test to_ndarray"""
"""Test to_ndarray."""

@@ -14,32 +14,39 @@
# ==============================================================================
"""Test models"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"""Test models"""
"""Test models."""

Copy link
Member

@zmsn-2077 zmsn-2077 left a comment

Choose a reason for hiding this comment

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

After careful review, I agree with these changes.

Copy link
Collaborator

@friedmainfunction friedmainfunction left a comment

Choose a reason for hiding this comment

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

Approve.

@Gaiejj Gaiejj marked this pull request as ready for review February 1, 2023 15:45
@Gaiejj Gaiejj merged commit b4bc80f into PKU-Alignment:dev Feb 1, 2023
@Gaiejj Gaiejj deleted the dev branch February 1, 2023 15:45
zmsn-2077 pushed a commit that referenced this pull request Feb 5, 2023
@zmsn-2077 zmsn-2077 added bug Something isn't working dependency Something related to package dependencies labels Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependency Something related to package dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants