Skip to content

Commit 9dad4e4

Browse files
docs: document all functions (#34)
1 parent d0e4b74 commit 9dad4e4

File tree

6 files changed

+79
-9
lines changed

6 files changed

+79
-9
lines changed

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,19 @@ writing Python code:
6565
python -m gen_surv dataset aft_ln --n 100 > data.csv
6666
```
6767

68-
## 🔧 Available Generators
69-
70-
| Function | Description |
71-
|--------------|--------------------------------------------|
72-
| `gen_cphm()` | Cox Proportional Hazards Model |
73-
| `gen_cmm()` | Continuous-Time Multi-State Markov Model |
74-
| `gen_tdcm()` | Time-Dependent Covariate Model |
75-
| `gen_thmm()` | Time-Homogeneous Markov Model |
76-
| `gen_aft_log_normal()` | Accelerated Failure Time Log-Normal |
68+
## 🔧 API Overview
69+
70+
| Function | Description |
71+
|----------|-------------|
72+
| `generate()` | Unified interface that calls any generator |
73+
| `gen_cphm()` | Cox Proportional Hazards Model |
74+
| `gen_cmm()` | Continuous-Time Multi-State Markov Model |
75+
| `gen_tdcm()` | Time-Dependent Covariate Model |
76+
| `gen_thmm()` | Time-Homogeneous Markov Model |
77+
| `gen_aft_log_normal()` | Accelerated Failure Time Log-Normal |
78+
| `sample_bivariate_distribution()` | Sample correlated Weibull or exponential times |
79+
| `runifcens()` | Generate uniform censoring times |
80+
| `rexpocens()` | Generate exponential censoring times |
7781

7882

7983
```text

docs/source/_static/.gitkeep

Whitespace-only changes.

docs/source/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@
2222
"sphinx.ext.napoleon",
2323
"myst_parser",
2424
"sphinx.ext.viewcode",
25+
"sphinx.ext.autosectionlabel",
2526
]
2627

28+
autosectionlabel_prefix_document = True
29+
2730
# Point to index.md or index.rst as the root document
2831
master_doc = "index"
2932

@@ -36,3 +39,4 @@
3639
html_theme = 'alabaster'
3740
html_static_path = ['_static']
3841

42+

docs/source/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,21 @@ It includes generators for:
1010
- **Time-Homogeneous Hidden Markov Models (THMM)**
1111
- **Accelerated Failure Time (AFT) Log-Normal Models**
1212

13+
Key functions include `generate()`, `gen_cphm()`, `gen_cmm()`, `gen_tdcm()`,
14+
`gen_thmm()`, `gen_aft_log_normal()`, `sample_bivariate_distribution()`,
15+
`runifcens()`, and `rexpocens()`.
16+
1317
---
1418

19+
See the [Getting Started](usage) guide for installation instructions.
20+
1521
## 📚 Modules
1622

1723
```{toctree}
1824
:maxdepth: 2
1925
:caption: Contents
2026
27+
usage
2128
modules
2229
theory
2330
```
@@ -77,6 +84,7 @@ genSurvPy/
7784
- [License](https://github.com/DiogoRibeiro7/genSurvPy/blob/main/LICENCE)
7885
- [Code of Conduct](https://github.com/DiogoRibeiro7/genSurvPy/blob/main/CODE_OF_CONDUCT.md)
7986

87+
8088
## Citation
8189

8290
If you use **gen_surv** in your work, please cite it using the metadata in
@@ -89,3 +97,4 @@ If you use **gen_surv** in your work, please cite it using the metadata in
8997
- ORCID: <https://orcid.org/0009-0001-2022-7072>
9098
- Professional email: <[email protected]>
9199
- Personal email: <[email protected]>
100+

docs/source/modules.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,23 @@
2929
options:
3030
members: true
3131
undoc-members: true
32+
33+
::: gen_surv.bivariate
34+
options:
35+
members: true
36+
undoc-members: true
37+
38+
::: gen_surv.censoring
39+
options:
40+
members: true
41+
undoc-members: true
42+
43+
::: gen_surv.cli
44+
options:
45+
members: true
46+
undoc-members: true
47+
48+
::: gen_surv.validate
49+
options:
50+
members: true
51+
undoc-members: true

docs/source/usage.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Getting Started
2+
3+
This page offers a quick introduction to installing and using **gen_surv**.
4+
5+
## Installation
6+
7+
The project is managed with [Poetry](https://python-poetry.org). Clone the repository and install dependencies:
8+
9+
```bash
10+
poetry install
11+
```
12+
13+
This will create a virtual environment and install all required packages.
14+
15+
## Basic Usage
16+
17+
Generate datasets directly in Python:
18+
19+
```python
20+
from gen_surv import generate
21+
22+
# Cox Proportional Hazards example
23+
generate(model="cphm", n=100, model_cens="uniform", cens_par=1.0, beta=0.5, covar=2.0)
24+
```
25+
26+
You can also generate data from the command line:
27+
28+
```bash
29+
python -m gen_surv dataset aft_ln --n 100 > data.csv
30+
```
31+
32+
For a full description of available models and parameters, see the API reference.
33+

0 commit comments

Comments
 (0)