Skip to content

Commit 3be66e7

Browse files
committed
docs: document all functions
1 parent 970e406 commit 3be66e7

File tree

6 files changed

+81
-12
lines changed

6 files changed

+81
-12
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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import sys
1010
sys.path.insert(0, os.path.abspath('../../gen_surv'))
1111

12-
project = 'gen_suvr'
12+
project = 'gen_surv'
1313
copyright = '2025, Diogo Ribeiro'
1414
author = 'Diogo Ribeiro'
1515
release = '0.6.3'
@@ -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: 8 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
```
@@ -62,3 +69,4 @@ python -m gen_surv dataset aft_ln --n 100 > data.csv
6269
- [Source Code](https://github.com/DiogoRibeiro7/genSurvPy)
6370
- [License](https://github.com/DiogoRibeiro7/genSurvPy/blob/main/LICENSE)
6471
- [Code of Conduct](https://github.com/DiogoRibeiro7/genSurvPy/blob/main/CODE_OF_CONDUCT.md)
72+

docs/source/modules.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,29 @@
2323
::: gen_surv.interface
2424
options:
2525
members: true
26-
undoc-members: tru
26+
undoc-members: true
2727

2828
::: gen_surv.aft
2929
options:
3030
members: true
31-
undoc-members: true
31+
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)