Skip to content

Commit

Permalink
Fix issue #5748: Rename "Ran a Jupyter Command" to "Ran a Python Comm…
Browse files Browse the repository at this point in the history
…and" in UI (#5749)

Co-authored-by: Graham Neubig <[email protected]>
  • Loading branch information
openhands-agent and neubig authored Dec 26, 2024
1 parent 95b416f commit 8975fcd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import glob
import json
import os
import random
from collections import Counter

import pandas as pd
import random
import numpy as np
import pandas as pd

from openhands.events.serialization import event_from_dict
from openhands.events.utils import get_pairs_from_events
Expand All @@ -20,12 +20,11 @@
]


def get_bootstrap_accuracy_error_bars(values: float | int | bool, num_samples: int = 1000, p_value=0.05) -> tuple[float, float]:
def get_bootstrap_accuracy_error_bars(
values: float | int | bool, num_samples: int = 1000, p_value=0.05
) -> tuple[float, float]:
sorted_vals = np.sort(
[
np.mean(random.sample(values, len(values) // 2))
for _ in range(num_samples)
]
[np.mean(random.sample(values, len(values) // 2)) for _ in range(num_samples)]
)
bottom_idx = int(num_samples * p_value / 2)
top_idx = int(num_samples * (1.0 - p_value / 2))
Expand Down Expand Up @@ -118,7 +117,9 @@ def process_file(file_path):
'resolved': {
'count': num_resolved,
'percentage': (num_resolved / num_lines * 100) if num_lines > 0 else 0,
'ci': tuple(x * 100 for x in get_bootstrap_accuracy_error_bars(resolved_arr)),
'ci': tuple(
x * 100 for x in get_bootstrap_accuracy_error_bars(resolved_arr)
),
},
'empty_patches': {
'count': num_empty_patch,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/i18n/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -2009,7 +2009,7 @@
"en": "Running a bash command"
},
"ACTION_MESSAGE$RUN_IPYTHON": {
"en": "Running a Jupyter command"
"en": "Running a Python command"
},
"ACTION_MESSAGE$READ": {
"en": "Reading the contents of a file"
Expand All @@ -2027,7 +2027,7 @@
"en": "Ran a bash command"
},
"OBSERVATION_MESSAGE$RUN_IPYTHON": {
"en": "Ran a Jupyter command"
"en": "Ran a Python command"
},
"OBSERVATION_MESSAGE$READ": {
"en": "Read the contents of a file"
Expand Down

0 comments on commit 8975fcd

Please sign in to comment.