Skip to content

Commit

Permalink
Merge pull request #171 from rayosborn/remove-hasattr
Browse files Browse the repository at this point in the history
Improve attribute checks
  • Loading branch information
rayosborn authored Mar 14, 2022
2 parents edfd4cf + 1d2686b commit f0406c7
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 f0406c7

Please sign in to comment.