Skip to content

Commit eec768f

Browse files
Use preferred names
1 parent 11080dc commit eec768f

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/art/cli.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ def is_port_available(port: int) -> bool:
3636
return
3737

3838

39+
# Reset the custom __new__ and __init__ methods for TrajectoryGroup
40+
def __new__(cls, *args: Any, **kwargs: Any) -> TrajectoryGroup:
41+
return pydantic.BaseModel.__new__(cls)
42+
43+
def __init__(self, *args: Any, **kwargs: Any) -> None:
44+
return pydantic.BaseModel.__init__(self, *args, **kwargs)
45+
46+
TrajectoryGroup.__new__ = __new__ # type: ignore
47+
TrajectoryGroup.__init__ = __init__
48+
3949

4050
backend = LocalBackend()
4151
app = FastAPI()
@@ -141,7 +151,7 @@ async def _experimental_deploy(
141151
uvicorn.run(app, host=host, port=port, loop="asyncio")
142152

143153
@app.command()
144-
def delete(project_name: str, model_name: str):
154+
def delete_model(project_name: str, model_name: str):
145155
"""Move a model to the trash."""
146156
try:
147157
delete_model(project_name, model_name)
@@ -150,7 +160,7 @@ def delete(project_name: str, model_name: str):
150160
print(e)
151161

152162
@app.command()
153-
def list_trashed_models(project_name: str):
163+
def list_trash(project_name: str):
154164
"""List models in the trash."""
155165
trashed_models = list_trash(project_name)
156166
if not trashed_models:
@@ -170,7 +180,7 @@ def restore_model(project_name: str, model_name: str):
170180
print(e)
171181

172182
@app.command()
173-
def empty_trashed_models(project_name: str):
183+
def empty_trash(project_name: str):
174184
"""Permanently delete all models in the trash."""
175185
empty_trash(project_name)
176186
print("Trash has been emptied.")

0 commit comments

Comments
 (0)