Skip to content

Commit

Permalink
Fix weird quotation marks from Black auto-formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
svank committed Dec 30, 2022
1 parent aa23eb1 commit 5f47be5
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion reproject/healpix/high_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,5 @@ def reproject_to_healpix(
)
else:
raise NotImplementedError(
"Only data with a 2-d celestial WCS can be " "reprojected to a HEALPIX projection"
"Only data with a 2-d celestial WCS can be reprojected to a HEALPIX projection"
)
2 changes: 1 addition & 1 deletion reproject/healpix/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ def test_parse_input_healpix_data(tmpdir):
with pytest.raises(TypeError) as exc:
parse_input_healpix_data(data)
assert exc.value.args[0] == (
"input_data should either be an HDU object or " "a tuple of (array, frame)"
"input_data should either be an HDU object or a tuple of (array, frame)"
)
16 changes: 8 additions & 8 deletions reproject/interpolation/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def test_celestial_mismatch_2d(roundtrip_coords):
wcs2 = WCS(header_out)

with pytest.raises(
ValueError, match="Input WCS has celestial components but output WCS " "does not"
ValueError, match="Input WCS has celestial components but output WCS does not"
):
array_out, footprint_out = reproject_interp(
(data, wcs1), wcs2, shape_out=(2, 2), roundtrip_coords=roundtrip_coords
Expand Down Expand Up @@ -255,14 +255,14 @@ def test_celestial_mismatch_3d(roundtrip_coords):
wcs2 = WCS(header_out)

with pytest.raises(
ValueError, match="Input WCS has celestial components but output WCS " "does not"
ValueError, match="Input WCS has celestial components but output WCS does not"
):
array_out, footprint_out = reproject_interp(
(data, wcs1), wcs2, shape_out=(1, 2, 3), roundtrip_coords=roundtrip_coords
)

with pytest.raises(
ValueError, match="Output WCS has celestial components but input WCS " "does not"
ValueError, match="Output WCS has celestial components but input WCS does not"
):
array_out, footprint_out = reproject_interp(
(data, wcs2), wcs1, shape_out=(1, 2, 3), roundtrip_coords=roundtrip_coords
Expand Down Expand Up @@ -301,14 +301,14 @@ def test_spectral_mismatch_3d(roundtrip_coords):
wcs2 = WCS(header_out)

with pytest.raises(
ValueError, match="Input WCS has a spectral component but output WCS " "does not"
ValueError, match="Input WCS has a spectral component but output WCS does not"
):
array_out, footprint_out = reproject_interp(
(data, wcs1), wcs2, shape_out=(1, 2, 3), roundtrip_coords=roundtrip_coords
)

with pytest.raises(
ValueError, match="Output WCS has a spectral component but input WCS " "does not"
ValueError, match="Output WCS has a spectral component but input WCS does not"
):
array_out, footprint_out = reproject_interp(
(data, wcs2), wcs1, shape_out=(1, 2, 3), roundtrip_coords=roundtrip_coords
Expand All @@ -326,7 +326,7 @@ def test_naxis_mismatch(roundtrip_coords):
wcs_out = WCS(naxis=2)

with pytest.raises(
ValueError, match="Number of dimensions between input and output WCS " "should match"
ValueError, match="Number of dimensions between input and output WCS should match"
):
array_out, footprint_out = reproject_interp(
(data, wcs_in), wcs_out, shape_out=(1, 2), roundtrip_coords=roundtrip_coords
Expand Down Expand Up @@ -398,7 +398,7 @@ def test_4d_fails(roundtrip_coords):
array_in = np.zeros((2, 3, 4, 5))

with pytest.raises(
ValueError, match="Length of shape_out should match number of dimensions " "in wcs_out"
ValueError, match="Length of shape_out should match number of dimensions in wcs_out"
):
x_out, y_out, z_out = reproject_interp(
(array_in, w_in), w_out, shape_out=[2, 4, 5, 6], roundtrip_coords=roundtrip_coords
Expand All @@ -421,7 +421,7 @@ def test_inequal_wcs_dims(roundtrip_coords):
wcs_out = WCS(header_out)

with pytest.raises(
ValueError, match="Output WCS has a spectral component but input WCS " "does not"
ValueError, match="Output WCS has a spectral component but input WCS does not"
):
out_cube, out_cube_valid = reproject_interp(
(inp_cube, header_in), wcs_out, shape_out=(2, 4, 5), roundtrip_coords=roundtrip_coords
Expand Down
4 changes: 2 additions & 2 deletions reproject/mosaicking/coadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def reproject_and_coadd(

if reproject_function is None:
raise ValueError(
"reprojection function should be specified with " "the reproject_function argument"
"reprojection function should be specified with the reproject_function argument"
)

# Parse the output projection to avoid having to do it for each
Expand Down Expand Up @@ -234,6 +234,6 @@ def reproject_and_coadd(
# Here we need to operate in chunks since we could otherwise run
# into memory issues

raise NotImplementedError("combine_function='median' is " "not yet implemented")
raise NotImplementedError("combine_function='median' is not yet implemented")

return final_array, final_footprint
2 changes: 1 addition & 1 deletion reproject/spherical_intersect/tests/test_high_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_reproject_precision_warning():

if res < 0.05 / 3600:
with pytest.warns(
UserWarning, match="The reproject_exact function " "currently has precision"
UserWarning, match="The reproject_exact function currently has precision"
):
reproject_exact((array, wcs1), wcs2, shape_out=(5, 5))
else:
Expand Down
10 changes: 5 additions & 5 deletions reproject/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_parse_input_data(tmpdir):
with pytest.raises(ValueError) as exc:
array, coordinate_system = parse_input_data(filename)
assert exc.value.args[0] == (
"More than one HDU is present, please specify " "HDU to use with ``hdu_in=`` option"
"More than one HDU is present, please specify HDU to use with ``hdu_in=`` option"
)

array, coordinate_system = parse_input_data(filename, hdu_in=1)
Expand All @@ -52,7 +52,7 @@ def test_parse_input_data(tmpdir):
with pytest.raises(TypeError) as exc:
parse_input_data(data)
assert exc.value.args[0] == (
"input_data should either be an HDU object or " "a tuple of (array, WCS) or (array, Header)"
"input_data should either be an HDU object or a tuple of (array, WCS) or (array, Header)"
)


Expand All @@ -78,7 +78,7 @@ def test_parse_input_shape(tmpdir):
with pytest.raises(ValueError) as exc:
shape, coordinate_system = parse_input_shape(filename)
assert exc.value.args[0] == (
"More than one HDU is present, please specify " "HDU to use with ``hdu_in=`` option"
"More than one HDU is present, please specify HDU to use with ``hdu_in=`` option"
)

shape, coordinate_system = parse_input_shape(filename, hdu_in=1)
Expand Down Expand Up @@ -125,7 +125,7 @@ def test_parse_output_projection(tmpdir):
with pytest.raises(ValueError) as exc:
parse_output_projection(header)
assert exc.value.args[0] == (
"Need to specify shape since output header " "does not contain complete shape information"
"Need to specify shape since output header does not contain complete shape information"
)

parse_output_projection(header, shape_out=(200, 200))
Expand All @@ -141,7 +141,7 @@ def test_parse_output_projection(tmpdir):
with pytest.raises(ValueError) as exc:
parse_output_projection(wcs)
assert exc.value.args[0] == (
"Need to specify shape_out when specifying " "output_projection as WCS object"
"Need to specify shape_out when specifying output_projection as WCS object"
)

parse_output_projection(wcs, shape_out=(200, 200))
8 changes: 3 additions & 5 deletions reproject/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def parse_output_projection(output_projection, shape_out=None, output_array=None
wcs_out = output_projection
if shape_out is None:
raise ValueError(
"Need to specify shape_out when specifying " "output_projection as WCS object"
"Need to specify shape_out when specifying output_projection as WCS object"
)
elif isinstance(output_projection, str):
hdu_list = fits.open(output_projection)
Expand All @@ -147,12 +147,10 @@ def parse_output_projection(output_projection, shape_out=None, output_array=None
wcs_out = WCS(header)
hdu_list.close()
else:
raise TypeError(
"output_projection should either be a Header, a WCS " "object, or a filename"
)
raise TypeError("output_projection should either be a Header, a WCS object, or a filename")

if len(shape_out) == 0:
raise ValueError("The shape of the output image should not be an " "empty tuple")
raise ValueError("The shape of the output image should not be an empty tuple")
return wcs_out, shape_out


Expand Down

0 comments on commit 5f47be5

Please sign in to comment.