Skip to content

Commit

Permalink
Use succinct unit string.
Browse files Browse the repository at this point in the history
self.name is rather verbose
  • Loading branch information
tv3141 authored Apr 13, 2017
1 parent 904bc2a commit 05d1764
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cf_units/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1670,12 +1670,12 @@ def __str__(self):
For example:
>>> import cf_units
>>> u = cf_units.Unit('kg meter2 second-3')
>>> u = cf_units.Unit('miles/hour')
>>> str(u)
'W'
'miles/hour'
"""
return self.symbol
return self.origin or self.symbol

def __repr__(self):
"""
Expand Down

0 comments on commit 05d1764

Please sign in to comment.