AlgebraicJulia / GATlab.jl

GATlab: a computer algebra system based on generalized algebraic theories (GATs)
https://algebraicjulia.github.io/GATlab.jl/
MIT License
21 stars 2 forks source link

Create theorymap-level model migrator #118

Closed kris-brown closed 8 months ago

kris-brown commented 9 months ago

Rather than have model migration be something that lives outside of the theory map, each map created by @theorymap has its own Migrator field.

This is tied up with a few practical benefits

  1. we can migrate using a function, rather than a macro.
  2. we can migrate individual models directly, rather than just model types
  3. we can use the @instance typechecking infrastructure rather than having to bypass it
codecov[bot] commented 9 months ago

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (cd9a69e) 96.03% compared to head (bfc173b) 96.61%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #118 +/- ## ========================================== + Coverage 96.03% 96.61% +0.57% ========================================== Files 34 38 +4 Lines 1918 2067 +149 ========================================== + Hits 1842 1997 +155 + Misses 76 70 -6 ``` | [Files](https://app.codecov.io/gh/AlgebraicJulia/GATlab.jl/pull/118?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AlgebraicJulia) | Coverage Δ | | |---|---|---| | [src/GATlab.jl](https://app.codecov.io/gh/AlgebraicJulia/GATlab.jl/pull/118?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AlgebraicJulia#diff-c3JjL0dBVGxhYi5qbA==) | `100.00% <ø> (ø)` | | | [src/nonstdlib/models/module.jl](https://app.codecov.io/gh/AlgebraicJulia/GATlab.jl/pull/118?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AlgebraicJulia#diff-c3JjL25vbnN0ZGxpYi9tb2RlbHMvbW9kdWxlLmps) | `100.00% <100.00%> (ø)` | | | [src/nonstdlib/module.jl](https://app.codecov.io/gh/AlgebraicJulia/GATlab.jl/pull/118?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AlgebraicJulia#diff-c3JjL25vbnN0ZGxpYi9tb2R1bGUuamw=) | `100.00% <100.00%> (ø)` | | | [src/nonstdlib/theories/module.jl](https://app.codecov.io/gh/AlgebraicJulia/GATlab.jl/pull/118?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AlgebraicJulia#diff-c3JjL25vbnN0ZGxpYi90aGVvcmllcy9tb2R1bGUuamw=) | `100.00% <100.00%> (ø)` | | | [src/syntax/GATs.jl](https://app.codecov.io/gh/AlgebraicJulia/GATlab.jl/pull/118?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AlgebraicJulia#diff-c3JjL3N5bnRheC9HQVRzLmps) | `100.00% <ø> (ø)` | | | [src/syntax/TheoryInterface.jl](https://app.codecov.io/gh/AlgebraicJulia/GATlab.jl/pull/118?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AlgebraicJulia#diff-c3JjL3N5bnRheC9UaGVvcnlJbnRlcmZhY2Uuamw=) | `97.18% <100.00%> (+0.51%)` | :arrow_up: | | [src/syntax/TheoryMaps.jl](https://app.codecov.io/gh/AlgebraicJulia/GATlab.jl/pull/118?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AlgebraicJulia#diff-c3JjL3N5bnRheC9UaGVvcnlNYXBzLmps) | `96.53% <100.00%> (-0.04%)` | :arrow_down: | | [src/syntax/gats/algorithms.jl](https://app.codecov.io/gh/AlgebraicJulia/GATlab.jl/pull/118?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AlgebraicJulia#diff-c3JjL3N5bnRheC9nYXRzL2FsZ29yaXRobXMuamw=) | `96.46% <100.00%> (+0.95%)` | :arrow_up: | | [src/syntax/gats/ast.jl](https://app.codecov.io/gh/AlgebraicJulia/GATlab.jl/pull/118?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AlgebraicJulia#diff-c3JjL3N5bnRheC9nYXRzL2FzdC5qbA==) | `91.42% <100.00%> (+3.92%)` | :arrow_up: | | [src/syntax/gats/gat.jl](https://app.codecov.io/gh/AlgebraicJulia/GATlab.jl/pull/118?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AlgebraicJulia#diff-c3JjL3N5bnRheC9nYXRzL2dhdC5qbA==) | `90.81% <100.00%> (+1.65%)` | :arrow_up: | | ... and [5 more](https://app.codecov.io/gh/AlgebraicJulia/GATlab.jl/pull/118?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AlgebraicJulia) | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/AlgebraicJulia/GATlab.jl/pull/118/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AlgebraicJulia)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

olynch commented 8 months ago

It looks like there are some conflicts; I'm happy to merge this after the conflicts are fixed!