Repository navigation
One shutdown model: a diagram takes the site's Opportunities - #508
Merged
Merged
Conversation
RepairableRBD(shutdowns=) takes an Opportunities record in model time: each Opportunity is a shutdown of its name (period and offset or dates, duration, takes_down as the scope), with Opportunity(idle_ageing=, opportunistic=) and Opportunities(shut_costs=) for what only a diagram uses. The record is read as the dicts it stands for, which the diagram keeps and saves, so its values and seeded runs are the dicts'. Shuts on real dates go through Opportunities.on_diagram; a ShutdownPolicy is refused, naming the record to give. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6RpnXB87vwhYETeh7ihtA
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.
Summary
A site's shuts were described twice: as
Opportunitiesfor a part's policies and asRepairableRBD(shutdowns=)dicts for a diagram. Nowshutdowns=takes anOpportunitiesrecord in model time, and the dict form stays as its shorthand.Opportunityis a shutdown of its name:periodandoffset(times run both ways from the offset, so on the diagram's clock the first is the first after 0), ordatesas numbers;duration(None takes no time);takes_downas the scope.Opportunity(idle_ageing=, opportunistic=)andOpportunities(shut_costs=).shut_costsis the site's own cost of each shut, not a part's price.rbd._shutdowns.as_specs,Opportunities._diagram_shutdowns). The diagram keeps and saves those dicts, so its values and seeded runs are exactly the dicts'.Opportunities.on_diagram(start, end), aShutdownPolicynames the record to give, and a deprecated price on an opportunity namesshut_costs.Type of change
Checklist
test_opportunities_on_diagram.py. It checks a record against its dicts: same saved diagram, the same exact costs and seeded runs, with times, idle ageing and opportunistic renewals. It also covers saving and the refusals.test_opportunities_on_diagram,test_opportunities,test_shutdowns,test_shutdowns_several,test_outage_opportunistic,test_maintenance_shutdowns_dated,test_help,test_messages(188 passed). Doctests of the touched modules: 4 passed.CHANGELOG.mdupdated under[Unreleased]Notes for reviewers
Opportunities.on_diagram(real dates) still takescost,scopeandidle_ageingas arguments. It does not read the record's new options ortakes_down, so its existing results do not change.Generated by Claude Code