Skip to content

fix small bugs, tidy docs, commit uv.lock - #21

Merged
davebiagioni merged 5 commits into
mainfrom
fix/small-bugs-and-docs
Nov 13, 2026
Merged

davebiagioni merged 5 commits into
mainfrom
fix/small-bugs-and-docs

Conversation

@davebiagioni

@davebiagioni davebiagioni commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

some upkeep while poking around the repo. mostly small, each bug has a regression test in tests/test_regressions.py (6 of the 7 fail on main).

bugs

where what was wrong
PVEnv.reset returned None instead of (obs, meta)
utils.to_scaled out-of-bounds warning never fired above high (operator precedence)
FiveZoneROMEnv.step_reward used upper violations twice, lower never. subclass overrides this, so paper results unaffected
FiveZoneROMEnv.step_ assigned self.model instead of self.models (harmless only because updates are in place)
OpenDSSSolver.get_bus_voltage_by_name str.replace swapped every copy of the phase letter, not just the suffix
EnergyStorageEnv obs label typo stage_of_charge; Timedelta.seconds instead of total_seconds()
MultiAgentEnv.step episodes ended one step early
FiveZoneROMThermalEnergyEnv reward_structure={"alpha": ...} in configs was silently eaten by **kwargs

behavior changes worth knowing about

  • episode length: max_episode_steps=250 now actually runs 250 steps, not 249. fig3 and the rllib example set rollout_fragment_length = env.max_episode_steps, so this lines them up the way the rllib readme says it should. fig3 won't reproduce to the exact step.
  • alpha: it's now a real constructor arg defaulting to 0.2, the old hard-coded value. i removed the dead reward_structure config from the heterogeneous scenario and the list-interface notebook rather than honoring it, since honoring it would quietly flip fig3's reward from the 0.2 it trained with to 0.0.

cleanup

  • opendss run_command -> Command. test warnings go from ~2,580 to 0.
  • print -> logger, removed a duplicate reward_transform and no-op @abstractmethods, mutable default args, unused imports, dead code.

docs

  • readme: install/test steps use uv properly, pytests typo, repo dir casing, author name typo
  • examples/README.md now actually indexes the notebooks and marl examples
  • small fixes in tests/examples readmes, PV docstring, scenario comments, pyproject metadata, ci comments
  • commits uv.lock so ci installs are reproducible

not in here

envs still return the old 4-tuple from step() despite the gymnasium migration. that's an api change, better as its own pr.

testing

  • uv run pytest tests/ — 16 passed
  • uv run pytest --nbmake examples/envs — 9 passed

davebiagioni and others added 2 commits November 11, 2026 14:25
bugs:
- PVEnv.reset() returned None
- to_scaled never warned when x was above high (operator precedence)
- FiveZoneROMEnv.step_reward counted upper violations twice, lower never
- building env assigned self.model instead of self.models
- get_bus_voltage_by_name replaced every occurrence of the phase letter
- energy storage obs label typo (stage_of_charge -> state_of_charge)
- energy storage used Timedelta.seconds instead of total_seconds()
- MultiAgentEnv ended episodes one step early (max_episode_steps=250 ran 249)
- reward_structure={"alpha": ...} was silently swallowed by **kwargs; alpha
  is now a real FiveZoneROMThermalEnergyEnv arg (default 0.2, same as before)
  and the dead config is removed from the scenario and notebook

cleanup: run_command -> Command (kills ~2.5k deprecation warnings in tests),
print -> logger, drop duplicate/no-op abstractmethods, mutable defaults, and
dead code.

docs: readme install/test steps, examples index, typos, pyproject metadata,
ci comments.

adds tests/test_regressions.py covering each fix.

Co-Authored-By: Claude <noreply@anthropic.com>
macos runners are shared across the whole org with a much lower concurrency
cap, so jobs were sitting in the queue. nothing here needs macos.

Co-Authored-By: Claude <noreply@anthropic.com>
davebiagioni added a commit that referenced this pull request Nov 11, 2026
# Conflicts:
#	.github/workflows/main.yml
@davebiagioni
davebiagioni added this pull request to stack #23 November 11, 2026 21:37
Co-Authored-By: Claude <noreply@anthropic.com>
tests were written from signatures and docstrings only, without reading
the implementation. where the code disagrees with its docs the test is
kept and marked xfail(strict=True) with the discrepancy in the reason.

Co-authored-by: davebiagioni <davebiagioni@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
@davebiagioni
davebiagioni merged commit e6e9e98 into main Nov 13, 2026
4 checks passed
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