diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index da98e9d..298f73c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -72,6 +72,8 @@ We appreciate your contributions and look forward to reviewing your pull request * Follow the Numpydoc docstring style for the documentation, see [link](https://numpydoc.readthedocs.io/en/latest/format.html) +* To generate .qmd files for package documentation, see tutorial in [_quarto.yml](_quarto.yml) + ## Makefile The `marginaleffects` repository includes a `Makefile` to facilitate some common tasks. diff --git a/_quarto.yml b/_quarto.yml new file mode 100644 index 0000000..f5a819a --- /dev/null +++ b/_quarto.yml @@ -0,0 +1,55 @@ +####### README ####### +# This is the HOWTO and the config file to build .qmd files +# +# First install quartodoc with `uv pip install quartodoc` +# +# To create the qmd files, run the following command in the terminal: +# > quartodoc build +# the result will be in ./qmd_files or (else specified in the dir field) +# modify the current file to change the included functions and the layout +# finally, run the following command to preview the website if wanted: +# > quarto preview +# +# NOTE: This references the marginaleffects in .venv first, to reference the local marginaleffects, delete or rename the folder marginaleffects in .venv/lib/ + + +project: + type: website + +# tell quarto to read the generated sidebar +# metadata-files: +# - _sidebar.yml + +format: + html: + theme: cosmo + css: styles.css + toc: false + +quartodoc: + # the name used to import the package you want to create reference docs for + package: marginaleffects + style: "pkgdown" + # write sidebar data to this file + # sidebar: _sidebar.yml + dir: qmd_files + + sections: + - title: Marginaleffects API reference guide + desc: Marginaleffects functions. + contents: + # the functions being documented in the package. + # you can refer to anything: class methods, modules, etc.. + - predictions + - comparisons + - slopes + - hypotheses + - datagrid + - plot_predictions + - plot_comparisons + - plot_slopes + - model_statsmodels + - model_sklearn + - name: utils + members: + - get_dataset \ No newline at end of file diff --git a/marginaleffects/comparisons.py b/marginaleffects/comparisons.py index 056bc1f..b939cec 100644 --- a/marginaleffects/comparisons.py +++ b/marginaleffects/comparisons.py @@ -364,6 +364,9 @@ def avg_comparisons( transform=None, eps=1e-4, ): + """ + docstring (TO DO) + """ if callable(newdata): newdata = newdata(model) diff --git a/marginaleffects/model_sklearn.py b/marginaleffects/model_sklearn.py index 15be1d3..ce63168 100644 --- a/marginaleffects/model_sklearn.py +++ b/marginaleffects/model_sklearn.py @@ -81,6 +81,9 @@ def get_predict(self, params, newdata: pl.DataFrame): def fit_sklearn( formula: str, data: pl.DataFrame, engine, kwargs_engine={}, kwargs_fit={} ): + """ + fit_sklearn docstring (TO DO) + """ d = listwise_deletion(formula, data=data) y, X = model_matrices(formula, d) # formulaic returns a matrix when the response is character or categorical diff --git a/marginaleffects/model_statsmodels.py b/marginaleffects/model_statsmodels.py index 0b43142..e0e450d 100644 --- a/marginaleffects/model_statsmodels.py +++ b/marginaleffects/model_statsmodels.py @@ -109,6 +109,9 @@ def get_df(self): def fit_statsmodels( formula: str, data: pl.DataFrame, engine, kwargs_engine={}, kwargs_fit={} ): + """ + fit docstring (TO DO) + """ d = fml.listwise_deletion(formula, data=data) y, X = fml.model_matrices(formula, d) mod = engine(endog=y, exog=X, **kwargs_engine) diff --git a/marginaleffects/predictions.py b/marginaleffects/predictions.py index fd7ec27..296551a 100644 --- a/marginaleffects/predictions.py +++ b/marginaleffects/predictions.py @@ -192,6 +192,9 @@ def avg_predictions( transform=None, wts=None, ): + """ + Predict average outcomes (TO DO) + """ if callable(newdata): newdata = newdata(model) diff --git a/marginaleffects/slopes.py b/marginaleffects/slopes.py index 42f15a1..eedea28 100644 --- a/marginaleffects/slopes.py +++ b/marginaleffects/slopes.py @@ -15,6 +15,9 @@ def slopes( eps=1e-4, eps_vcov=None, ): + """ + slopes docstring (TO DO) + """ if callable(newdata): newdata = newdata(model) @@ -54,6 +57,9 @@ def avg_slopes( eps=1e-4, eps_vcov=None, ): + """ + avg slopes docstring (TO DO) + """ if callable(newdata): newdata = newdata(model)