Skip to content

fix(apisimulation.py): fix exchange-related bugs#99

Merged
wpbonelli merged 2 commits into
MODFLOW-ORG:developfrom
wpbonelli:fix/apisimulation-bugs
Jul 4, 2026
Merged

fix(apisimulation.py): fix exchange-related bugs#99
wpbonelli merged 2 commits into
MODFLOW-ORG:developfrom
wpbonelli:fix/apisimulation-bugs

Conversation

@wpbonelli

Copy link
Copy Markdown
Member
  • __repr__ silently dropped the exchanges section (missing s +=)
  • get_exchange(None) failed to return the first detected exchange
  • ApiSimulation.load iterated the just-created empty exchanges dict instead of exchange_names, so exchanges and get_exchange() never returned a real exchange

wpbonelli and others added 2 commits July 4, 2026 04:33
Three independent bugs in ApiSimulation:

- __repr__ silently dropped the exchanges section (missing `s +=`).
- get_exchange(None) iterated `self._exchanges` (a dict) unpacking each
  key into two variables, which raises rather than returning an
  exchange.
- The exchange-construction loop in ApiSimulation.load iterated the
  just-created empty `exchanges` dict instead of `exchange_names`, so
  `exchanges`/`get_exchange()` never returned a populated ApiExchange
  for any multi-model (GWF-GWF/GWT-GWT) simulation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@wpbonelli wpbonelli marked this pull request as ready for review July 4, 2026 12:12
@wpbonelli wpbonelli added this to the 0.2.1 milestone Jul 4, 2026
@wpbonelli wpbonelli added the bug Something isn't working label Jul 4, 2026
@wpbonelli wpbonelli merged commit b547a56 into MODFLOW-ORG:develop Jul 4, 2026
30 of 34 checks passed
@wpbonelli wpbonelli deleted the fix/apisimulation-bugs branch July 4, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant