Skip to content

Commit 815603e

Browse files
committed
Add __version__ and CLI docs
1 parent 0f2c560 commit 815603e

File tree

4 files changed

+37
-4
lines changed

4 files changed

+37
-4
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ generate(model="thmm", n=100, qmat=[[0, 0.2, 0], [0.1, 0, 0.1], [0, 0.3, 0]],
5555
p0=[1.0, 0.0, 0.0], model_cens="exponential", cens_par=3.0)
5656
```
5757

58+
## ⌨️ Command-Line Usage
59+
60+
Install the package and use ``python -m gen_surv`` to generate datasets without
61+
writing Python code:
62+
63+
```bash
64+
python -m gen_surv dataset aft_ln --n 100 > data.csv
65+
```
66+
5867
## 🔧 Available Generators
5968

6069
| Function | Description |

TODO.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ This document outlines future enhancements, features, and ideas for improving th
1818
## 📦 1. Interface and UX
1919

2020
- [] Create a `generate(..., return_type="df" | "dict")` interface
21-
- [ ] Add `__version__` using `importlib.metadata` or `poetry-dynamic-versioning`
22-
- [ ] Build a CLI with `typer` or `click`
21+
- [] Add `__version__` using `importlib.metadata` or `poetry-dynamic-versioning`
22+
- [] Build a CLI with `typer` or `click`
2323
- [] Add example notebooks or scripts for each model (`examples/` folder)
2424

2525
---
@@ -36,7 +36,7 @@ This document outlines future enhancements, features, and ideas for improving th
3636
## 🧪 3. Testing and Quality
3737

3838
- [] Add tests for each model (e.g., `test_tdcm.py`, `test_thmm.py`, `test_aft.py`)
39-
- [ ] Add property-based tests with `hypothesis`
39+
- [] Add property-based tests with `hypothesis`
4040
- [ ] Cover edge cases (e.g., invalid parameters, n=0, negative censoring)
4141
- [ ] Run tests on multiple Python versions (CI matrix)
4242

docs/source/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ generate(model="thmm", n=100, qmat=[[0, 0.2, 0], [0.1, 0, 0.1], [0, 0.3, 0]],
4949
p0=[1.0, 0.0, 0.0], model_cens="exponential", cens_par=3.0)
5050
```
5151

52+
## ⌨️ Command-Line Usage
53+
54+
Generate datasets directly from the terminal:
55+
56+
```bash
57+
python -m gen_surv dataset aft_ln --n 100 > data.csv
58+
```
59+
5260
## 🔗 Project Links
5361

5462
- [Source Code](https://github.com/DiogoRibeiro7/genSurvPy)

gen_surv/__init__.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
1-
from .interface import generate
1+
"""Top-level package for ``gen_surv``.
2+
3+
This module exposes the :func:`generate` function and provides access to the
4+
package version via ``__version__``.
5+
"""
6+
7+
from importlib.metadata import PackageNotFoundError, version
8+
9+
from .interface import generate
10+
11+
try:
12+
__version__ = version("gen_surv")
13+
except PackageNotFoundError: # pragma: no cover - fallback when package not installed
14+
__version__ = "0.0.0"
15+
16+
__all__ = ["generate", "__version__"]
17+

0 commit comments

Comments
 (0)