Skip to content

Commit d3861d8

Browse files
authored
some lint fixes on compressible/ (#125)
1 parent 465da89 commit d3861d8

File tree

5 files changed

+84
-86
lines changed

5 files changed

+84
-86
lines changed

pyro/compressible/BC.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import numpy as np
1616

17-
import pyro.compressible.eos as eos
17+
from pyro.compressible import eos
1818
from pyro.util import msg
1919

2020

@@ -211,7 +211,7 @@ def user(bc_name, bc_edge, variable, ccdata):
211211
v[:, :] = 0.0 # no source term
212212

213213
else:
214-
msg.fail("error: bc type %s not supported" % (bc_name))
214+
msg.fail(f"error: bc type {bc_name} not supported")
215215

216216

217217
def inflow_post_bc(var, g):

pyro/compressible/derives.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import numpy as np
22

3-
import pyro.compressible.eos as eos
3+
from pyro.compressible import eos
44

55

66
def derive_primitives(myd, varnames):
@@ -52,5 +52,5 @@ def derive_primitives(myd, varnames):
5252

5353
if len(derived_vars) > 1:
5454
return derived_vars
55-
else:
56-
return derived_vars[0]
55+
56+
return derived_vars[0]

pyro/compressible/eos.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55

66

7-
def pres(gamma, dens, eint):
7+
def pres(gamma, rho, eint):
88
"""
99
Given the density and the specific internal energy, return the
1010
pressure
@@ -13,7 +13,7 @@ def pres(gamma, dens, eint):
1313
----------
1414
gamma : float
1515
The ratio of specific heats
16-
dens : float
16+
rho : float
1717
The density
1818
eint : float
1919
The specific internal energy
@@ -24,11 +24,11 @@ def pres(gamma, dens, eint):
2424
The pressure
2525
2626
"""
27-
p = dens*eint*(gamma - 1.0)
27+
p = rho * eint * (gamma - 1.0)
2828
return p
2929

3030

31-
def dens(gamma, pres, eint):
31+
def dens(gamma, p, eint):
3232
"""
3333
Given the pressure and the specific internal energy, return
3434
the density
@@ -37,7 +37,7 @@ def dens(gamma, pres, eint):
3737
----------
3838
gamma : float
3939
The ratio of specific heats
40-
pres : float
40+
p : float
4141
The pressure
4242
eint : float
4343
The specific internal energy
@@ -48,19 +48,19 @@ def dens(gamma, pres, eint):
4848
The density
4949
5050
"""
51-
dens = pres/(eint*(gamma - 1.0))
52-
return dens
51+
rho = p / (eint * (gamma - 1.0))
52+
return rho
5353

5454

55-
def rhoe(gamma, pres):
55+
def rhoe(gamma, p):
5656
"""
5757
Given the pressure, return (rho * e)
5858
5959
Parameters
6060
----------
6161
gamma : float
6262
The ratio of specific heats
63-
pres : float
63+
p : float
6464
The pressure
6565
6666
Returns
@@ -69,5 +69,4 @@ def rhoe(gamma, pres):
6969
The internal energy density, rho e
7070
7171
"""
72-
rhoe = pres/(gamma - 1.0)
73-
return rhoe
72+
return p / (gamma - 1.0)

0 commit comments

Comments
 (0)