Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Python Code Quality

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
code-quality-checks:
# Use the latest stable Ubuntu runner
runs-on: ubuntu-latest

steps:
# Step 1: Check out the repository's code
- name: Check out repository
uses: actions/checkout@v4

# Step 2: Set up a specific Python environment for consistency
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

# Step 3: Install linting and formatting tools
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black ruff

# Step 4: Check if code is formatted with Black
- name: Check formatting with Black
run: black --check .

# Step 5: Run Ruff to find potential errors
- name: Lint with Ruff
run: ruff check .
6 changes: 3 additions & 3 deletions notebooks/01_simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
"metadata": {},
"outputs": [],
"source": [
"import os, sys\n",
"import os\n",
"import sys\n",
"sys.path.append(os.path.abspath(\"../src\"))\n",
"import pandas as pd\n",
"import numpy as np\n",
"import xarray as xr\n",
"import warnings\n",
"import matplotlib.pyplot as plt\n",
Expand Down Expand Up @@ -1583,7 +1583,7 @@
"sns.barplot(x=avg_resistance_by_country.values, y=avg_resistance_by_country.index, palette=\"viridis\")\n",
"plt.xlabel(\"Simulated Resistance Proportion\")\n",
"plt.ylabel(\"Country\")\n",
"plt.title(f\"Simulated Insecticide Resistance by Country\")\n",
"plt.title(\"Simulated Insecticide Resistance by Country\")\n",
"plt.tight_layout()\n",
"plt.show()"
]
Expand Down
7 changes: 3 additions & 4 deletions notebooks/02_mixed_effects_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,14 @@
"metadata": {},
"outputs": [],
"source": [
"import os, sys\n",
"import os\n",
"import sys\n",
"sys.path.append(os.path.abspath(\"../src\"))\n",
"import pandas as pd\n",
"import numpy as np\n",
"import xarray as xr\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"import warnings\n",
"from sklearn.metrics import roc_curve, roc_auc_score\n",
"from sklearn.metrics import roc_curve\n",
"\n",
"# Import our custom classes\n",
"from data.simulation import ResistanceSimulator\n",
Expand Down
Loading