Skip to content

Commit

Permalink
Clean up formatting and imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
erykoff committed Oct 13, 2024
1 parent 9ed4536 commit 398b8e0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 21 deletions.
5 changes: 1 addition & 4 deletions skyproj/_skyproj.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import warnings
import functools

import matplotlib.pyplot as plt

import numpy as np
import hpgeom as hpg

import mpl_toolkits.axisartist as axisartist
import mpl_toolkits.axisartist.angle_helper as angle_helper
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from matplotlib.cm import ScalarMappable
from matplotlib.colors import Normalize, LogNorm

from .skycrs import get_crs, PlateCarreeCRS, GnomonicCRS, proj, proj_inverse
from .skycrs import get_crs, GnomonicCRS, proj, proj_inverse
from .hpx_utils import healpix_pixels_range, hspmap_to_xy, hpxmap_to_xy, healpix_to_xy, healpix_bin
from .utils import wrap_values, _get_boundary_poly_xy, get_autoscale_vmin_vmax

Expand Down
5 changes: 0 additions & 5 deletions skyproj/mpl_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,22 +401,17 @@ def draw(self, renderer):
if not l.strip():
continue

override_ha = False
override_va = False

self._ref_angle = a
self.set_x(x)
self.set_y(y)
if ha == "":
self.set_ha(ha_default)
else:
self.set_ha(ha)
override_ha = True
if va == "":
self.set_va(va_default)
else:
self.set_va(va)
override_va = True
self.set_text(l)

# The following code is adapted from LabelBase.draw()
Expand Down
6 changes: 2 additions & 4 deletions skyproj/skyaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
import matplotlib.axes
from pyproj import Geod

from .skycrs import PlateCarreeCRS, proj, proj_inverse
from .skycrs import PlateCarreeCRS
from .utils import wrap_values
from .skygrid import SkyGridlines, SkyGridHelper
from .mpl_utils import ExtremeFinderWrapped, WrappedFormatterDMS, SkyTickLabels
from matplotlib.transforms import (
Affine2D, Bbox, IdentityTransform, ScaledTranslation)
from .mpl_utils import SkyTickLabels


__all__ = ["SkyAxes"]
Expand Down
1 change: 0 additions & 1 deletion skyproj/skycrs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import math
import numpy as np
import functools

from pyproj import CRS
from pyproj import Transformer
Expand Down
14 changes: 7 additions & 7 deletions skyproj/skygrid.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import functools
import numpy as np
import matplotlib.collections
from matplotlib.transforms import Bbox, Transform
from matplotlib.transforms import Bbox

from .skycrs import proj, proj_inverse
from .mpl_utils import ExtremeFinderWrapped, WrappedFormatterDMS
Expand Down Expand Up @@ -289,15 +289,15 @@ def get_grid_info(self, x1, y1, x2, y2):
if np.min(lat_values) < -89.0 and np.max(lat_values) > 89.0:
use_equatorial_labels = True

inverted = False
# inverted = False
if x1 < x2:
gi_side_map = {side: side for side in ['left', 'right']}
# gi_side_map = {side: side for side in ['left', 'right']}
min_x = x1
max_x = x2
else:
gi_side_map = {'left': 'right',
'right': 'left'}
inverted = True
# gi_side_map = {'left': 'right',
# 'right': 'left'}
# inverted = True
min_x = x2
max_x = x1

Expand All @@ -306,7 +306,7 @@ def get_grid_info(self, x1, y1, x2, y2):
("lat", lat_levs, lat_factor, lat_values, lat_lines),
]:
grid_info[lon_or_lat] = gi = {
"lines": [[l] for l in lines],
"lines": [[line] for line in lines],
"ticks": {"left": [], "right": [], "bottom": [], "top": []},
}
for (lx, ly), v, level in zip(lines, values, levs):
Expand Down

0 comments on commit 398b8e0

Please sign in to comment.