Skip to content

Commit

Permalink
BugFix: Fix Brightness return
Browse files Browse the repository at this point in the history
  • Loading branch information
CSSFrancis committed Oct 7, 2024
1 parent e873dfc commit 48bb605
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rsciio/dm5/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,13 @@ def update_calibration(self, axis, name="", offset=0, scale=1, units="", **kwds)
self.image_data['Calibrations'].attrs.update({"DisplayCalibratedUnits": 1})



def brightness(self):
"""
Get the brightness of the image.
"""
try:
dict(self.image_data["Calibrations"]["Brightness"].attrs)
return dict(self.image_data["Calibrations"]["Brightness"].attrs)
except KeyError:
return {}

Check warning on line 398 in rsciio/dm5/_api.py

View check run for this annotation

Codecov / codecov/patch

rsciio/dm5/_api.py#L395-L398

Added lines #L395 - L398 were not covered by tests

Expand Down Expand Up @@ -586,7 +587,7 @@ def file_reader(filename, lazy=False, **kwds):
# in case blosc compression is used
# module needs to be imported to register plugin
import hdf5plugin # noqa: F401
except ImportError:
except ImportError: # pragma: no cover
pass

DM5_file = DM5(filename, mode='r')
Expand Down

0 comments on commit 48bb605

Please sign in to comment.