Skip to content

Commit 8161b55

Browse files
Copilothroskes
andcommitted
Fix pylint, add Jupytext header to CLI docs, add TOC test, update copilot-instructions
Co-authored-by: hroskes <[email protected]>
1 parent 6caae84 commit 8161b55

File tree

5 files changed

+235
-158
lines changed

5 files changed

+235
-158
lines changed

.github/copilot-instructions.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ This repository contains two distinct Python packages for biomedical analysis:
1212
**Key frameworks**: NumPy/SciPy for numerical computing, Matplotlib for plotting, Gurobi for optimization (KoMbine only)
1313
**Target runtime**: Python 3.11+ (tested with 3.12)
1414

15+
## Code Style Guidelines
16+
17+
**CRITICAL: Indentation and Formatting**
18+
- **Use 2-space indentation** for all Python code (not 4 spaces or tabs)
19+
- **No trailing whitespace** - remove all trailing spaces at the end of lines
20+
- **Always run pylint after editing** and fix any errors before committing
21+
- Run `python -m pylint <file>` to check for issues
22+
- Nontrivial errors that would require major refactoring can be ignored via `# pylint: disable=error-name` comments
23+
- Target pylint score: 10.00/10
24+
1525
## Package Structure
1626

1727
### Core Packages
@@ -20,7 +30,7 @@ This repository contains two distinct Python packages for biomedical analysis:
2030
- `discrete_base.py`, `continuous_distributions.py` - Supporting classes
2131
- `command_line_interface.py` - ROC-specific CLI functions
2232
- `datacard.py` - Re-exports Datacard from kombine for compatibility
23-
33+
2434
- **`kombine/`**: Kaplan-Meier analysis functionality
2535
- `kaplan_meier*.py` - KM curve and likelihood methods
2636
- `discrete_optimization.py`, `utilities.py` - Optimization utilities (used by KM methods)
@@ -32,23 +42,25 @@ This repository contains two distinct Python packages for biomedical analysis:
3242
- **`test/kombine/`**: KoMbine tests, datacards, and reference data
3343
- **Shared files**: `utility_testing_functions.py`, `test_continuous_distributions.py` (copied to both)
3444

35-
### Documentation Structure
45+
### Documentation Structure
3646
- **`docs/roc_picker/`**: ROC Picker documentation, LaTeX files, and plotting scripts
3747
- **`docs/kombine/`**: KoMbine documentation, LaTeX files, and plotting scripts
3848
- Each has independent numbering starting from 01, with separate `compile_*_plots.sh` scripts
3949

4050
**KoMbine documentation files**:
41-
- `01_table_of_contents.md` - Index of all documentation files
51+
- `01_table_of_contents.md` - Index of all documentation files (synced with Jupytext)
4252
- `02_kombine.tex` - LaTeX paper with mathematical details (JSS submission)
4353
- `03_kaplan_meier_example.md` - Jupyter notebook showing Python API usage examples
4454
- `04_compare_to_lifelines.md` - Jupyter notebook comparing to `lifelines` package
45-
- `05_command_line_interface.md` - **Pure Markdown** (no Python cells) documenting all CLI options for `kombine` and `kombine_twogroups` commands
55+
- `05_command_line_interface.md` - **Pure Markdown** (no Python cells) documenting all CLI options for `kombine` and `kombine_twogroups` commands (synced with Jupytext)
4656

4757
**Documentation style guidelines**:
4858
- Files `03_*.md` and `04_*.md` are Jupytext notebooks with Python cells for interactive examples
49-
- File `05_command_line_interface.md` is pure Markdown without Python cells - it documents the CLI, not the Python API
50-
- All CLI options must be documented in `05_command_line_interface.md` and verified by `test/kombine/test_cli_documentation.py`
59+
- Files `01_*.md` and `05_*.md` are pure Markdown with Jupytext headers but no Python cells
60+
- All documentation markdown files must have Jupytext headers to allow `jupytext --sync` to process them
61+
- All CLI options must be documented in `05_command_line_interface.md` and verified by `test/kombine/test_documentation.py`
5162
- When adding new CLI arguments, update `05_command_line_interface.md` and run the documentation test
63+
- The table of contents (`01_table_of_contents.md`) must list all numbered documentation files
5264

5365
## Critical Build Information
5466

.github/workflows/ci-cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ jobs:
158158
run: |
159159
python -m test.kombine.test_xmax_edge_cases
160160
161-
- name: CLI documentation completeness test
161+
- name: Documentation tests
162162
run: |
163-
python -m test.kombine.test_cli_documentation
163+
python -m test.kombine.test_documentation
164164
165165
- name: convert KoMbine notebooks
166166
run: |

docs/kombine/05_command_line_interface.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
---
2+
jupyter:
3+
jupytext:
4+
cell_metadata_filter: -all
5+
formats: ipynb,md,py
6+
main_language: python
7+
text_representation:
8+
extension: .md
9+
format_name: markdown
10+
format_version: '1.3'
11+
jupytext_version: 1.18.1
12+
---
13+
114
# KoMbine Command Line Interface
215

316
This document describes the command line interface for KoMbine's Kaplan-Meier likelihood methods.

test/kombine/test_cli_documentation.py

Lines changed: 0 additions & 150 deletions
This file was deleted.

0 commit comments

Comments
 (0)