llmcoderlab

Temperature conversion

qwen2.5-coder-3b Pythononeshotrun 1sample 02.4s wall

← run 1 · raw JSON · challenge definitions

tests (60%)4/4 passed
deliverables (20%)100%
content checks (20%)100%

01 what the model was asked

Create temperature.py with exactly two functions:

c_to_f(celsius: float) -> float
    Convert Celsius to Fahrenheit: F = C * 9/5 + 32.

f_to_c(fahrenheit: float) -> float
    Convert Fahrenheit to Celsius: C = (F - 32) * 5/9.

Use only the Python standard library.
required deliverables + checks
deliverable: temperature.py
temperature.py must contain “def c_to_f”
temperature.py must contain “def f_to_c”
pytest suite it was graded against
test_temperature.py · 20 lines · 357 B
from temperature import c_to_f, f_to_c  def test_freezing():    assert c_to_f(0) == 32    assert f_to_c(32) == 0  def test_boiling():    assert c_to_f(100) == 212    assert f_to_c(212) == 100  def test_negative():    assert c_to_f(-40) == -40    assert f_to_c(-40) == -40  def test_round_trip():    assert abs(f_to_c(c_to_f(37.5)) - 37.5) < 1e-9

02 what it did — full transcript

promptthe exact instruction sent to the model
view full prompt
You are completing a coding task in one shot. Write complete files that satisfy the spec below. Tests (pytest) will be run against your files; you cannot run them yourself.

Reply with ONE JSON object and nothing else:
{"files": {"<relative path>": "<complete file content>", ...}}

Required deliverable files: temperature.py

SPEC:
Create temperature.py with exactly two functions:

c_to_f(celsius: float) -> float
    Convert Celsius to Fahrenheit: F = C * 9/5 + 32.

f_to_c(fahrenheit: float) -> float
    Convert Fahrenheit to Celsius: C = (F - 32) * 5/9.

Use only the Python standard library.
reply79 tokens
view raw reply
```json
{
  "files": {
    "temperature.py": "def c_to_f(celsius: float) -> float:\n    return celsius * 9 / 5 + 32\n\ndef f_to_c(fahrenheit: float) -> float:\n    return (fahrenheit - 32) * 5 / 9"
  }
}
```
write_filetemperature.py · 146 B
graded 100.04 passed, 0 failed

03 what it wrote

1
files
5
lines
4
source lines
2
functions
0
classes
1
cyclomatic
1
max nesting
2.0
avg fn lines

stdlib imports: none

FileLOCSLOC FnsComplexityDepthImports
temperature.py54211
temperature.py · 5 lines · 146 B
def c_to_f(celsius: float) -> float:    return celsius * 9 / 5 + 32 def f_to_c(fahrenheit: float) -> float:    return (fahrenheit - 32) * 5 / 9

04 how it was graded

✓ ok 4/4 passed
1
model calls
0
invalid actions
0
self test runs
79
tokens out
tokens in
2.4s
wall time

agent actions:

final pytest output
[re-executed at publish time]
....                                                                     [100%]
4 passed in 0.00s