Skip to content

Commit

Permalink
more pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
bhilbert4 committed Sep 28, 2023
1 parent a22b9cc commit 7c2cd66
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
4 changes: 2 additions & 2 deletions jwql/instrument_monitors/common_monitors/dark_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,8 @@ def overplot_bad_pix(self, pix_type, coords, values):

sources[pix_type] = ColumnDataSource(data=dict(pixels_x=coords[0],
pixels_y=coords[1]
)
)
)
)

# Overplot the bad pixel locations
badpixplots[pix_type] = self.plot.circle(x=f'pixels_x', y=f'pixels_y',
Expand Down
6 changes: 3 additions & 3 deletions jwql/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,11 +485,11 @@ def test_filesystem_path():

def test_save_png():
"""Test that we can create a png file"""
plot = figure(title='test',tools='')
image = np.zeros((200,200))
plot = figure(title='test', tools='')
image = np.zeros((200, 200))
image[100:105, 100:105] = 1
ny, nx = image.shape
mapper = LinearColorMapper(palette='Viridis256', low=0 ,high=1.1)
mapper = LinearColorMapper(palette='Viridis256', low=0, high=1.1)
imgplot = plot.image(image=[image], x=0, y=0, dw=nx, dh=ny, color_mapper=mapper, level="image")
save_png(plot, filename='test.png')

Expand Down
7 changes: 1 addition & 6 deletions jwql/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,8 @@ def create_png_from_fits(filename, outdir):
plot.yaxis.visible = False

# Save the plot in a png
<<<<<<< Updated upstream
output_filename = os.path.join(outdir, os.path.basename(filename).replace('fits','png'))
save_png(plot, filename=output_filename)
=======
output_filename = os.path.join(outdir, os.path.basename(filename).replace('fits', 'png'))
export_png(plot, filename=output_filename)
>>>>>>> Stashed changes
save_png(plot, filename=output_filename)
permissions.set_permissions(output_filename)
return output_filename
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ def get_trending_data(self, badpix_type):
# Query database for all data in the table with a matching detector and bad pixel type
all_entries_by_type = session.query(self.pixel_table.type, self.pixel_table.detector, func.array_length(self.pixel_table.x_coord, 1),
self.pixel_table.obs_mid_time) \
.filter(and_(self.pixel_table.detector == self.detector, self.pixel_table.type == badpix_type)) \
.all()
.filter(and_(self.pixel_table.detector == self.detector, self.pixel_table.type == badpix_type)) \
.all()

# Organize the results
num_pix = []
Expand Down Expand Up @@ -654,7 +654,7 @@ def create_plot(self):
string_time=string_times,
value=[self.badpix_type] * len(self.num_pix)
)
)
)

self.plot = figure(title=f'{self.detector}: New {self.badpix_type} Pixels', tools='pan,box_zoom,reset,wheel_zoom,save',
background_fill_color="#fafafa")
Expand Down

0 comments on commit 7c2cd66

Please sign in to comment.