-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Improves contribution guidelines for IsaacLab #3403
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d56c3b9
fixes more build issues
Mayankm96 aeea789
adds code skeleton to snippets
Mayankm96 3e3063e
clarifies pr template size
Mayankm96 0cb75ab
makes tools and testing as main sections
Mayankm96 3076a95
adds ref to style
Mayankm96 4425e27
adds check for contribution guidelines
Mayankm96 d4ad39b
Update docs/source/refs/contributing.rst
Mayankm96 c81dc56
Update docs/source/refs/contributing.rst
Mayankm96 fc7f856
Merge branch 'main' into fix/code-guidelines
Mayankm96 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). | ||
# All rights reserved. | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
import os | ||
import sys | ||
from typing import ClassVar | ||
|
||
|
||
DEFAULT_TIMEOUT: int = 30 | ||
"""Default timeout for the task.""" | ||
|
||
_MAX_RETRIES: int = 3 # private constant (note the underscore) | ||
"""Maximum number of retries for the task.""" | ||
|
||
|
||
def run_task(task_name: str): | ||
"""Run a task by name. | ||
|
||
Args: | ||
task_name: The name of the task to run. | ||
""" | ||
print(f"Running task: {task_name}") | ||
|
||
|
||
class TaskRunner: | ||
"""Runs and manages tasks.""" | ||
|
||
DEFAULT_NAME: ClassVar[str] = "runner" | ||
"""Default name for the runner.""" | ||
|
||
_registry: ClassVar[dict] = {} | ||
"""Registry of runners.""" | ||
|
||
def __init__(self, name: str): | ||
"""Initialize the runner. | ||
|
||
Args: | ||
name: The name of the runner. | ||
""" | ||
self.name = name | ||
self._tasks = [] # private instance variable | ||
|
||
def __del__(self): | ||
"""Clean up the runner.""" | ||
print(f"Cleaning up {self.name}") | ||
|
||
def __repr__(self) -> str: | ||
return f"TaskRunner(name={self.name!r})" | ||
|
||
def __str__(self) -> str: | ||
return f"TaskRunner: {self.name}" | ||
|
||
""" | ||
Properties. | ||
""" | ||
|
||
@property | ||
def task_count(self) -> int: | ||
return len(self._tasks) | ||
|
||
""" | ||
Operations. | ||
""" | ||
|
||
def initialize(self): | ||
"""Initialize the runner.""" | ||
print("Initializing runner...") | ||
|
||
def update(self, task: str): | ||
"""Update the runner with a new task. | ||
|
||
Args: | ||
task: The task to add. | ||
""" | ||
self._tasks.append(task) | ||
print(f"Added task: {task}") | ||
|
||
def close(self): | ||
"""Close the runner.""" | ||
print("Closing runner...") | ||
|
||
""" | ||
Operations: Registration. | ||
""" | ||
|
||
@classmethod | ||
def register(cls, name: str, runner: "TaskRunner"): | ||
"""Register a runner. | ||
|
||
Args: | ||
name: The name of the runner. | ||
runner: The runner to register. | ||
""" | ||
if name in cls._registry: | ||
_log_error(f"Runner {name} already registered. Skipping registration.") | ||
return | ||
cls._registry[name] = runner | ||
|
||
@staticmethod | ||
def validate_task(task: str) -> bool: | ||
"""Validate a task. | ||
|
||
Args: | ||
task: The task to validate. | ||
|
||
Returns: | ||
True if the task is valid, False otherwise. | ||
""" | ||
return bool(task and task.strip()) | ||
|
||
""" | ||
Internal operations. | ||
""" | ||
|
||
def _reset(self): | ||
"""Reset the runner.""" | ||
self._tasks.clear() | ||
|
||
@classmethod | ||
def _get_registry(cls) -> dict: | ||
"""Get the registry.""" | ||
return cls._registry | ||
|
||
@staticmethod | ||
def _internal_helper(): | ||
"""Internal helper.""" | ||
print("Internal helper called.") | ||
|
||
|
||
""" | ||
Helper operations. | ||
""" | ||
|
||
|
||
def _log_error(message: str): | ||
"""Internal helper to log errors. | ||
|
||
Args: | ||
message: The message to log. | ||
""" | ||
print(f"[ERROR] {message}") | ||
|
||
|
||
class _TaskHelper: | ||
"""Private utility class for internal task logic.""" | ||
|
||
def compute(self) -> int: | ||
"""Compute the result. | ||
|
||
Returns: | ||
The result of the computation. | ||
""" | ||
return 42 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.