Skip to content

Commit 200a5de

Browse files
committed
wip, might need to separate in two branche, docstring start and quarto config and styles
1 parent 84397cb commit 200a5de

8 files changed

+240
-514
lines changed

_quarto.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
####### README #######
2+
# This references the marginaleffects in .venv first, to reference the local marginaleffects, delete or rename the folder marginaleffects in .venv/lib/
23
#
34
# To create the qmd files, run the following command in the terminal:
45
# > quartodoc build
@@ -15,6 +16,11 @@ project:
1516
metadata-files:
1617
- _sidebar.yml
1718

19+
format:
20+
html:
21+
theme: cosmo
22+
css: styles.css
23+
toc: false
1824

1925
quartodoc:
2026
# the name used to import the package you want to create reference docs for
@@ -24,14 +30,12 @@ quartodoc:
2430
sidebar: _sidebar.yml
2531

2632
sections:
27-
- title: Some functions
28-
desc: Functions to inspect docstrings.
33+
- title: Marginaleffects API reference guide
34+
desc: Marginaleffects functions.
2935
contents:
3036
# the functions being documented in the package.
3137
# you can refer to anything: class methods, modules, etc..
32-
# - avg_predictions
3338
- predictions
34-
- avg_predictions
3539
- comparisons
3640
- slopes
3741
- hypotheses
@@ -41,4 +45,6 @@ quartodoc:
4145
- plot_slopes
4246
- model_statsmodels
4347
- model_sklearn
44-
- utils
48+
- name: utils
49+
members:
50+
- get_dataset

marginaleffects/comparisons.py

+3
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,9 @@ def avg_comparisons(
364364
transform=None,
365365
eps=1e-4,
366366
):
367+
"""
368+
docstring (TO DO)
369+
"""
367370
if callable(newdata):
368371
newdata = newdata(model)
369372

marginaleffects/model_sklearn.py

+3
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ def get_predict(self, params, newdata: pl.DataFrame):
8181
def fit_sklearn(
8282
formula: str, data: pl.DataFrame, engine, kwargs_engine={}, kwargs_fit={}
8383
):
84+
"""
85+
fit_sklearn docstring (TO DO)
86+
"""
8487
d = listwise_deletion(formula, data=data)
8588
y, X = model_matrices(formula, d)
8689
# formulaic returns a matrix when the response is character or categorical

marginaleffects/model_statsmodels.py

+3
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ def get_df(self):
109109
def fit_statsmodels(
110110
formula: str, data: pl.DataFrame, engine, kwargs_engine={}, kwargs_fit={}
111111
):
112+
"""
113+
fit docstring (TO DO)
114+
"""
112115
d = fml.listwise_deletion(formula, data=data)
113116
y, X = fml.model_matrices(formula, d)
114117
mod = engine(endog=y, exog=X, **kwargs_engine)

marginaleffects/slopes.py

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ def slopes(
1515
eps=1e-4,
1616
eps_vcov=None,
1717
):
18+
"""
19+
slopes docstring (TO DO)
20+
"""
1821
if callable(newdata):
1922
newdata = newdata(model)
2023

@@ -54,6 +57,9 @@ def avg_slopes(
5457
eps=1e-4,
5558
eps_vcov=None,
5659
):
60+
"""
61+
avg slopes docstring (TO DO)
62+
"""
5763
if callable(newdata):
5864
newdata = newdata(model)
5965

pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ dev-dependencies = [
3232
"patsy",
3333
"pytest >=8.1.1,<9",
3434
"pytest-xdist >=3.6.1",
35-
"ruff>=0.6.4",
36-
"quartodoc"
35+
"ruff>=0.6.4"
3736
]
3837

3938

styles.css

+211
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
/* css table reproduced from siuba.org repository https://github.com/machow/siuba.org/blob/19c515762b6df13f010803988eda070bcd639f3c/styles.css */
2+
/* css styles */
3+
@import url('https://rsms.me/inter/inter.css');
4+
html { font-family: 'Inter', sans-serif; }
5+
@supports (font-variation-settings: normal) {
6+
html { font-family: 'Inter var', sans-serif; }
7+
}
8+
9+
:root {
10+
--bs-body-font-family: inter;
11+
--bs-body-font-size: 16px;
12+
}
13+
14+
:root {
15+
--site-color-primary: #F9F4D8;/*#ebfddd;*/
16+
--site-color-primary: #EE8320;
17+
--site-color-primary: #C29A68;
18+
}
19+
20+
#quarto-header {
21+
border: 1px solid #dee2e6;
22+
background-color: #FFFFFF;
23+
}
24+
25+
#quarto-header nav {
26+
max-width: 1300px;
27+
margin: auto;
28+
}
29+
30+
#quarto-header .nav-link {
31+
padding-left: 5.4px !important;
32+
padding-right: 5.4px !important;
33+
margin-left: 30px !important;
34+
margin-right: 5.4px !important;
35+
font-size: 18px;
36+
}
37+
38+
#quarto-header .nav-link .bi {
39+
font-size: 20px;
40+
}
41+
42+
.sidebar a.nav-link {
43+
font-size: 14.4px;
44+
font-weight: 400;
45+
}
46+
47+
.nav-item .nav-link.active {
48+
/*background-color: #EE8320;*/
49+
border-bottom: black 2px solid;
50+
}
51+
52+
.navbar {
53+
/*background-color: var(--site-color-primary);*/
54+
background-color: #FFFFFF;
55+
/*var(--site-color-primary);*/
56+
padding-top: 0px !important;
57+
padding-bottom: 0px !important;
58+
/*border-bottom: black 2px solid;*/
59+
}
60+
61+
.navbar-title {
62+
color: black !important;
63+
font-weight: 800;
64+
font-size: 32px;
65+
}
66+
67+
.navbar-nav .nav-link {
68+
color: black !important;
69+
}
70+
71+
.navbar #quarto-search.type-overlay .aa-Autocomplete svg.aa-SubmitIcon {
72+
color: black;
73+
}
74+
75+
div.sidebar-item-container .active {
76+
/*color: #0047ab;*/
77+
color: #6699ff;
78+
color: #5dba17;
79+
color: #4D9089 !important;
80+
font-weight: 600;
81+
}
82+
83+
.sidebar nav[role=doc-toc] ul>li>a.active, .sidebar nav[role=doc-toc] ul>li>ul>li>a.active
84+
{
85+
color: black !important;
86+
/*color: #4D9089 !important;*/
87+
border-left: 2px solid #4D9089 !important;
88+
}
89+
90+
.sidebar nav[role=doc-toc]>ul a {
91+
border-left: 2px solid white;
92+
}
93+
94+
/*
95+
div.sidebar-item-container .active {
96+
color: black;
97+
background-color: var(--site-color-secondary);
98+
}
99+
100+
.sidebar nav[role=doc-toc] ul>li>a.active {
101+
border-left: 1px solid var(--site-color-secondary);
102+
color: var(--site-color-secondary) !important;
103+
}
104+
*/
105+
106+
.sidebar-item-container .text-start {
107+
font-weight: 600;
108+
font-size: 14.4px !important;
109+
}
110+
111+
.sidebar-item-text {
112+
/*color: rgba(60, 60, 60, 0.7);*/
113+
font-weight: 500;
114+
font-size: 14px;
115+
line-height: 22px;
116+
}
117+
118+
.sidebar-item-section {
119+
padding-top: 16px;
120+
}
121+
122+
.sidebar-section {
123+
padding-left: 0px !important;
124+
}
125+
126+
.dataframe {
127+
font-size: 14px;
128+
}
129+
130+
.dataframe, .dataframe table {
131+
width: inherit;
132+
}
133+
134+
/*
135+
.dataframe tbody tr th:only-of-type {
136+
vertical-align: middle;
137+
}
138+
139+
.dataframe tbody tr th {
140+
vertical-align: top;
141+
}
142+
143+
.dataframe thead th {
144+
text-align: right;
145+
}
146+
*/
147+
148+
149+
150+
151+
/* INDEX PAGE ------------------------------------------ */
152+
153+
154+
155+
156+
/*
157+
* Buttons
158+
*/
159+
160+
.btn-action {
161+
min-width: 165px;
162+
border-radius: 30px;
163+
border: none;
164+
}
165+
166+
/* content block */
167+
168+
.content-block {
169+
padding-top: 20px;
170+
padding-bottom: 10px;
171+
margin-left: 30px;
172+
margin-right: 30px;
173+
}
174+
175+
176+
@media(min-width: 900px) {
177+
.content-block {
178+
margin-left: 50px;
179+
margin-right: 50px;
180+
}
181+
}
182+
183+
@media (min-width: 1200px) {
184+
.content-block {
185+
max-width: 1100px;
186+
margin-left: auto;
187+
margin-right: auto;
188+
}
189+
}
190+
191+
.feature-blocks .grid {
192+
padding-top: 20px;
193+
padding-bottom: 20px;
194+
}
195+
196+
.hero-banner {
197+
background-image: url('./assets/siuba-banner.svg');
198+
background-size: auto 100%;
199+
background-position: center;
200+
height: 400px;
201+
}
202+
203+
.hero-github-links {
204+
padding-top: 30px;
205+
}
206+
207+
.hero-title {
208+
font-size: 64px;
209+
background-color: #FFFFFF77;
210+
}
211+

0 commit comments

Comments
 (0)