Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/mri_advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,25 @@ elo = participant.get_elo() # None if not computed yet
print(f"{participant.name}: {elo}")
```

### Renaming a Participant

```python
participant = benchmark.participants[0]
participant.rename("New model name")
```

### Disabling Participants

A disabled participant is excluded from evaluation and the computed standings. Unlike deleting, this is reversible:

```python
participant = benchmark.participants[0]
participant.disable()

# Bring it back into the evaluation later
participant.enable()
```

### Deleting Participants

You can remove a participant — and its uploaded media — from the benchmark. This cannot be undone:
Expand Down
43 changes: 43 additions & 0 deletions src/rapidata/rapidata_client/benchmark/participant/participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,49 @@ def run(self) -> None:
)
self._status = ParticipantStatus.SUBMITTED

def disable(self) -> None:
"""Disables the participant in the benchmark.

A disabled participant is excluded from evaluation and the computed
standings. Use :meth:`enable` to reverse this.
"""
with tracer.start_as_current_span("BenchmarkParticipant.disable"):
self._openapi_service.leaderboard.participant_api.participant_participant_id_disable_post(
participant_id=self.id
)
self._status = ParticipantStatus.DISABLED

def enable(self) -> None:
"""Re-enables a previously disabled participant.

The participant returns to the ``Submitted`` state and is included in
evaluation and standings again.
"""
with tracer.start_as_current_span("BenchmarkParticipant.enable"):
self._openapi_service.leaderboard.participant_api.participant_participant_id_enable_post(
participant_id=self.id
)
self._status = ParticipantStatus.SUBMITTED

def rename(self, name: str) -> None:
"""Renames the participant.

Args:
name: The new name of the participant.
"""
from rapidata.api_client.models.update_participant_name_endpoint_input import (
UpdateParticipantNameEndpointInput,
)

with tracer.start_as_current_span("BenchmarkParticipant.rename"):
self._openapi_service.leaderboard.participant_api.participant_participant_id_name_put(
participant_id=self.id,
update_participant_name_endpoint_input=UpdateParticipantNameEndpointInput(
name=name
),
)
self.name = name

def __str__(self) -> str:
return f"BenchmarkParticipant(name={self.name}, id={self.id}, status={self._status})"

Expand Down
Loading