Skip to content

Commit

Permalink
Separate testing notebooks from source code (#20)
Browse files Browse the repository at this point in the history
# *Separate testing notebooks from source code*

## ♻️ Current situation & Problem
This pull request refactors the current project structure by separating
the testing notebooks from the source code. This refactoring aims to
streamline the repository by isolating the source code, enhancing
maintainability, and improving focus within the repository.


## ⚙️ Release Notes 
- Refactored project by moving notebooks out of the source code
repository to maintain a clean separation of concerns.
- Improved maintainability.


## 📝 Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
  • Loading branch information
Vicbi authored Jul 8, 2024
1 parent d73bbf5 commit acde1bb
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 591 deletions.
50 changes: 1 addition & 49 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,52 +66,4 @@ jobs:
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
slug: StanfordSpezi/SpeziDataPipelineTemplate
build_and_test_notebook:
name: Build and Test Notebook
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Setup NodeJS
uses: actions/setup-node@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: "microsoft"
java-version: "17"
- name: Update apt-get
run: sudo apt-get update
- name: Setup LaTex
run: |
sudo apt-get install -y --fix-missing pandoc texlive-xetex texlive-fonts-recommended texlive-plain-generic
- name: Cache Firebase Emulators
uses: actions/cache@v3
with:
path: ~/.cache/firebase/emulators
key: ${{ runner.os }}-${{ runner.arch }}-firebase-emulators-${{ hashFiles('~/.cache/firebase/emulators/**') }}
- name: Install Firebase CLI Tools
run: npm install -g firebase-tools
- name: Install Infrastructure
run: |
python -m pip install --upgrade pip
pip install jupyterlab
- name: Install SpeziDataPipelineTemplate and Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
- name: Set Firestore Emulator Environment Variable
run: |
echo "FIRESTORE_EMULATOR_HOST=localhost:8080" >> $GITHUB_ENV
echo "GCLOUD_PROJECT=spezidatapipelinetemplate" >> $GITHUB_ENV
- name: Run Firebase Emulator & Execute Notebook
run: |
firebase emulators:exec --import=./sample_data "jupyter nbconvert --to pdf --execute SpeziDataPipelineTemplate.ipynb"
env:
CI: true
- uses: actions/upload-artifact@v4
with:
name: SpeziDataPipelineTemplate.pdf
path: SpeziDataPipelineTemplate.pdf
slug: StanfordSpezi/SpeziDataPipeline
27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ SPDX-License-Identifier: MIT
-->

# Spezi Data Pipeline Template
# Spezi Data Pipeline

[![Build and Test](https://github.com/StanfordSpezi/SpeziDataPipelineTemplate/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/StanfordSpezi/SpeziDataPipelineTemplate/actions/workflows/build-and-test.yml)
[![codecov](https://codecov.io/gh/StanfordSpezi/SpeziDataPipelineTemplate/branch/main/graph/badge.svg)](https://codecov.io/gh/StanfordSpezi/SpeziDataPipelineTemplate)
<a target="_blank" href="https://colab.research.google.com/github/StanfordSpezi/SpeziDataPipelineTemplate/blob/main/SpeziDataPipelineTemplate.ipynb">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
</a>
[![Build and Test](https://github.com/StanfordSpezi/SpeziDataPipeline/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/StanfordSpezi/SpeziDataPipeline/actions/workflows/build-and-test.yml)
[![codecov](https://codecov.io/gh/StanfordSpezi/SpeziDataPipeline/branch/main/graph/badge.svg)](https://codecov.io/gh/StanfordSpezi/SpeziDataPipeline)

The Spezi Data Pipeline offers a comprehensive suite of tools designed to facilitate the management, analysis, and visualization of healthcare data from Firebase Firestore. By adhering to the Fast Healthcare Interoperability Resources (FHIR) standards, this platform ensures that data handling remains robust, standardized, and interoperable across different systems and software.

Expand All @@ -24,7 +21,7 @@ The Spezi Data Pipeline is engineered to improve workflows associated with data

## Package Structure

The SpeziDataPipelineTemplate is organized into several directories, each serving a specific function as part of the overall application. This guide will walk you through the package structure, highlighting the key components and their usage based on your needs and challenges.
The Spezi Data Pipeline is organized into several directories, each serving a specific function as part of the overall application. This guide will walk you through the package structure, highlighting the key components and their usage based on your needs and challenges.

1. `data_access/`

Expand Down Expand Up @@ -70,12 +67,12 @@ _DataExporter_


### How to Use Based on Your Needs
- **Downloading Data from Firestore**: Start with FirebaseFHIRAccess to connect and fetch data.
- **Converting and Structuring FHIR Data**: Use ResourceCreator and its subclasses to convert Firestore documents to FHIR resources.
- **Flattening Nested FHIR Data**: Utilize ResourceFlattener and its specific implementations to transform data into flat DataFrames.
- **Downloading Data from Firestore**: Start with `FirebaseFHIRAccess` to connect and fetch data.
- **Converting and Structuring FHIR Data**: Use `ResourceCreator` and its subclasses to convert Firestore documents to FHIR resources.
- **Flattening Nested FHIR Data**: Utilize `ResourceFlattener` and its specific implementations to transform data into flat `DataFrames`.
- **Processing Data**: Apply FHIRDataProcessor for filtering, selecting, and general data processing tasks.
- **Exploring and Visualizing Data**: Leverage DataExplorer and ECGExplorer to create visualizations and explore your data.
- **Exporting Data**: Use DataExporter to save processed data and plots.
- **Exploring and Visualizing Data**: Leverage `DataExplorer` and `ECGExplorer`, and `QuestionnaireResponseExplorer` to create visualizations and explore your data.
- **Exporting Data**: Use `DataExporter` to save processed data and plots.


## Dependencies
Expand Down Expand Up @@ -185,8 +182,8 @@ visualizer.set_date_range(selected_start_date, selected_end_date)
figs = visualizer.create_static_plot(processed_fhir_dataframe)
```

![daily_steps_data_plot.png](https://github.com/StanfordSpezi/SpeziDataPipelineTemplate/blob/main/Figures/daily_steps_data_plot.png)
![heart_rate_data_plot.png](https://github.com/StanfordSpezi/SpeziDataPipelineTemplate/blob/main/Figures/heart_rate_data_plot.png)
![daily_steps_data_plot.png](https://github.com/StanfordSpezi/SpeziDataPipeline/blob/main/Figures/daily_steps_data_plot.png)
![heart_rate_data_plot.png](https://github.com/StanfordSpezi/SpeziDataPipeline/blob/main/Figures/heart_rate_data_plot.png)

## ECG Observations

Expand All @@ -212,7 +209,7 @@ visualizer.set_date_range(selected_start_date, selected_end_date)
figs = visualizer.plot_ecg_subplots(processed_fhir_dataframe)
```

![ecg_data_plot.png](https://github.com/StanfordSpezi/SpeziDataPipelineTemplate/blob/main/Figures/ecg_data_plot.png)
![ecg_data_plot.png](https://github.com/StanfordSpezi/SpeziDataPipeline/blob/main/Figures/ecg_data_plot.png)


### Questionnaire Responses
Expand Down
264 changes: 0 additions & 264 deletions SpeziDataPipelineTemplate.ipynb

This file was deleted.

6 changes: 0 additions & 6 deletions SpeziDataPipelineTemplate.ipynb.license

This file was deleted.

Loading

0 comments on commit acde1bb

Please sign in to comment.