Skip to content

Commit

Permalink
switch to jpg for coverage plot
Browse files Browse the repository at this point in the history
  • Loading branch information
danellecline committed Aug 21, 2024
1 parent f928cc2 commit 34efa74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pbp/meta_gen/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def plot_daily_coverage(instrument_type: InstrumentType, df: pd.DataFrame, base_
:param base_dir: The base directory to store the plot
:param start: The start date of the recordings
:param end: The end date of the recordings
:return: The path to the plot file
"""
# Create a plot of the dataframe with the x-axis as the month, and the y-axis as the daily recording coverage,
# which is percent of the day covered by recordings
Expand All @@ -122,7 +123,7 @@ def plot_daily_coverage(instrument_type: InstrumentType, df: pd.DataFrame, base_
plot.set_title("Daily Coverage of icListen Recordings")
elif instrument_type == InstrumentType.SOUNDTRAP:
plot.set_title("Daily Coverage of SoundTrap Recordings")
plot_file = Path(base_dir) / f"soundtrap_coverage_{start:%Y%m%d}_{end:%Y%m%d}.png"
plot_file = Path(base_dir) / f"soundtrap_coverage_{start:%Y%m%d}_{end:%Y%m%d}.jpg"
dpi = 300
fig = plot.get_figure()
fig.set_size_inches(10, 5)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_meta_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_soundtrap_generator():
assert len(json_objects) == 5

# There should also be a coverage plot in the base json directory
coverage_plot = json_dir / "soundtrap_coverage_20230715_20230716.png"
coverage_plot = json_dir / "soundtrap_coverage_20230715_20230716.jpg"
assert coverage_plot.exists()

def test_iclisten_generator():
Expand Down Expand Up @@ -120,7 +120,7 @@ def test_iclisten_generator():
assert len(json_objects) == 145

# There should also be a coverage plot in the base json directory
coverage_plot = json_dir / "soundtrap_coverage_20230718_20230718.png"
coverage_plot = json_dir / "soundtrap_coverage_20230718_20230718.jpg"
assert coverage_plot.exists()


Expand Down Expand Up @@ -159,7 +159,7 @@ def test_nrs_generator():
assert len(json_objects) == 7

# There should also be a coverage plot in the base json directory
coverage_plot = json_dir / "soundtrap_coverage_20191024_20191024.png"
coverage_plot = json_dir / "soundtrap_coverage_20191024_20191024.jpg"
assert coverage_plot.exists()


Expand Down

0 comments on commit 34efa74

Please sign in to comment.