Skip to content

Commit

Permalink
Removes usages of reltol argument if it's not changed from 1 which is…
Browse files Browse the repository at this point in the history
… default

Signed-off-by: Damian Kula <dkula@unistra.fr>
  • Loading branch information
heavelock committed Jul 10, 2020
1 parent cd19f3a commit 62dc623
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 28 deletions.
5 changes: 1 addition & 4 deletions obspy/core/tests/test_channel.py
Expand Up @@ -41,13 +41,10 @@ def test_response_plot(self):
"""
Tests the response plot.
"""
reltol = 1.0

cha = read_inventory()[0][0][0]
with warnings.catch_warnings(record=True):
warnings.simplefilter("ignore")
with ImageComparison(self.image_dir, "channel_response.png",
reltol=reltol) as ic:
with ImageComparison(self.image_dir, "channel_response.png") as ic:
rcParams['savefig.dpi'] = 72
cha.plot(0.005, outfile=ic.name)

Expand Down
6 changes: 2 additions & 4 deletions obspy/core/tests/test_inventory.py
Expand Up @@ -179,14 +179,12 @@ def test_response_plot(self):
"""
Tests the response plot.
"""
reltol = 1.0

inv = read_inventory()
t = UTCDateTime(2008, 7, 1)
with warnings.catch_warnings(record=True):
warnings.simplefilter("ignore")
with ImageComparison(self.image_dir, "inventory_response.png",
reltol=reltol) as ic:
with ImageComparison(self.image_dir,
"inventory_response.png") as ic:
rcParams['savefig.dpi'] = 72
inv.plot_response(0.01, output="ACC", channel="*N",
station="[WR]*", time=t, outfile=ic.name)
Expand Down
5 changes: 1 addition & 4 deletions obspy/core/tests/test_network.py
Expand Up @@ -126,14 +126,11 @@ def test_response_plot(self):
"""
Tests the response plot.
"""
reltol = 1.0

net = read_inventory()[0]
t = UTCDateTime(2008, 7, 1)
with warnings.catch_warnings(record=True):
warnings.simplefilter("ignore")
with ImageComparison(self.image_dir, "network_response.png",
reltol=reltol) as ic:
with ImageComparison(self.image_dir, "network_response.png") as ic:
rcParams['savefig.dpi'] = 72
net.plot_response(0.002, output="DISP", channel="B*E",
time=t, outfile=ic.name)
Expand Down
11 changes: 3 additions & 8 deletions obspy/core/tests/test_response.py
Expand Up @@ -125,13 +125,11 @@ def test_response_plot(self):
"""
Tests the response plot.
"""
reltol = 1.0

resp = read_inventory()[0][0][0].response
with warnings.catch_warnings(record=True):
warnings.simplefilter("ignore")
with ImageComparison(self.image_dir, "response_response.png",
reltol=reltol) as ic:
with ImageComparison(self.image_dir,
"response_response.png") as ic:
rcParams['savefig.dpi'] = 72
resp.plot(0.001, output="VEL", start_stage=1, end_stage=3,
outfile=ic.name)
Expand All @@ -140,14 +138,11 @@ def test_response_plot_degrees(self):
"""
Tests the response plot in degrees.
"""
reltol = 1.0

resp = read_inventory()[0][0][0].response
with warnings.catch_warnings(record=True):
warnings.simplefilter("ignore")
with ImageComparison(self.image_dir,
"response_response_degrees.png",
reltol=reltol) as ic:
"response_response_degrees.png") as ic:
rcParams['savefig.dpi'] = 72
resp.plot(0.001, output="VEL", start_stage=1, end_stage=3,
plot_degrees=True, outfile=ic.name)
Expand Down
10 changes: 2 additions & 8 deletions obspy/core/tests/test_station.py
Expand Up @@ -36,28 +36,22 @@ def test_response_plot(self):
"""
Tests the response plot.
"""
reltol = 1.0

sta = read_inventory()[0][0]
with warnings.catch_warnings(record=True):
warnings.simplefilter("ignore")
with ImageComparison(self.image_dir, "station_response.png",
reltol=reltol) as ic:
with ImageComparison(self.image_dir, "station_response.png") as ic:
rcParams['savefig.dpi'] = 72
sta.plot(0.05, channel="*[NE]", outfile=ic.name)

def test_response_plot_degrees(self):
"""
Tests the response plot.
"""
reltol = 1.0

sta = read_inventory()[0][0]
with warnings.catch_warnings(record=True):
warnings.simplefilter("ignore")
with ImageComparison(self.image_dir,
"station_response_degrees.png",
reltol=reltol) as ic:
"station_response_degrees.png") as ic:
rcParams['savefig.dpi'] = 72
sta.plot(0.05, channel="*[NE]", plot_degrees=True,
outfile=ic.name)
Expand Down

0 comments on commit 62dc623

Please sign in to comment.