Skip to content

Commit 8eb7283

Browse files
authored
Merge pull request #69 from UCL-CORU/docs-formatting
Docs formatting
2 parents 1e90fe1 + a0bf6a9 commit 8eb7283

7 files changed

Lines changed: 116 additions & 5 deletions

File tree

README.md

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,21 @@ pip install -e ".[test]" #this will install the code in test mode
9999

100100
```
101101

102+
### Development Installation (optional)
103+
104+
If you plan to contribute to the project or run documentation locally, install the development and documentation dependencies:
105+
106+
```sh
107+
# For development tools (linting, formatting, etc.)
108+
pip install -e ".[dev]"
109+
110+
# For building documentation
111+
pip install -e ".[docs]"
112+
113+
# For both development and documentation
114+
pip install -e ".[dev,docs]"
115+
```
116+
102117
Navigate to the patientflow folder and run tests to confirm that the installation worked correctly. This command will only work from the root repository. (To date, this has only been tested on Linux and Mac OS machines. If you are running Windows, there may be errors we don't know about. Please raise an issue on Github in that case.)
103118

104119
```sh
@@ -107,7 +122,21 @@ pytest
107122

108123
If you get errors running the pytest command, there may be other installations needed on your local machine.
109124

110-
### Using the notebooks in this repository
125+
### Building and Viewing Documentation (optional)
126+
127+
After installing the documentation dependencies, you can build and view the documentation locally:
128+
129+
```sh
130+
# Build and serve the documentation with live reloading
131+
mkdocs serve
132+
133+
# Or just build the documentation
134+
mkdocs build
135+
```
136+
137+
The documentation will be available at http://127.0.0.1:8000/ when using `mkdocs serve`.
138+
139+
## Using the notebooks in this repository
111140

112141
The notebooks in this repository demonstrate the use of some of the functions provided in `patientflow`. The cell output shows the results of running the notebooks. If you want to run them yourself, you have two options
113142

@@ -127,6 +156,55 @@ python -m patientflow.train.emergency_demand --data_folder_name=data-synthetic
127156

128157
The `data_folder_name`argument specifies the name of the folder containing data. The function expects this folder to be directly below the root of the repository.
129158

159+
## Contributing to PatientFlow
160+
161+
We welcome contributions to the patientflow project. To contribute, follow the instructions below.
162+
163+
### Development Workflow
164+
165+
1. Fork the repository on GitHub
166+
2. Clone your fork locally and set up your development environment following the [installation instructions](#installation) above, making sure to install the development dependencies.
167+
3. Create a new branch for your changes:
168+
```sh
169+
git checkout -b feature/your-feature-name
170+
```
171+
4. Make your changes following the code style guidelines
172+
5. Run tests as described in the installation section to ensure your changes don't break existing functionality
173+
6. Update documentation if needed using the documentation tools mentioned above
174+
7. Commit your changes with a descriptive message
175+
176+
### Code Style Guidelines
177+
178+
- Follow PEP 8 guidelines for Python code
179+
- Use type hints where appropriate
180+
- Write docstrings for all functions, classes, and modules
181+
- Add unit tests for new functionality
182+
183+
### Submitting Your Contribution
184+
185+
1. Push your changes to your forked repository:
186+
```sh
187+
git push origin feature/your-feature-name
188+
```
189+
2. Open a pull request from your fork to the main repository
190+
- Provide a clear title and description
191+
- Reference any relevant issues
192+
- Include screenshots if applicable
193+
3. Address any feedback or review comments
194+
195+
### Reporting Issues
196+
197+
If you find a bug or have a suggestion:
198+
199+
1. Check existing issues to avoid duplicates
200+
2. Open a new issue describing:
201+
- What you expected to happen
202+
- What actually happened
203+
- Steps to reproduce
204+
- Your environment details (OS, Python version, etc.)
205+
206+
Thank you for contributing!
207+
130208
## Roadmap
131209

132210
- [x] Initial Research
@@ -136,7 +214,7 @@ The `data_folder_name`argument specifies the name of the folder containing data.
136214

137215
### Project Team
138216

139-
- [Dr Zella King](https://github.com/zmek), Clinical Operational Research Unit (CORU), University College London ([zella.king@ucl.ac.uk](mailto:zella.king@ucl.ac.uk))
217+
- [Dr Zella King](https://github.com/zmek), Clinical Operational Research Unit (CORU), University College London (UCL)([zella.king@ucl.ac.uk](mailto:zella.king@ucl.ac.uk))
140218
- [Jon Gillham](https://github.com/jongillham), Institute of Health Informatics, UCL
141219
- Professor Sonya Crowe, CORU
142220
- Professor Martin Utley, CORU

docs/notebooks/4c_Evaluate_emergency_demand_predictions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ The haematology/oncology and paediatric models have show a stepwise pattern of s
401401

402402
However, the narrow, peaked histograms for these specialties suggest consistent, small overestimations rather than wild inaccuracy, which is a reasonable outcome given the small sample sizes.
403403

404-
## ## Generate predicted distributions and observed number of admissions for each specialty and prediction time for patients yet-to-arrive to the ED
404+
## Generate predicted distributions and observed number of admissions for each specialty and prediction time for patients yet-to-arrive to the ED
405405

406406
As the predictions for yet-to-arrive patients are aspirational, these cannot be directly compared with observed numbers of patients who arrived after the moment of prediction, and were admitted within the prediction window. Due to slower than target processing of patients through the ED, these future arrivals would have a smaller likelihood of being admitted within the window than suggested by the aspirational target.
407407

docs/overrides/main.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{% extends "base.html" %} {% block extrahead %}
2+
<style>
3+
/* Make dataframe tables scroll horizontally when they're too wide */
4+
.md-typeset .dataframe {
5+
display: block;
6+
width: 100%;
7+
max-width: 100%;
8+
overflow-x: auto;
9+
white-space: nowrap;
10+
margin-bottom: 1rem;
11+
border-collapse: collapse;
12+
}
13+
14+
/* Handle table containers */
15+
.md-typeset div table {
16+
display: table;
17+
width: 100%;
18+
}
19+
20+
/* Ensure code outputs don't overflow */
21+
.md-content__inner pre {
22+
overflow-x: auto;
23+
max-width: 100%;
24+
}
25+
26+
/* Images should not overflow */
27+
.md-typeset img {
28+
max-width: 100%;
29+
}
30+
</style>
31+
{% endblock %}

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ validation:
1515

1616
theme:
1717
name: "material"
18+
custom_dir: docs/overrides
1819
features:
1920
- content.action.edit
2021
palette:

notebooks/4c_Evaluate_emergency_demand_predictions.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@
615615
"cell_type": "markdown",
616616
"metadata": {},
617617
"source": [
618-
"## ## Generate predicted distributions and observed number of admissions for each specialty and prediction time for patients yet-to-arrive to the ED\n",
618+
"## Generate predicted distributions and observed number of admissions for each specialty and prediction time for patients yet-to-arrive to the ED\n",
619619
"\n",
620620
"As the predictions for yet-to-arrive patients are aspirational, these cannot be directly compared with observed numbers of patients who arrived after the moment of prediction, and were admitted within the prediction window. Due to slower than target processing of patients through the ED, these future arrivals would have a smaller likelihood of being admitted within the window than suggested by the aspirational target. \n",
621621
"\n",

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ optional-dependencies = {dev = [
3535
], docs = [
3636
"griffe",
3737
"mkdocs",
38+
"mkdocs-autorefs",
39+
"mkdocs-awesome-pages-plugin",
3840
"mkdocs-include-markdown-plugin",
3941
"mkdocs-material",
4042
"mkdocstrings",

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
matplotlib>=3.1.3
2-
mkdocs-awesome-pages-plugin>=2.8.0
32
numpy>=1.18.1
43
pandas>=1.0.1
54
PyYAML==6.0.2

0 commit comments

Comments
 (0)