Skip to content

Refactor LaTeX methods in catlog-wasm and catlog - #1319

Merged
tim-at-topos merged 56 commits into
tim/mass-action-polynomial-ode-systemfrom
tim/refactor-wasm-analyses
Jul 31, 2026
Merged

Refactor LaTeX methods in catlog-wasm and catlog#1319
tim-at-topos merged 56 commits into
tim/mass-action-polynomial-ode-systemfrom
tim/refactor-wasm-analyses

Conversation

@tim-at-topos

@tim-at-topos tim-at-topos commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Stacked on #1251

Now that more ODE analyses have LaTeX equations, we should be stricter about the use of fmt::Display only for debugging.

This PR introduces some new types and traits (Latex, ToLatex, ToLatexWithMap) for dealing with LaTeX expressions and rendering object/morphism names nicely in the frontend. It also includes a bunch of tests for ODE semantics in the wasm layer. Finally, as a bonus, it removes a lot of repetitive code from catlog-wasm::src::analyses by defining ode_semantics_simulation and ode_semantics_equations, enabled by #1251, as well as removing some unnecessary types introduced there (such as LotkaVolterraEquationsData, which is just null).

Again, this refactor adds a lot of lines, but that's almost entirely due to how many nice new tests it adds 👼

As a bonus, this PR fixes the following issues:


Although further refactoring is possible (e.g. lotka_volterra.tsx and linear_ode.tsx share a lot of code), I think that the "correct" solution to this would be to start looking at generating that code from the definitions of the analyses rather than manually refactoring it. But this is now a much larger, rather separate project, so I think it's a bit out of scope.

With that in mind, I would suggest that this PR finally completes the last item in #1177 , and thus closes the RFC-0001 parent issue #1098.

WIP: Rethinking traits

WIP: Some tests only half failing

WIP: Tests passing; time to tidy

ENH: Build derived model of th_signed_polynomial_ode_system in mass_action

ENH: Mass-action for stock-flow; DEL: Mass-action for signed stock-flow

ENH: struct for transition / flow interfaces

WIP: Starting on Lotka-Volterra

WIP: Failing tests

FIX: Lotka-Volterra tests passing

FIX: Working analysis (frontend)

ENH: Lotka-Volterra equations

ENH: Linear ODE refactor

ENH: Linear ODE equations

WIP: Starting on ODESemantics

WIP: lotka_volterra_semantics()

WIP: build_system_from_ode_semantics

WIP: DblModelForODESemantics

WIP: ODESemanticsAnalysis and ODESemanticsProblemData

WIP: ODESemantics trait

WIP: Documentation

WIP: ODESemantics for mass-action

WIP: Cleaning up types, but mass-action still frustrating

WIP: Big reshuffle (moving functions out from a struct)

WIP: Fixing mass-action again

WIP: terrible code

WIP: Changed from ObGen to Ob

WIP: Stock-flow mass-action

FIX: Passing catlog tests

Rename LinearODE -> LCC

FIX: Documentation

TODO: Redesign
@tim-at-topos
tim-at-topos force-pushed the tim/refactor-wasm-analyses branch from e71f793 to 7a8e39c Compare June 16, 2026 11:47
@tim-at-topos
tim-at-topos force-pushed the tim/refactor-wasm-analyses branch from 343e557 to 46de547 Compare June 17, 2026 18:48
@tim-at-topos
tim-at-topos force-pushed the tim/refactor-wasm-analyses branch from 3da1897 to b8071ee Compare June 18, 2026 17:23
@tim-at-topos
tim-at-topos force-pushed the tim/refactor-wasm-analyses branch from d121fcf to 247bfa3 Compare June 19, 2026 17:42
@tim-at-topos tim-at-topos added frontend TypeScript frontend and Rust-wasm integrations tidying Refactoring or simplifying existing code labels Jun 26, 2026
@tim-at-topos

Copy link
Copy Markdown
Contributor Author

@epatters Although this PR is separate from #1251 (it deals with LaTeX things), it does simplify (i.e. reduce) the code of #1251. If it makes things easier for me to merge this in so there's only a single PR then let me know and I'll fix all these merge conflicts and do so 👍

@tim-at-topos
tim-at-topos force-pushed the tim/mass-action-polynomial-ode-system branch from 754acc8 to ae999ae Compare July 31, 2026 17:44
@tim-at-topos
tim-at-topos force-pushed the tim/refactor-wasm-analyses branch 2 times, most recently from 4a97196 to cb5b879 Compare July 31, 2026 18:17
@tim-at-topos
tim-at-topos force-pushed the tim/mass-action-polynomial-ode-system branch from ae999ae to 3becbcc Compare July 31, 2026 18:17
@tim-at-topos
tim-at-topos force-pushed the tim/refactor-wasm-analyses branch from cb5b879 to 84a85f1 Compare July 31, 2026 18:17
@tim-at-topos
tim-at-topos force-pushed the tim/mass-action-polynomial-ode-system branch from 3becbcc to ae999ae Compare July 31, 2026 18:28
@tim-at-topos
tim-at-topos force-pushed the tim/refactor-wasm-analyses branch from 84a85f1 to 65d9ac5 Compare July 31, 2026 18:33
@tim-at-topos
tim-at-topos force-pushed the tim/mass-action-polynomial-ode-system branch 2 times, most recently from 94b62a4 to 754acc8 Compare July 31, 2026 18:35
@tim-at-topos
tim-at-topos merged commit adefd4b into tim/mass-action-polynomial-ode-system Jul 31, 2026
12 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend TypeScript frontend and Rust-wasm integrations tidying Refactoring or simplifying existing code

Projects

None yet

1 participant