Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docstrings and docs #149

Merged
merged 25 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Python package to detect AKI within time series data.

The goal of this package is to establish well tested, comprehensive functions for the detection of Acute Kidney Injury (AKI) in time series data, according to the Kidney Disease Improving Global Outcomes (KDIGO) Criteria, established in 2012 [^kdigo].
![](img/kdigo_criteria.png)
![](doc/doc/img/kdigo_criteria.png)

## Installation

Expand Down
22 changes: 22 additions & 0 deletions docs/docs/getting_started/basic_usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Basic Usage

An example of the basic usage is shown below. depending on your data you can specify the different datasets with the corresponding types. For the required columns please refer to the api reference documentation. After creating the analyser, you can analyse the data by calling the `process_stays` to process all patients. to process a single patient, you can use the `process_stay` method. please specify the patient id (`stay_id`) when analysing for a single patient.

the result will be a dataset containing several columns with the suffix `stage` containing the stages corresponding to the different probes. the overall `stage` is found in the stage column.

```python
import pandas as pd

from pyaki.probes import Dataset, DatasetType
from pyaki.kdigo import Analyser

data = [
Dataset(DatasetType.URINEOUTPUT, pd.DataFrame()),
Dataset(DatasetType.CREATININE, pd.DataFrame()),
Dataset(DatasetType.DEMOGRAPHICS, pd.DataFrame()),
Dataset(DatasetType.RRT, pd.DataFrame()),
]

analyser = Analyser(data)
results: pd.Dataframe = analyser.process_stays()
```
37 changes: 37 additions & 0 deletions docs/docs/getting_started/contributing.md
Paul-B98 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Contributing

Here is how you can contribute to this project.

## Setup

Use the included dev container to automatically install all the necessary dev tools and dependencies.

> **Prerequisite**: To use this you first need to install docker under Linux or WSL2 under windows.

1. **Clone the repository:**
```bash
git clone git+https://github.com/aidh-ms/pyAKI
cd pyAKI
```

2. **Open the project in Visual Studio Code:**
```bash
code .
```

3. **Reopen in Container:**
- Press `F1` to open the command palette.
- Type `Remote-Containers: Reopen in Container` and select it.
- VS Code will build the Docker container defined in the `.devcontainer` folder and open the project inside the container.

## Development



## Testing

To test your contribution, you can use the testing tap in the VS code or utilise the following command to run the unit tests for this project:

```shell
poetry run pytest .
```
30 changes: 30 additions & 0 deletions docs/docs/getting_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,41 @@

## Requirements

The supported Python versions for this Python library are the following:
* 3.12
* 3.13

## Installing from PyPI

The pyAKI library can be installed from PyPI using various package managers.

**With pip**
```bash
pip install pyAKI
```

**With poetry**
```bash
poetry add pyAKI
```

## Installing from Source

The pyAKI library can be installed from source (GitHub).

**With pip**
```bash
pip install git+https://github.com/aidh-ms/pyAKI
```

**With poetry**
```bash
poetry add git+https://github.com/aidh-ms/pyAKI
```

## Dependencies

This library has the following dependencies:
* [Pandas](https://pandas.pydata.org/)
* [SciPy](https://scipy.org/)
* [Typer](https://typer.tiangolo.com/)
6 changes: 5 additions & 1 deletion docs/docs/getting_started/overview.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Package overview

Python package to detect AKI within time series data.


The goal of this package is to establish well tested, comprehensive functions for the detection of Acute Kidney Injury (AKI) in time series data, according to the Kidney Disease Improving Global Outcomes (KDIGO) Criteria, established in 2012 [^kdigo].
![](../img/kdigo_criteria.png)

# License

Expand All @@ -28,3 +30,5 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

[^kdigo]: Improving Global Outcomes (KDIGO) Acute Kidney Injury Work Group. KDIGO Clinical Practice Guideline for Acute Kidney Injury. Kidney inter., Suppl. 2012; 2: 1–138.
File renamed without changes
20 changes: 20 additions & 0 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# pyAKI

<p style="text-align:center;" markdown="1">
_A Python package to detect AKI within time series data._
[![Coverage Status](https://coveralls.io/repos/github/aidh-ms/pyAKI/badge.svg?branch=main)](https://coveralls.io/github/aidh-ms/pyAKI?branch=main)
</p>

---

**Source Code:** [https://github.com/aidh-ms/pyAKI](https://github.com/aidh-ms/pyAKI)
**Paper:** [https://doi.org/10.1371/journal.pone.0315325](https://doi.org/10.1371/journal.pone.0315325)

---

The goal of this package is to establish well tested, comprehensive functions for the detection of Acute Kidney Injury (AKI) in time series data, according to the Kidney Disease Improving Global Outcomes (KDIGO) Criteria, established in 2012 [^kdigo].
![](img/kdigo_criteria.png)



[^kdigo]: Improving Global Outcomes (KDIGO) Acute Kidney Injury Work Group. KDIGO Clinical Practice Guideline for Acute Kidney Injury. Kidney inter., Suppl. 2012; 2: 1–138.
11 changes: 7 additions & 4 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ nav:
- Package Overview: 'getting_started/overview.md'
- Installation: 'getting_started/installation.md'
- Basic Usage: 'getting_started/basic_usage.md'
- Contributing: 'getting_started/contributing.md'
- Citing: 'getting_started/citing.md'
- User Guide:
- Tutorial: 'guide/tutorial.md'
Expand All @@ -27,10 +28,12 @@ extra:
copyright: Copyright &copy; 2023 AIDH-MS

markdown_extensions:
- attr_list
- pymdownx.highlight:
linenums: true
- pymdownx.superfences
- attr_list
- pymdownx.highlight:
linenums: true
- pymdownx.superfences
- pymdownx.extra
- footnotes

plugins:
- search:
Expand Down
Loading