Skip to content

Commit

Permalink
Remove use of hasattr
Browse files Browse the repository at this point in the history
  • Loading branch information
rayosborn committed Feb 22, 2022
1 parent edfd4cf commit 1d2686b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nexusformat/nexus/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ def plot(self, data_group, fmt=None, xmin=None, xmax=None,
fmt = kwargs.pop('marker')
else:
fmt = 'o'
if hasattr(signal, 'units'):
if not errors and signal.units == 'counts':
if 'units' in signal.attrs:
if not errors and signal.attrs['units'] == 'counts':
errors = NXfield(np.sqrt(data))
if errors:
ebars = errors.nxdata
Expand Down

0 comments on commit 1d2686b

Please sign in to comment.