Skip to content

Commit

Permalink
sgf-viewer: Fix prepare_data parsing FAQ section, fix victim/adversar…
Browse files Browse the repository at this point in the history
…y text spacing (#88)

### Fix 1

Add spacing between adversary and victim labels.

Before:
![Screen Shot 2023-06-05 at 18 16 11](https://github.com/AlignmentResearch/KataGoVisualizer/assets/7245938/f8e9cc1b-3911-4c1b-8805-45770617beb8)

After:
![Screen Shot 2023-06-05 at 18 16 31](https://github.com/AlignmentResearch/KataGoVisualizer/assets/7245938/d86496a8-f0f3-45aa-8103-5ea48083e2b9)

### Fix 2

`prepare_data.py` crashes on FAQ section because it expects certain fields for downloading SGFs. The FAQ doesn't have any associated SGFs, though, so `prepare_data.py` just shouldn't do any data preparation for the FAQ section.

The error `prepare_data.py` would hit:
```
Traceback (most recent call last):
  File "prepare_data/prepare_data.py", line 46, in <module>
    server = section["server"]
```
  • Loading branch information
tomtseng authored Jun 6, 2023
1 parent 1c7c9a2 commit 3633845
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sgf-viewer/prepare_data/prepare_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ def run_cmd(cmd, shell=False, dry_run=False):

for page_path, page in pages.items():
for section in page["content"]:
server = section["server"]
title = section["title"]
if all(key not in section for key in ["paths", "paths_with_line_num"]):
print(f"Skipping section {title}: no games")
continue

server = section["server"]
max_games = section["max_games"]
games_count = 0
# Maps destination path to the original index of the source path in
Expand Down
1 change: 1 addition & 0 deletions sgf-viewer/src/components/Section.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
}
.annotation-item {
align-self: flex-start;
margin: 0.5vw;
margin-bottom: 1vh;
}
.subheading {
Expand Down

0 comments on commit 3633845

Please sign in to comment.