This repository was archived by the owner on Oct 10, 2025. It is now read-only.
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new BACKUP environment mode, enhances callback signatures for flexibility, and bumps the project version to 0.2.1.
- Add
BACKUPmode toSwanLabModeand update related documentation. - Modify
on_initcallback signature by inserting apublicparameter and remove the unusednumparameter frombefore_init_experiment. - Bump project version in
pyproject.tomlfrom 0.2.0 to 0.2.1.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| swankit/env.py | Replaced CLOUD_ONLY with BACKUP in SwanLabMode and updated the shared env docstring. |
| swankit/callback/init.py | Added public parameter to on_init and removed num from before_init_experiment. |
| pyproject.toml | Updated version to 0.2.1. |
Comments suppressed due to low confidence (1)
swankit/env.py:52
- The new
BACKUPmode should have accompanying tests to verify correct behavior in environment detection and callback registration.
swanlab的解析模式,涉及操作员注册的回调,目前有四种:local、cloud、disabled 和 backup,默认为cloud
| """ | ||
|
|
||
| def on_init(self, proj_name: str, workspace: str, logdir: str = None, *args, **kwargs): | ||
| def on_init(self, proj_name: str, workspace: str, public: bool = None, logdir: str = None, *args, **kwargs): |
There was a problem hiding this comment.
Reordering the signature by inserting public before logdir may break existing implementations that rely on positional arguments. Consider placing public after logdir or supporting both signatures for backward compatibility.
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This pull request introduces updates to the
swankitproject, including changes to versioning, callback function parameters, and environment modes. The most notable changes involve adding a new environment mode (BACKUP) and modifying callback functions to enhance flexibility and usability.Versioning Update:
pyproject.toml: Updated the project version from0.2.0to0.2.1.Callback Function Enhancements:
swankit/callback/__init__.py: Added a newpublicparameter to theon_initmethod in theSwanKitCallbackclass, allowing specification of whether the project is public.swankit/callback/__init__.py: Removed thenumparameter from thebefore_init_experimentmethod, simplifying the function signature. [1] [2]Environment Mode Updates:
swankit/env.py: Replaced theCLOUD_ONLYmode with a newBACKUPmode in theSwanLabModeenum.swankit/env.py: Updated the documentation for theSwanLabSharedEnvenum to reflect the addition of theBACKUPmode.