mirror of
https://github.com/tgorordo/carousel.git
synced 2026-06-14 21:32:14 -07:00
sync
This commit is contained in:
parent
6cdc579270
commit
cbedbbeb48
12 changed files with 1582 additions and 591 deletions
124
test/nbs/__marimo__/session/hovses.py.json
Normal file
124
test/nbs/__marimo__/session/hovses.py.json
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
{
|
||||
"version": "1",
|
||||
"metadata": {
|
||||
"marimo_version": "0.18.3"
|
||||
},
|
||||
"cells": [
|
||||
{
|
||||
"id": "Hbol",
|
||||
"code_hash": "bc65c35c6fad59890b50c502bb8affa4",
|
||||
"outputs": [
|
||||
{
|
||||
"type": "data",
|
||||
"data": {
|
||||
"text/markdown": "<span class=\"markdown prose dark:prose-invert contents\"><h1 id=\"caltech-hovse-rotation-example\">Caltech Hovse Rotation Example</h1></span>"
|
||||
}
|
||||
}
|
||||
],
|
||||
"console": []
|
||||
},
|
||||
{
|
||||
"id": "MJUe",
|
||||
"code_hash": "ccb62cc29f2cec640b063832a90adfec",
|
||||
"outputs": [
|
||||
{
|
||||
"type": "data",
|
||||
"data": {
|
||||
"text/markdown": "<span class=\"markdown prose dark:prose-invert contents\"><h2 id=\"imports\">Imports</h2></span>"
|
||||
}
|
||||
}
|
||||
],
|
||||
"console": []
|
||||
},
|
||||
{
|
||||
"id": "vblA",
|
||||
"code_hash": "9588e2b4004a32c73b7ecc0a968b666f",
|
||||
"outputs": [
|
||||
{
|
||||
"type": "data",
|
||||
"data": {
|
||||
"text/plain": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"console": []
|
||||
},
|
||||
{
|
||||
"id": "bkHC",
|
||||
"code_hash": "4821038400db1f5dc63daf7ca5b26279",
|
||||
"outputs": [
|
||||
{
|
||||
"type": "data",
|
||||
"data": {
|
||||
"text/markdown": "<span class=\"markdown prose dark:prose-invert contents\"><h2 id=\"generating-rotation-rankings\">Generating Rotation Rankings</h2></span>"
|
||||
}
|
||||
}
|
||||
],
|
||||
"console": []
|
||||
},
|
||||
{
|
||||
"id": "lEQa",
|
||||
"code_hash": "ecc9ae14c8c8f3875656fc620665c6b4",
|
||||
"outputs": [
|
||||
{
|
||||
"type": "data",
|
||||
"data": {
|
||||
"text/html": "<pre class='text-xs'>True</pre>"
|
||||
}
|
||||
}
|
||||
],
|
||||
"console": []
|
||||
},
|
||||
{
|
||||
"id": "NdeS",
|
||||
"code_hash": "c582dec943ff7b743aa0691df291cea6",
|
||||
"outputs": [
|
||||
{
|
||||
"type": "data",
|
||||
"data": {
|
||||
"text/html": "<marimo-ui-element object-id='NdeS-0' random-id='7040b6c9-c598-beaa-38c6-9f1afe159be0'><marimo-table data-initial-value='[]' data-label='null' data-data='"[{\"\":\"A\",\"a\":1,\"b\":1,\"c\":2,\"d\":4},{\"\":\"B\",\"a\":2,\"b\":4,\"c\":1,\"d\":2},{\"\":\"C\",\"a\":3,\"b\":3,\"c\":3,\"d\":3},{\"\":\"D\",\"a\":4,\"b\":2,\"c\":4,\"d\":1}]"' data-total-rows='4' data-total-columns='5' data-max-columns='50' data-banner-text='""' data-pagination='true' data-page-size='10' data-field-types='[["",["string","str"]],["a",["integer","i64"]],["b",["integer","i64"]],["c",["integer","i64"]],["d",["integer","i64"]]]' data-show-filters='true' data-show-download='true' data-show-column-summaries='false' data-show-data-types='true' data-show-page-size-selector='false' data-show-column-explorer='true' data-show-chart-builder='true' data-row-headers='[]' data-has-stable-row-id='false' data-lazy='false' data-preload='false'></marimo-table></marimo-ui-element>"
|
||||
}
|
||||
}
|
||||
],
|
||||
"console": []
|
||||
},
|
||||
{
|
||||
"id": "PKri",
|
||||
"code_hash": "b9f0f3a28a20d94d4b173bbbd49db37f",
|
||||
"outputs": [],
|
||||
"console": []
|
||||
},
|
||||
{
|
||||
"id": "Xref",
|
||||
"code_hash": "ccc8305d08e563d4fb1c9df31e9b7b69",
|
||||
"outputs": [
|
||||
{
|
||||
"type": "data",
|
||||
"data": {
|
||||
"text/html": "<marimo-ui-element object-id='Xref-0' random-id='b6beae57-9d1c-9561-11cf-94cfd5b3aa06'><marimo-table data-initial-value='[]' data-label='null' data-data='"[{\"a\":\"A\",\"b\":\"A\",\"c\":\"B\",\"d\":\"D\"},{\"a\":\"B\",\"b\":\"D\",\"c\":\"A\",\"d\":\"B\"},{\"a\":\"C\",\"b\":\"C\",\"c\":\"C\",\"d\":\"C\"},{\"a\":\"D\",\"b\":\"B\",\"c\":\"D\",\"d\":\"A\"}]"' data-total-rows='4' data-total-columns='4' data-max-columns='50' data-banner-text='""' data-pagination='true' data-page-size='10' data-field-types='[["a",["string","str"]],["b",["string","str"]],["c",["string","str"]],["d",["string","str"]]]' data-show-filters='true' data-show-download='true' data-show-column-summaries='false' data-show-data-types='true' data-show-page-size-selector='false' data-show-column-explorer='true' data-show-chart-builder='true' data-row-headers='[]' data-has-stable-row-id='false' data-lazy='false' data-preload='false'></marimo-table></marimo-ui-element>"
|
||||
}
|
||||
}
|
||||
],
|
||||
"console": []
|
||||
},
|
||||
{
|
||||
"id": "taaO",
|
||||
"code_hash": "b712cc6f3d50763308dd5bc1c6703f77",
|
||||
"outputs": [
|
||||
{
|
||||
"type": "data",
|
||||
"data": {
|
||||
"text/html": "<marimo-ui-element object-id='taaO-0' random-id='1a8ede2c-9d90-fbec-5f1c-6258f3189f72'><marimo-table data-initial-value='[]' data-label='null' data-data='"[{\"rank\":0,\"prioritizer\":\"A\",\"subject\":\"d\"},{\"rank\":1,\"prioritizer\":\"A\",\"subject\":\"c\"},{\"rank\":2,\"prioritizer\":\"A\",\"subject\":\"a\"},{\"rank\":3,\"prioritizer\":\"A\",\"subject\":\"b\"},{\"rank\":0,\"prioritizer\":\"B\",\"subject\":\"b\"},{\"rank\":1,\"prioritizer\":\"B\",\"subject\":\"d\"},{\"rank\":2,\"prioritizer\":\"B\",\"subject\":\"a\"},{\"rank\":3,\"prioritizer\":\"B\",\"subject\":\"c\"},{\"rank\":0,\"prioritizer\":\"C\",\"subject\":\"d\"},{\"rank\":1,\"prioritizer\":\"C\",\"subject\":\"a\"}]"' data-total-rows='16' data-total-columns='3' data-max-columns='50' data-banner-text='""' data-pagination='true' data-page-size='10' data-field-types='[["rank",["integer","u32"]],["prioritizer",["string","str"]],["subject",["string","str"]]]' data-show-filters='true' data-show-download='true' data-show-column-summaries='true' data-show-data-types='true' data-show-page-size-selector='true' data-show-column-explorer='true' data-show-chart-builder='true' data-row-headers='[]' data-has-stable-row-id='false' data-lazy='false' data-preload='false'></marimo-table></marimo-ui-element>"
|
||||
}
|
||||
}
|
||||
],
|
||||
"console": []
|
||||
},
|
||||
{
|
||||
"id": "wJzy",
|
||||
"code_hash": null,
|
||||
"outputs": [],
|
||||
"console": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,18 +1,22 @@
|
|||
import marimo
|
||||
|
||||
__generated_with = "0.13.6"
|
||||
__generated_with = "0.18.3"
|
||||
app = marimo.App(width="medium")
|
||||
|
||||
|
||||
@app.cell(hide_code=True)
|
||||
def _(mo):
|
||||
mo.md(r"""# Caltech Hovse Rotation Example""")
|
||||
mo.md(r"""
|
||||
# Caltech Hovse Rotation Example
|
||||
""")
|
||||
return
|
||||
|
||||
|
||||
@app.cell(hide_code=True)
|
||||
def _(mo):
|
||||
mo.md(r"""## Imports""")
|
||||
mo.md(r"""
|
||||
## Imports
|
||||
""")
|
||||
return
|
||||
|
||||
|
||||
|
|
@ -22,27 +26,73 @@ def _():
|
|||
import polars as pl, polars.selectors as pls
|
||||
import numpy as np, faker as fk
|
||||
import carousel as crsl
|
||||
|
||||
return crsl, mo, pl
|
||||
|
||||
|
||||
@app.cell(hide_code=True)
|
||||
def _(mo):
|
||||
mo.md(r"""## Generating Rotation Rankings""")
|
||||
mo.md(r"""
|
||||
## Generating Rotation Rankings
|
||||
""")
|
||||
return
|
||||
|
||||
|
||||
@app.cell
|
||||
def _(crsl, pl):
|
||||
ar = pl.DataFrame({ "": ["A", "B", "C", "D"], "a": [1, 2, 3, 4], "b": [1, 4, 3, 2], "c": [2, 1, 3, 4], "d": [4, 2, 3, 1]})
|
||||
rr = pl.DataFrame({ "": ["a", "b", "c", "d"], "A": [3, 4, 2, 1], "B": [3, 1, 4, 2], "C": [2, 3, 4, 1], "D": [3, 2, 1, 4]})
|
||||
ar = pl.DataFrame(
|
||||
{
|
||||
"": ["A", "B", "C", "D"],
|
||||
"a": [1, 2, 3, 4],
|
||||
"b": [1, 4, 3, 2],
|
||||
"c": [2, 1, 3, 4],
|
||||
"d": [4, 2, 3, 1],
|
||||
}
|
||||
)
|
||||
rr = pl.DataFrame(
|
||||
{
|
||||
"": ["a", "b", "c", "d"],
|
||||
"A": [3, 4, 2, 1],
|
||||
"B": [3, 1, 4, 2],
|
||||
"C": [2, 3, 4, 1],
|
||||
"D": [3, 2, 1, 4],
|
||||
}
|
||||
)
|
||||
m = pl.DataFrame({"A": ["c"], "B": ["d"], "C": ["a"], "D": ["b"]})
|
||||
crsl.check_stable(m, ar, rr)
|
||||
crsl.check_match_stable(m, ar, rr)
|
||||
return ar, rr
|
||||
|
||||
|
||||
@app.cell
|
||||
def _(ar):
|
||||
ar
|
||||
return
|
||||
|
||||
|
||||
@app.cell
|
||||
def _():
|
||||
hovses = ["Blacker", "Dabney", "Ricketts", "Fleming", "Page", "Lloyd", "Venerable", "Avery"]
|
||||
hovses = [
|
||||
"Blacker",
|
||||
"Dabney",
|
||||
"Ricketts",
|
||||
"Fleming",
|
||||
"Page",
|
||||
"Lloyd",
|
||||
"Venerable",
|
||||
"Avery",
|
||||
]
|
||||
return
|
||||
|
||||
|
||||
@app.cell
|
||||
def _(ar, crsl):
|
||||
crsl.rank_to_pref(ar)
|
||||
return
|
||||
|
||||
|
||||
@app.cell
|
||||
def _(crsl, rr):
|
||||
crsl.pref_to_prio(crsl.rank_to_pref(rr))
|
||||
return
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue