Repository navigation
chore(sceptre): remove the unused SunSpec protocol - #156
Merged
Merged
Conversation
This was referenced Oct 2, 2026
GhostofGoes
suggested changes
Oct 3, 2026
GhostofGoes
left a comment
Contributor
There was a problem hiding this comment.
Fix the slop then this is perfect. Feels good to burn away 25,000 lines of long dead code. Good riddance.
|
|
||
| ### Removed | ||
| - **SCEPTRE App**: The `reg_config` manual register-map path. It was dead code: the app never populated it, so every device always took the automatic numbering branch. Output is unchanged. | ||
| - **SCEPTRE App**: SunSpec support: the `sunspec` field-device protocol, its register generator and bundled SMDX models, the `sunspec.mako` and gobennu startup templates, and the SunSpec branches of the FEP template. It had been broken for years without anyone noticing, and maintainers confirmed it is unused. A field device that still declares `metadata.sunspec` now fails validation with an error that says so. Output for every other protocol is unchanged. |
Contributor
There was a problem hiding this comment.
Instead of the slop, use this: ' Sceptre app: SunSpec has been burned away by the SCORCHing heat of 3000 Suns and thus no longer exists in this repo.'
|
|
||
| ### Fixed | ||
| - **SCEPTRE App**: With more than one PowerWorld provider, only the last one's `hil_tags` reached the object list, and only the last one's `objects.txt` was written. Tags now aggregate across providers and every PowerWorld provider gets the combined `objects.txt`. | ||
| - **SCEPTRE App**: Every `sunspec` inverter raised `KeyError`: the SunSpec register mappings are keyed `PowerDistribution` but received `power-distribution`. The whole protocol was unusable. |
SunSpec support had been broken for years without anyone noticing: until sandialabs#137 every inverter on the sunspec protocol raised KeyError. On that PR the maintainers agreed it is unused ("It was never used in all my time working on this stack", "We haven't used it in years") and that removing it is fine. Remove the protocol entirely: the SunSpecDevice register generator and its ~1 MB of vendored SMDX models, the sunspec.mako config and gobennu startup templates, the sunspec branches of the FEP template, and the protocol from the metadata parser, validation model, port table and register builder. Packaging, ruff and codespell no longer need their SunSpec exclusions. A field device whose metadata still has a sunspec key now fails validation with an error saying SunSpec was removed, rather than having the key silently ignored. Every other protocol's output is unchanged: the rendered scenario golden is untouched, and the infrastructure golden only loses its sunspec rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016KAfcDUSerQCCWwBM9BxAo
adamsrnmsu
force-pushed
the
chore-remove-sunspec
branch
from
October 4, 2026 23:53
205c380 to
b64cd26
Compare
GhostofGoes
approved these changes
Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Remove SunSpec support from the SCEPTRE app.
SunSpec had been broken for years without anyone noticing: until #137, every inverter on the
sunspecprotocol raisedKeyError. #137 asked whether SunSpec was still wanted. @GhostofGoes voted to remove it ("It was never used in all my time working on this stack"), and @mgaliar agreed ("I am good with keeping this fix or burning sunspec. We haven't used it in years.").What's removed:
protocols/sunspec/, meaning theSunSpecDeviceregister generator and about 1 MB of vendored SMDX models (99 files).templates/sunspec.mako, the gobennu branch ofsceptre_start.mako, and the foursunspecbranches offep_template.mako.sunspeccomes out of the metadata parser, the validation model, the field-device port table and the register builder.package-data, the ruffexcludeand per-file ignores, and.codespellrc.src/python/AGENTS.md, and the (unreleased) CHANGELOG entry for the fix(sceptre): normalise the SunSpec infrastructure key #137 fix. A new### Removedentry replaces it.A field device whose metadata still has a
sunspeckey now fails validation with an error saying SunSpec was removed. Without that check,extra="allow"would silently ignore the key.Related Issues/PRs
Follows up the discussion on #137. It doesn't depend on #152–#155 and doesn't conflict with #152, #153 or #155. #154 no longer touches the
sunspec/__init__.pythis PR deletes, so the two don't conflict.Type of Change
chore)Checklist
Testing
make checkandmake testinsrc/pythonon Python 3.12: 698 passed. That'smain's 697 plus a new validation case for a leftoversunspeckey.test_sceptre_golden.pypasses unchanged, so the FEP and field-device configs rendered for the golden scenario are byte-identical after the template edits.infrastructures_golden.txtwas regenerated, and the diff is exactly the 50sunspecrows removed.infrastructures.yamland themydesignertree.Additional Notes
An open question, deliberately left alone here: both inverters in
configs/infrastructures.yamlstill list SunSpec model numbers ([1, 103, 120, 123]and[1, 101, 123, 126]) as theiranalog-read-writefields. On DNP3 and Modbus those were already exposed as registers literally named1,103and so on (visible in the golden file before this PR). That's pre-existing and unchanged here, and the table comment now says so. Should those become real field names, or be dropped?🤖 Generated with Claude Code
https://claude.ai/code/session_016KAfcDUSerQCCWwBM9BxAo