Skip to content

Commit

Permalink
Do not fail test_LongitudeFormatter_direction_label
Browse files Browse the repository at this point in the history
Fix linting errors

Do not fail test_LongitudeFormatter_direction_label
  • Loading branch information
gcaria committed Oct 31, 2020
1 parent 46af533 commit 844cf17
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/cartopy/mpl/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,17 @@ def __call__(self, value, pos=None):
def _format_value(self, value, original_value):

hemisphere = ''
sign = ''

if self._direction_labels:
hemisphere = self._hemisphere(value, original_value)
else:
if (value != 0 and
self._hemisphere(value, original_value) in ['W', 'S']):
sign = '-'

if not self._dms:
return (self._format_degrees(abs(value)) +
return (sign + self._format_degrees(abs(value)) +
hemisphere)

value, deg, mn, sec = self._get_dms(abs(value))
Expand Down

0 comments on commit 844cf17

Please sign in to comment.