Skip to content

Commit 98ebfc1

Browse files
authored
run isort and setup an action (#112)
1 parent 396f6ba commit 98ebfc1

File tree

131 files changed

+358
-214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+358
-214
lines changed

.github/workflows/isort.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: isort
2+
3+
on:
4+
# Trigger the workflow on push or pull request,
5+
# but only for the main branch
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
isort:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Install Python 3.10
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.10'
24+
25+
- name: Cache pip
26+
uses: actions/cache@v3
27+
with:
28+
# this path is specific to Ubuntu
29+
path: ~/.cache/pip
30+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
31+
restore-keys: |
32+
${{ runner.os }}-pip-
33+
34+
- name: Install dependencies + isort
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install -r requirements.txt
38+
pip install isort
39+
40+
- name: Install pyro
41+
run: python setup.py install --user
42+
43+
- name: Validate
44+
run: isort -c .
45+

advection/problems/smooth.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import sys
2-
import mesh.patch as patch
2+
33
import numpy
4+
5+
import mesh.patch as patch
46
from util import msg
57

68

advection/problems/test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
23
import mesh.patch as patch
34

45

advection/problems/tophat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
23
import mesh.patch as patch
34
from util import msg
45

advection/simulation.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import importlib
2-
import numpy as np
2+
33
import matplotlib
4+
import numpy as np
5+
46
try:
57
matplotlib.rcParams['mpl_toolkits.legacy_colorbar'] = False
68
except KeyError:
@@ -9,9 +11,9 @@
911

1012
import advection.advective_fluxes as flx
1113
import mesh.patch as patch
12-
from simulation_null import NullSimulation, grid_setup, bc_setup
1314
import particles.particles as particles
1415
import util.plot_tools as plot_tools
16+
from simulation_null import NullSimulation, bc_setup, grid_setup
1517

1618

1719
class Simulation(NullSimulation):

advection/tests/convergence_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import numpy as np
21
import matplotlib.pyplot as plt
2+
import numpy as np
33

44

55
def plot_convergence():

advection/tests/test_advection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from util import runparams
21
import advection.simulation as sn
2+
from util import runparams
33

44

55
class TestSimulation(object):

advection_fv4/problems/smooth.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import mesh.fv as fv
21
import numpy
2+
3+
import mesh.fv as fv
34
from util import msg
45

56

advection_fv4/simulation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import importlib
2-
import advection_rk
2+
33
import advection_fv4.fluxes as flx
4+
import advection_rk
45
import mesh.array_indexer as ai
56
import mesh.fv as fv
6-
from simulation_null import grid_setup, bc_setup
77
import particles.particles as particles
8+
from simulation_null import bc_setup, grid_setup
89

910

1011
class Simulation(advection_rk.Simulation):

advection_fv4/tests/convergence_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import numpy as np
21
import matplotlib.pyplot as plt
2+
import numpy as np
33

44

55
def plot_convergence():

0 commit comments

Comments
 (0)