Conversation
…um gets advice rather than a KeyError The unboundedness pass looked every column the objective reads up among the declared variables, and skipped only a given variable. A given expression and an empty sum are columns the program reads too, so `advice` raised KeyError on any spec whose objective names one — every composed cost that adds a term to a scalar sum is such a spec. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvK6QNNFZHJcRzRf3sBbWe
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvK6QNNFZHJcRzRf3sBbWe
…e folds into an introducer that sets one merge read each fragment's given block back through to_dict, which writes every default. A reading with no domain claimed continuous, and one with no dtype claimed float, so the frame alone was refused against an integer or binary column and an integer parameter. The composition docs promise the reader may say less; it now hands the fold only the fields the file wrote. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvK6QNNFZHJcRzRf3sBbWe
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvK6QNNFZHJcRzRf3sBbWe
# Conflicts: # CHANGELOG.md
…e two share a file name render_tex named each document after the spec's stem, so the library's and PyPSA's generator.yaml and load.yaml each wrote one file and compile-tex compiled one of each pair. A document is now named after the spec's path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvK6QNNFZHJcRzRf3sBbWe
…ge, with its modes laid over them as patches Calliope v0.7.0's base math is 14 topic fragments under examples/calliope/, merged into one spec with nothing left under given. Its MILP math, and each of its 13 user-math examples and the urban-scale model's extra math, is an extension fragment; where Calliope restates system_balance, cost_investment, cost_operation_fixed or the objective to add a term, the extension adds the term to a sum and no base file changes. The MILP edits, operate mode, SPORES, inter-cluster storage and the two rewrites of balance_conversion are variants that override lays over the composition. Each fragment and variant has a gallery page, the index lists the sums and the fragments, and the port record lists every Calliope block with its status and the nine gaps where mathspec needs more than one block for one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvK6QNNFZHJcRzRf3sBbWe
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvK6QNNFZHJcRzRf3sBbWe
…he-2.0 licence Each file under examples/calliope/ names Calliope contributors beside this project, is under Apache-2.0 as Calliope's math is, and says it was changed from Calliope v0.7.0. The pages that print those files are CC-BY-4.0 AND Apache-2.0, and the index says whose math it is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvK6QNNFZHJcRzRf3sBbWe
This was referenced Sep 29, 2026
Brings in #757, #765, #778 and #779, which the next commits use to drop two of the port's workarounds. CHANGELOG.md keeps both sides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N66KMDkSv1rZbhr8jqqJzJ
…multi-dimension sums as Calliope does #757 admits a sum of parameters under ** and as a divisor, so storage_retention and cost_annuity_factor are gone: the storage files read (1 - storage_loss) ** …, and the depreciation rate states Calliope's annuity factor. #778 and #779 admit sum(over=[a, b]), so the 21 nested sums are one call each. port.md marks gaps 1 and 8 closed and keeps the numbering. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N66KMDkSv1rZbhr8jqqJzJ
Brings in #751. CHANGELOG.md keeps both sides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N66KMDkSv1rZbhr8jqqJzJ
This branch has not been deployed
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.
Note
The following content was generated by AI.
Every math file of Calliope
v0.7.0is ported: the base as 14 fragments thatmergecomposes, 15 extensions, and 7 variants thatoverridelays over them. No block is left out for want of language. Of the nine gaps the port found, two are now closed onmain, and #777 tracks the other seven.What mathspec is missing, and where it is tracked
**and/over a sum of parameters(1 - storage_loss) ** hand the annuity factor as Calliope doesarea_useis masked byarea_use_min > 0where:on apiecewise:blockflow_capmasked to the curveflow_out[carriers=electricity]map_dim(nodes, link_from)annual_flow_max,net_import_shareempty: truesum no file adds to is an unbuilt column, not zeropenaltyhas the body0sum(over=[a, b])errors: warnchecks are outRelated, not gaps:
one_ofon a lookup is an assumption here, and #518 / #519 would declare it. Operate mode turns a capacity variable into a parameter, which #303 / PR #748 (spec.fix) make a verb. Calliope's.active: falseis a patch removal, which #12 discusses.Out by design: operate's rolling horizon and the SPORES iterations (loops of solves), and the lat/lon check (data prep).
What is in it
Source:
calliope-project/calliopeatc2c0549(Release v0.7.0):src/calliope/math/{base,milp,operate,spores,storage_inter_cluster}.yaml, the 13 files ofdocs/user_defined_math/examples/, andexample_models/urban_scale/additional_math.yaml.examples/calliope/*.yaml: the base, one fragment per topic (settings, balance, flows, cost, supply, demand, conversion, storage, supply_storage, area, transmission, export, feasibility, reporting).mergegives one spec, with nothing undergiven:and no advice.examples/calliope/extensions/: what MILP and each example add. Calliope restatessystem_balance,cost_investment,cost_operation_fixedor the objective whole to add one term. Here the extension adds a term to a sum instead, and no base file changes (fuel distribution, monthly peak charge, purchase cost, both piecewise costs).examples/calliope/variants/: patches for what Calliope changes in the base: the MILP edits, operate mode (and its MILP half), SPORES, inter-cluster storage, and the two rewrites ofbalance_conversion.docs/examples/calliope/has a gallery page per file, an index with the generated sums and fragments tables, andport.md.port.mdrecords every Calliope block with its status and the file that states it. The nav places it under Development → Proofs of concept.tools/gallery.pywrites the new pages. A variant page prints each declaration the patch writes, in the spec it lands on.tests/test_calliope_example.py(70 tests) holds the compositions the pages claim.Licence and attribution
Calliope is Apache-2.0 and ships no
NOTICEfile.examples/calliope/carriesSPDX-FileCopyrightText: Calliope contributorsbeside this project's line, isApache-2.0, and says it was changed from Calliopev0.7.0, as Apache-2.0 §4(b) asks of a modified file.LICENSES/Apache-2.0.txtis already in the tree.CC-BY-4.0 AND Apache-2.0, with both copyright lines.index.mdandport.mdare this project's prose and stayCC-BY-4.0. The index says the math is Calliope's, under Apache-2.0, and links the licence.examples/symbols/calliope.yamlis this project's and stays MIT.reuse lintis green.History, gates, what was not done
Merged
mainat9ace314a(through #751), in two merge commits. The branch earlier merged #767, #768 and #769 while they were open; all three are now onmain. The only conflict each time wasCHANGELOG.md, and it keeps both sides.Gaps 1 and 8 closed in
44d71cff.storage_retentionandcost_annuity_factorare gone.storage.yamland the inter-cluster variant read(1 - storage_loss) ** …. The depreciation rate's last case iscost_interest_rate * (1 + cost_interest_rate) ** lifetime / ((1 + cost_interest_rate) ** lifetime - 1), and it prints as a fraction. Both are checked against Calliope'sbase.yamlandstorage_inter_cluster.yamlatc2c0549.sum(…, over=[…]), and two triple sums keep an outer sum over a product,sum(sum(…, over=[…]) * w). The commit message says 21; 20 is the count in the diff.port.mdmarks gaps 1 and 8 closed and keeps the numbering, since Calliope v0.7.0's math ports to mathspec, and nine gaps cost the port a workaround #777 refers to it.cost_investment_annualisedis now done, and the parameters row forstorage_loss,cost_interest_rateandlifetimeis gone.Guard check (from the first round): with the SOS2 link pointed back at
flow_cap,test_the_sos2_curve_links_a_copy_of_the_flow_capacity_masked_to_the_curvefails (assert Falseon the link row). Restored, it passes.Gates. Everything below ran on
44d71cff. After the second merge,pytest, the page checks,ruff check,pyreflyandprettier --check CHANGELOG.mdran again on93e23e5b, with the same results. Pixi is not reachable here (the proxy refusespixi.sh), so these ran from a uv venv with the pinned tools.pytest -q -n auto: 2829 passed, 82 skipped.tests/test_calliope_example.py: 70 passed.ruff check,ruff format --check,pyrefly check,typos,reuse lint,prettier --checkon the changed pages: clean.tools.galleryregenerated 11 pages.spec_math,notation,home_math,expansion_math,schemaand the typesetting golden output show no diff.render-tex: 84 specs, 84 documents.docs-build,compile-tex: not run. CI runs both.Not done:
where:which rows the modeller gave #773, a parameter has one shape, while Calliope lets the data decide whether a limit is per technology, per node or per group #775 and an assumption holds or refuses the data, and Calliope'serrors: warnchecks have no place in a spec #776 recommend keeping their workarounds, and gap 4 waits on a reduction cannot filter the terms it sums, so the mask ships as an identity matrix in the data #259. This PR waits for those decisions.Departures from defaults here: variants live under
variants/, a folder name thatrender-texand the canonical test already skip..prettierignorenegatesport.md, so prettier formats the one hand-written page in the folder.🤖 Generated with Claude Code
https://claude.ai/code/session_01AvK6QNNFZHJcRzRf3sBbWe