-
Notifications
You must be signed in to change notification settings - Fork 119
feat(skore/project)!: Enforce mode in a dedicated parameter
#2401
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
base: main
Are you sure you want to change the base?
Conversation
mode in a dedicated parameter
7f589a2 to
133baf1
Compare
133baf1 to
2bf8763
Compare
| If the ``name`` takes the form of the URI ``hub://<workspace>/<name>``, the project | ||
| is configured to the ``hub`` mode to communicate with the ``skore hub``. | ||
| The project is configured to the ``hub`` mode to communicate with the ``skore hub``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The project is configured to the ``hub`` mode to communicate with the ``skore hub``. |
| interface. It represents an isolated entity managing users, projects, and | ||
| resources. It can be a company, organization, or team that operates | ||
| independently within the system. | ||
| In this mode, the ``name`` takes the form ``<workspace>/<name>``, where the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| In this mode, the ``name`` takes the form ``<workspace>/<name>``, where the | |
| In this mode, the ``name`` is expected to be of the form ``<workspace>/<name>``, where the |
| resources. It can be a company, organization, or team that operates | ||
| independently within the system. | ||
| In this mode, the ``name`` takes the form ``<workspace>/<name>``, where the | ||
| workspace is a ``skore hub`` concept that must be configured on the ``skore hub`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we link to skore hub here?
| Also in this mode, you must have an account to the ``skore hub`` and must be | ||
| authorized to the specified workspace. You must also be authenticated beforehand, | ||
| by calling the ``skore.login()`` function at the top of your script. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Also in this mode, you must have an account to the ``skore hub`` and must be | |
| authorized to the specified workspace. You must also be authenticated beforehand, | |
| by calling the ``skore.login()`` function at the top of your script. | |
| Note: Using Project in `hub` mode requires an account on `skore hub`, | |
| with access rights to the specified workspace. Authentication to skore-hub | |
| is done by running `skore.login()` before instantiating the Project. |
| - otherwise, the project is configured to communicate with a local storage, | ||
| on the user machine. | ||
| The name of the project. | ||
| mode : {"hub", "local"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we have "local" as the default?
|
|
||
| @staticmethod | ||
| def delete(name: str, **kwargs): | ||
| def delete(name: str, *, mode: Mode, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Hm, this is making me not like that delete is a static method
|
|
||
|
|
||
| def login(*, mode: Literal["local", "hub"] = "hub", **kwargs): | ||
| def login(*, mode: Literal["hub", "local"] = "hub", **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reuse the Mode type
|
|
||
|
|
||
| def login(*, mode: Literal["local", "hub"] = "hub", **kwargs): | ||
| def login(*, mode: Literal["hub", "local"] = "hub", **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this function take a mode argument? It doesn't make sense to pass local to it right?
| plugins = entry_points(group="skore.plugins.login") | ||
|
|
||
| if mode not in plugins.names: | ||
| raise ValueError(f"Unknown mode `{mode}`. Please install `skore[{mode}]`.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this error could be factorized with the one in project.py
Closes #2330.