Skip to content

Commit

Permalink
Merge pull request #20 from UTAustin-SwarmLab/adding_ci
Browse files Browse the repository at this point in the history
Added ci
  • Loading branch information
minkyu-choi07 authored Feb 8, 2024
2 parents 59bdb57 + 7a66496 commit e412160
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 8 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Ruff
on: [push, pull_request]

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Run Ruff with auto-fix
uses: chartboost/ruff-action@v1
with:
args: --fix # Automatically apply safe fixes
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'style fixes by ruff'
file_pattern: '*.py' # Ensure only Python files are committed
19 changes: 19 additions & 0 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Python Unit Tests
on: [push, pull_request]

jobs:
unit-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -e ."[dev, test]"
- name: Run Unit Tests
run: |
python -m unittest discover
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,8 @@ dmypy.json
*.jpg
*.jpeg
*.png

# don't ignore github workflow
!/.github/
!/.github/workflows/
!/.github/workflows/*.yml
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ dependencies = [
"numpy",
"pandas",
"seaborn",
"statannot"
"statannot",
"scipy"
]

[project.urls]
Expand Down
61 changes: 61 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]

# Same as Black.
line-length = 80
indent-width = 4

# Assume Python 3.9
target-version = "py39"

[lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E4", "E7", "E9", "F"]
ignore = []

# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[format]
# Like Black, use double quotes for strings.
quote-style = "double"

# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

[lint.pydocstyle]
convention = "google"
1 change: 0 additions & 1 deletion swarm_visualizer/barplot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import numpy as np
import seaborn as sns

from swarm_visualizer.utility.general_utils import set_axis_infos
Expand Down
2 changes: 0 additions & 2 deletions swarm_visualizer/lineplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def plot_overlaid_ts(
title_str: str = None,
ylabel: str = None,
xlabel: str = "time",
fontsize: float = 30,
xticks=None,
ylim=None,
DEFAULT_ALPHA: float = 1.0,
Expand All @@ -53,7 +52,6 @@ def plot_overlaid_ts(
:param title_str: title of the plot
:param ylabel: y-axis label
:param xlabel: x-axis label
:param fontsize: font size
:param xticks: x-axis ticks
:param ylim: y-axis limits
:param DEFAULT_ALPHA: default alpha value
Expand Down
1 change: 0 additions & 1 deletion swarm_visualizer/scatterplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def plot_scatter_pdf_plot(
ts_y=None,
title_str: str = None,
ylabel: str = None,
lw: float = 3.0,
ylim=None,
xlabel: str = "time",
xlim=None,
Expand Down
1 change: 0 additions & 1 deletion swarm_visualizer/utility/textfile_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import os
import pickle

import numpy as np
from scipy.ndimage import shift

"""
Expand Down
1 change: 0 additions & 1 deletion tests/test_lineplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def test_overlaid_ts_plot(normalized_ts_dict) -> None:
title_str="Overlaid Time Series Plot",
ylabel="$y$",
xlabel="$x$",
fontsize=30,
xticks=None,
ylim=None,
DEFAULT_ALPHA=1.0,
Expand Down
1 change: 0 additions & 1 deletion tests/test_scatterplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def test_scatter_pdf_plot(x_data, y_data) -> None:
ts_y=y_data,
title_str="Scatter Plot with CDFs",
ylabel="$y$",
lw=3.0,
ylim=None,
xlabel="$x$",
xlim=None,
Expand Down

0 comments on commit e412160

Please sign in to comment.