Skip to content

fix: small crashes and warnings - #139

Merged
m-fehr merged 2 commits into
masterfrom
fix/small-crashes
Oct 15, 2026
Merged

m-fehr merged 2 commits into
masterfrom
fix/small-crashes

Conversation

@m-fehr

@m-fehr m-fehr commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Fixes a handful of crashes and warnings that came up while writing the example notebooks. Independent of #138.

Crashes

  • Obstruction.get_coordinates() raised IndexError for obstructions one cell thick, whose faces are one node wide along an axis. Near-identical coordinates from neighbouring meshes are merged at half the grid spacing.
  • GeometryCollection.quantities and IsosurfaceCollection.quantities used a non-existent .name attribute and raised AttributeError; they now return the quantities.

Warnings

  • Timezone warning on every load: the wall-clock times in CHID_steps.csv (e.g. 2024-03-14T09:39:53.199+01:00) were parsed by numpy, which deprecated UTC offsets and warned each time. They are now parsed with datetime.fromisoformat and stored as UTC, exactly the values numpy produced before.
  • FDS+Evac: loading a simulation that contains Evac data now emits a FutureWarning that Evac support is deprecated (it was only stated in the docs). A simulation whose Evac classes have no loadable data gets an empty evacs collection.

Export

  • Slices without an ID were exported as slice2D-.yaml, so several unnamed slices overwrote each other. They are now named after their first .sf file.

Tests

tests/test_crash_regressions.py (20 tests) reproduces each case on the test fixtures (bndf_data, geom_data, steckler_data, also the FDS 6.10/6.11 variants); all but the "no Evac warning without Evac data" check fail on the previous code. Three timestamp formats that fromisoformat only accepts from Python 3.11 on (Z, +0100, +01) are skipped on 3.10; FDS always writes +hh:mm.

🤖 Generated with Claude Code

m-fehr and others added 2 commits October 14, 2026 23:50
- Obstruction.get_coordinates() no longer fails with an IndexError when a
  face is one node wide (obstructions one cell thick).
- GeometryCollection.quantities and IsosurfaceCollection.quantities used a
  non-existent .name attribute and raised AttributeError.
- The wall-clock times in CHID_steps.csv are parsed with their UTC offset
  by fdsreader instead of numpy's deprecated path, which warned on every
  load. The values are unchanged (UTC).
- Exporting a slice without an ID named it "slice2D-"; it is now named
  after its first .sf file, so several unnamed slices no longer overwrite
  each other.
- Loading a simulation with FDS+Evac data warns that Evac support is
  deprecated (FutureWarning).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Simulation always gets an EvacCollection, also when Evac classes were
  registered but their data could not be loaded; the new Evac check
  otherwise raised AttributeError and the whole simulation failed to load.
- Faces one node wide merge near-identical coordinates from neighbouring
  meshes at half the grid spacing instead of a tolerance of 0.
- Wall-clock times are parsed with datetime.fromisoformat instead of a
  hand-written offset parser.
- Tests: pick the matching warning, compare quantities as sets, cover
  Evac classes without data and daylight saving time changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
fdsreader/simulation.py 91.66% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@m-fehr
m-fehr merged commit 5ca2577 into master Oct 15, 2026
10 checks passed
@m-fehr
m-fehr deleted the fix/small-crashes branch October 15, 2026 06:49
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.

1 participant