Skip to content

14 Three small fixes: kill zone selections, placement files, and the -g bts view - #30

Merged
seanth merged 1 commit into
seanth:terrain-orgfrom
adamf:pr14-small-fixes
Sep 27, 2026
Merged

seanth merged 1 commit into
seanth:terrain-orgfrom
adamf:pr14-small-fixes

Conversation

@adamf

@adamf adamf commented Sep 24, 2026

Copy link
Copy Markdown

Builds on PR 9 (#25). It doesn't depend on PRs 10–13. This PR's changes on their own.

Three small fixes: kill zone selections, placement files, and the -g bts view

None of these change a normal run. They only matter for input files with mistakes in them, or for the one graphics view that crashed. All the characterization recordings match except graphics_outputs, where the -g bts stage now makes its files instead of crashing.

1. A kill zone's selection missing a part crashed (vevents.py)

readZoneSelection checked ("attribute" and "logic" and "value") in theSelectionDict. In Python, ("attribute" and "logic" and "value") is just "value", so only value was checked. A selection without attribute or logic then crashed with a KeyError, instead of printing the warning and ignoring the selection, which is what the code meant to do. Each of the three is now checked.

2. A placement file with bad lines could lose good ones (vplacement.py)

checkSeedPlacementList deleted bad lines from the list while looping over it. That skipped the line after each deleted one, so:

  • a bad line straight after another bad one was kept;
  • a later bad line could make it delete the wrong line.

It now keeps the good lines in a new list instead.

3. -g bts crashed (vgraphics.py)

The combined bottom + top + side view filled the side view's template, which takes six numbers, with only four. It now gets six, the same way the other side views get theirs. The .cfdg files it makes are now pinned by the graphics_outputs scenario. I haven't seen the picture itself (the tests don't run the cfdg program), and that view's layout code looks unfinished, so it's worth a look.

Tests

  • Unit tests:
    • a selection missing each of its three parts is ignored (the old code crashes on two of them);
    • a placement file with several bad lines, two of them in a row, keeps exactly the good ones. This replaces the test that pinned the old behaviour.
  • Characterization: graphics_outputs re-recorded. Its first two stages are identical to before; the third now makes files instead of crashing. The test README's list of bugs found is updated.

🤖 Generated with Claude Code

https://claude.ai/code/session_013425y5x98TqAv3BvHodpdx

…-g bts view

**Builds on PR 8 (seanth#24).** It doesn't depend on PRs 10–13. [This PR's changes on their own](pr8-web-viewer...pr14-small-fixes).

## Three small fixes: kill zone selections, placement files, and the `-g bts` view

None of these change a normal run. They only matter for input files with mistakes in them, or for the one graphics view that crashed. All the characterization recordings match except `graphics_outputs`, where the `-g bts` stage now makes its files instead of crashing.

### 1. A kill zone's `selection` missing a part crashed (`vevents.py`)
`readZoneSelection` checked `("attribute" and "logic" and "value") in theSelectionDict`. In Python, `("attribute" and "logic" and "value")` is just `"value"`, so only `value` was checked. A selection without `attribute` or `logic` then crashed with a `KeyError`, instead of printing the warning and ignoring the selection, which is what the code meant to do. Each of the three is now checked.

### 2. A placement file with bad lines could lose good ones (`vplacement.py`)
`checkSeedPlacementList` deleted bad lines from the list while looping over it. That skipped the line after each deleted one, so:
- a bad line straight after another bad one was kept;
- a later bad line could make it delete the wrong line.

It now keeps the good lines in a new list instead.

### 3. `-g bts` crashed (`vgraphics.py`)
The combined bottom + top + side view filled the side view's template, which takes six numbers, with only four. It now gets six, the same way the other side views get theirs. The `.cfdg` files it makes are now pinned by the `graphics_outputs` scenario. I haven't seen the picture itself (the tests don't run the `cfdg` program), and that view's layout code looks unfinished, so it's worth a look.

### Tests
- **Unit tests:**
  - a selection missing each of its three parts is ignored (the old code crashes on two of them);
  - a placement file with several bad lines, two of them in a row, keeps exactly the good ones. This replaces the test that pinned the old behaviour.
- **Characterization:** `graphics_outputs` re-recorded. Its first two stages are identical to before; the third now makes files instead of crashing. The test README's list of bugs found is updated.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_013425y5x98TqAv3BvHodpdx
@seanth
seanth changed the base branch from master to terrain-org September 27, 2026 21:06
@seanth
seanth merged commit c23bab2 into seanth:terrain-org Sep 27, 2026
adamf pushed a commit to adamf/vida that referenced this pull request Oct 3, 2026
… server

This branch had the first versions of the series (PRs 5 to 17), which
have since been rebuilt on Sean's terrain-org (with his changes since:
new species, event and terrain files for the southern forest project,
and more). This merge takes that up-to-date code:

- upstream terrain-org (4de5778), with seanth#21-seanth#30 merged;
- PRs 15-17 (seanth#31-seanth#33, still open);
- the viewer's side-view height and void surroundings (pr18-viewer-void);
- the web server (pr19-web-server);

and keeps what is only on this branch: the world-scale prototype
(worldscale/, its tests, and its CI jobs), and __pycache__/ and
.pytest_cache/ in .gitignore. Where the two differed, the up-to-date
code was taken.

All 178 tests pass, the world-scale ones included (with the Rust module
built).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013425y5x98TqAv3BvHodpdx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants