Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions panel.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#figure(
table(
columns: (100%,),
stroke: none,
table(
columns: (1fr,1fr,1fr),
align: (left, center),
column-gutter: 0.5em,
table.hline(stroke: 0.15em),
table.cell([Panel A: Men], colspan: 3, align: left),
table.hline(),
table.header( [], [ID], [School]), table.hline(stroke: 0.05em), [Matthew Ortiz],[1234],[Texas],
[Michael Costa],[6789],[UVA],
[Samuel Johnson],[1023],[UMBC],
[Dakota Snyder],[5810],[UGA],
[Scott Mills],[9182],[Rice],
table.hline()
)
,table(
columns: (1fr,1fr,1fr),
align: (left, center),
column-gutter: 0.5em,
table.hline(stroke: 0.15em),
table.cell([Panel B: Women], colspan: 3, align: left),
table.hline(),
table.header( [], [ID], [School]), table.hline(stroke: 0.05em), [Erin Anderson],[9183],[Wake Forrest],
[Michelle Zimmerman],[5734],[Emory],
[Danielle King],[1290],[Texas],
[Shannon Nelson],[4743],[UVA],
[Stephanie Booth],[8912],[Columbia],
table.hline()
)
,
)
)
38 changes: 36 additions & 2 deletions samplenotebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"type": "integer"
}
],
"ref": "dabae8ec-9941-4705-bacb-d4968ec32494",
"ref": "8f2a7b99-50f5-4e7b-b566-ca6d16cc70f2",
"rows": [
[
"0",
Expand Down Expand Up @@ -818,6 +818,9 @@
" <td style=\"text-align: center;\">(0.140)</td>\n",
"\n",
" </tr>\n",
" <tr>\n",
" <td colspan='100%' style='border-top: 1px solid black;'></td>\n",
" </tr>\n",
" <tr><td colspan=\"8\" style=\"text-align:left;\"><i>* p< 0.1, ** p< 0.05, *** p< 0.01</i></td></tr>\n",
" </tbody>\n",
"</table>"
Expand Down Expand Up @@ -1026,6 +1029,9 @@
" <td style=\"text-align:center;\">Low C</td>\n",
" </tr>\n",
" </tr>\n",
" <tr>\n",
" <td colspan='100%' style='border-top: 1px solid black;'></td>\n",
" </tr>\n",
" <tr><td colspan=\"4\" style=\"text-align:right;\"><i>The default note aligns over here.</i></td></tr>\n",
" <tr><td colspan=\"4\" style=\"text-align:center;\"><i>But you can move it to the middle!</i></td></tr>\n",
" <tr><td colspan=\"4\" style=\"text-align:left;\"><i>Or over here!</i></td></tr>\n",
Expand Down Expand Up @@ -1159,6 +1165,9 @@
" <td style=\"text-align: center;\">5,000</td>\n",
"\n",
" </tr>\n",
" <tr>\n",
" <td colspan='100%' style='border-top: 1px solid black;'></td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
],
Expand Down Expand Up @@ -1476,6 +1485,9 @@
" <td style=\"text-align:center;\">Low C</td>\n",
" </tr>\n",
" </tr>\n",
" <tr>\n",
" <td colspan='100%' style='border-top: 1px solid black;'></td>\n",
" </tr>\n",
" <tr><td colspan=\"4\" style=\"text-align:right;\"><i>The default note aligns over here.</i></td></tr>\n",
" <tr><td colspan=\"4\" style=\"text-align:center;\"><i>But you can move it to the middle!</i></td></tr>\n",
" <tr><td colspan=\"4\" style=\"text-align:left;\"><i>Or over here!</i></td></tr>\n",
Expand Down Expand Up @@ -1724,6 +1736,9 @@
" <td style=\"text-align: center;\"></td>\n",
"\n",
" </tr>\n",
" <tr>\n",
" <td colspan='100%' style='border-top: 1px solid black;'></td>\n",
" </tr>\n",
" <tr><td colspan=\"4\" style=\"text-align:left;\"><i>*p<0.1, **p<0.05, ***p<0.01</i></td></tr>\n",
" </tbody>\n",
"</table>"
Expand Down Expand Up @@ -1885,6 +1900,9 @@
" <td style=\"text-align: center;\">2.849*</td>\n",
"\n",
" </tr>\n",
" <tr>\n",
" <td colspan='100%' style='border-top: 1px solid black;'></td>\n",
" </tr>\n",
" <tr><td colspan=\"4\" style=\"text-align:left;\"><i>*p<0.1, **p<0.05, ***p<0.01</i></td></tr>\n",
" </tbody>\n",
"</table>"
Expand Down Expand Up @@ -2310,6 +2328,9 @@
" <td style=\"text-align: center;\">27.959***</td>\n",
"\n",
" </tr>\n",
" <tr>\n",
" <td colspan='100%' style='border-top: 1px solid black;'></td>\n",
" </tr>\n",
" <tr><td colspan=\"4\" style=\"text-align:left;\"><i>*p<0.1, **p<0.05, ***p<0.01</i></td></tr>\n",
" </tbody>\n",
"</table>"
Expand Down Expand Up @@ -2598,6 +2619,9 @@
" <td style=\"text-align: center;\">27.959***</td>\n",
"\n",
" </tr>\n",
" <tr>\n",
" <td colspan='100%' style='border-top: 1px solid black;'></td>\n",
" </tr>\n",
" <tr><td colspan=\"4\" style=\"text-align:left;\"><i>*p<0.1, **p<0.05, ***p<0.01</i></td></tr>\n",
" </tbody>\n",
"</table>"
Expand Down Expand Up @@ -3069,6 +3093,9 @@
" <td style=\"text-align: center;\">27.959***</td>\n",
"\n",
" </tr>\n",
" <tr>\n",
" <td colspan='100%' style='border-top: 1px solid black;'></td>\n",
" </tr>\n",
" <tr><td colspan=\"4\" style=\"text-align:left;\"><i>*p<0.1, **p<0.05, ***p<0.01</i></td></tr>\n",
" </tbody>\n",
"</table>"
Expand Down Expand Up @@ -3224,7 +3251,8 @@
"metadata": {},
"outputs": [],
"source": [
"panel.render_latex(\"panel.tex\")"
"panel.render_latex(\"panel.tex\")\n",
"panel.render_typst(\"panel.typ\")"
]
},
{
Expand Down Expand Up @@ -3418,6 +3446,9 @@
" <td style=\"text-align: center;\">27.959</td>\n",
"\n",
" </tr>\n",
" <tr>\n",
" <td colspan='100%' style='border-top: 1px solid black;'></td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
],
Expand Down Expand Up @@ -3595,6 +3626,9 @@
" <td style=\"text-align: center;\"></td>\n",
"\n",
" </tr>\n",
" <tr>\n",
" <td colspan='100%' style='border-top: 1px solid black;'></td>\n",
" </tr>\n",
" <tr><td colspan=\"3\" style=\"text-align:left;\"><i>*p<0.1, **p<0.05, ***p<0.01</i></td></tr>\n",
" </tbody>\n",
"</table>"
Expand Down
6 changes: 3 additions & 3 deletions statstables/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Hashable
from statstables import (
tables,
renderers,
Expand Down Expand Up @@ -45,12 +45,12 @@ def add_model(self, model_results_class: Any, output_class: Any) -> None:
def _keyname(key: str):
return key.replace("<class '", "").replace("'>", "")

def __setitem__(self, key: str, value: Any):
def __setitem__(self, key: Hashable, value: Any):
msg = "Custom models must inherit from the ModelData class"
assert value.__base__ == modeltables.ModelData, msg
self.models[key] = value

def __getitem__(self, key: str):
def __getitem__(self, key: Hashable):
# custom models will be saved with their type as the key, but the natively
# supported models are passed in as strings (see initialization below)
# so they will be found in the first exception
Expand Down
Loading