Skip to content

Commit 5a5c0d1

Browse files
committed
Viewer initial version
1 parent 594f7d8 commit 5a5c0d1

9 files changed

Lines changed: 1213 additions & 2 deletions

File tree

.cursor/rules/style.mdc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
7+
# Style guide
8+
9+
1. Target python 3.10 or higher
10+
2. Use python with type annotations. Use `list` instead of `List`.
11+
3. Use `pathlib` instead of `os.path`. Use `Path.read_text()` over `with ...open()` constructs.
12+
4. Keep code comments to a minimum and only highlight particularly logically challenging things
13+
5. Do not append to the README unless specifically requested
14+
6. Use `jinja` for formatting templates
15+
7. Use `dataclass` for keeping track config
16+
8. Do not catch exceptions unless explicitly told to.
17+
9. Write concise, short, minimal code.
18+
10. In most cases, avoid initializing variables just to pass them to a function. Instead just pass the expression to the function directly.
19+
11. Not every exception has to be caught. Exceptions are a good way to show problems to a user.
20+
12. Don't catch exceptions just to re-raise them slightly differently. This doesn't add any value.
21+
13. Write concise code and thing of elegant solution.
22+
23+
## Test style
24+
25+
1. Use `pytest`, not `unittest`.
26+
2. <IMPORTANT>Do not mock/patch anything that you're not explicitly asked to do</IMPORTANT>
27+
3. Avoid writing trivial tests. Every test should test for at least one, preferably multiple points of failure
28+
4. Avoid splitting up code in multiple lines like this: `a=func()\n assert a=b`. Instead, just do `assert func() == b`
29+
5. The first argument to `pytest.mark.parametrize` should be a tuple (not a string! not a list!), the second argument must be a list (not a tuple!).
30+
31+
Here's an example for rule 4:
32+
33+
```python
34+
# bad
35+
result = func()
36+
assert result == b
37+
38+
# good
39+
assert func() == b
40+
```

.cursor/rules/viewer.mdc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ The input folder has the following files
2424

2525
* results.json
2626
* main.log
27-
* round_$i.log, where $i is the round. Infer the number of rounds from how many of these files we have
28-
* .*_p$i_r$j.traj.log, where $i$ is the player (there's always 1 or 2 players and $j is the round number
27+
* round_$i.log, where $i is the round.
28+
* p$i_r$j.traj.log, where $i$ is the player (there's always 1 or 2 players) and $j is the round number
2929
* Trajectory files do not exist for the last round
3030

3131
Here's how a `.traj.log` file looks:

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ dependencies = [
2525
"mini-swe-agent",
2626
"python-dotenv",
2727
"ghapi",
28+
"flask",
29+
"jinja2",
30+
"markupsafe",
2831
]
2932

3033
[project.optional-dependencies]

0 commit comments

Comments
 (0)