Skip to content

Commit

Permalink
MAINT: flake8 E275 fixes (#572)
Browse files Browse the repository at this point in the history
* flake8 E275 fixes

* removed parentheses
  • Loading branch information
itrharrison authored and rrjbca committed Sep 8, 2024
1 parent f415e2e commit 81f7eef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion skypy/pipeline/scripts/skypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ def main(args=None):
logger.exception(e)
raise SystemExit(2) from e

return(0)
return 0
14 changes: 7 additions & 7 deletions skypy/pipeline/tests/test_skypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_logging(capsys, tmp_path):
output_filename = str(tmp_path / 'logging.fits')
skypy.main([config_filename, output_filename])
out, err = capsys.readouterr()
assert(not err)
assert not err

# Run again with increased verbosity and capture log. Force an exception by
# not using the "--overwrite" flag when the output file already exists.
Expand All @@ -78,19 +78,19 @@ def test_logging(capsys, tmp_path):
# Check all jobs appear in the log
for job in list(config) + list(tables) + columns:
log_string = f"[INFO] skypy.pipeline: Generating {job}"
assert(log_string in err)
assert log_string in err

# Check all functions appear in the log
for f in functions:
log_string = f"[INFO] skypy.pipeline: Calling {f.function.__name__}"
assert(log_string in err)
assert log_string in err

# Check cosmology appears in the log
if cosmology:
assert("[INFO] skypy.pipeline: Setting cosmology" in err)
assert "[INFO] skypy.pipeline: Setting cosmology" in err

# Check writing output file is in the log
assert(f"[INFO] skypy: Writing {output_filename}" in err)
assert f"[INFO] skypy: Writing {output_filename}" in err

# Check error for existing output file is in the log
try:
Expand All @@ -100,10 +100,10 @@ def test_logging(capsys, tmp_path):
except ImportError:
# Fallback on old error message from astropy v4.x
error_string = f"[ERROR] skypy: File {output_filename!r} already exists."
assert(error_string in err)
assert error_string in err

# Run again with decreased verbosity and check the log is empty
with pytest.raises(SystemExit):
skypy.main([config_filename, output_filename, '-qq'])
out, err = capsys.readouterr()
assert(not err)
assert not err
2 changes: 1 addition & 1 deletion skypy/utils/photometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def mag_ab(wavelength, spectrum, filters, *, redshift=None, coefficients=None,
u = u.reshape(u.shape + (1,)*(nd_s+nd_f))
m = np.ascontiguousarray(m[n])
m += u*dm[n]
del(dm, n, u)
del dm, n, u

# combine spectra if asked to
if coefficients is not None:
Expand Down

0 comments on commit 81f7eef

Please sign in to comment.