Repository navigation
feat: a solve page solves a scenario again in the browser, with its data and model open to edit, puts the answer beside the published one, and downloads it as an archive - #9
Merged
Conversation
…with the model open to edit, and puts the answer beside the published one Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AAz2z9GVsHSQypiTUZyrY9
…a time or a filtered set of rows at once Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AAz2z9GVsHSQypiTUZyrY9
…r's polars, and passes it the archive's axis as written Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AAz2z9GVsHSQypiTUZyrY9
…through pyarrow in the browser Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AAz2z9GVsHSQypiTUZyrY9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AAz2z9GVsHSQypiTUZyrY9
FBumann
marked this pull request as ready for review
October 12, 2026 09:38
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.
A Solve page (
#/solve) runs specsolve 0.9 and HiGHS in the tab, through Pyodide in a Web Worker. It takes a scenario's model and data from its published archive. You can edit both, solve, compare the answer with the published one, and download the run as a specsolve archive.What the page does, and how
Page. Pick a scenario of
runs/. The page fetches itsspec.yaml,axis.jsonand everysources/<name>.parquet, and names the sources from the archive'ssources.parquet. A static host cannot list a directory, so this list is necessary. It shows:valuecolumn, in a TanStack Table with column filters. Type over a cell, or multiply the filtered rows by a factor. A changed cell is marked, and its tab counts the changes.archive=and saves the zip as<scenario>.zip, or<scenario>-edited.zipafter an edit.Worker (
src/solver.worker.ts). Loads Pyodide from jsDelivr at the versionpackage.jsonpins (pyodide@314.0.7, exact). Installsspecsolve>=0.9,<0.10with micropip, then runssrc/solve.py. That file is about 40 lines and callssps.solve_over(spec, tables, json.loads(axis), archive=…). Since fluxopt/specsolve#1981, the archive's axis data goes in as it is, carry included.Parquet in the browser. Pyodide's polars has no parquet. The page reads the sources with hyparquet, which it already used, and passes them to Python as
{column: values}. The answer comes back the same way: the record, and every variable's values. Pyodide converts a whole-number JS value to a Pythonint, so the tables are built withstrict=False. To write an archive, specsolve uses pyarrow where polars has no parquet (fluxopt/specsolve#1991). So the worker loads pyarrow the first time a download is asked for, not on every visit.Shared code.
archive.tsexportsrowsOf, so a parquet file already in memory reads like a published one.vite.config.tskeepspyodideout of dependency pre-bundling and builds the worker as an ES module.What was verified, and how
All in headless Chromium against a local build of this branch at
6abdbc0. specsolve was 0.9.0 from PyPI, installed by micropip in Pyodide, as the live page will install it. This container cannot reach jsDelivr orfluxopt.github.io, so:invest× 0.6, through the editorcheap_solarcost in all four periodsdtype: integerSchemaErrorshown on the pagebase-edited.zip, 30 members, 55 KBload_archivereads it; objectives = publishedcheap_solarwithin 6.3e-16;load_inputs→solve_overgives the same objectivesnpm run buildpasses, here and in CI.Not done
runs/scenarios. The worker takes any sweep archive, but the grid and the hedge are not offered.fluxopt.github.iowere not reachable from here.🤖 Generated with Claude Code
https://claude.ai/code/session_01AAz2z9GVsHSQypiTUZyrY9