Skip to content

Commit

Permalink
Remove deprecated functions and clean up modules
Browse files Browse the repository at this point in the history
  • Loading branch information
simbli committed Nov 2, 2023
1 parent 5a78312 commit 21bb427
Show file tree
Hide file tree
Showing 18 changed files with 409 additions and 610 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,5 @@ todo.txt
data/db/
data/shapefiles/
data/vessels.csv
reports/
output/
.vscode/
3 changes: 0 additions & 3 deletions seacharts/display/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
from .display import Display

# __all__ is used when you do from seacharts.display import *, to determine which modules that are loaded
#__all__ = ["colors", "display", "events", "features"]
12 changes: 6 additions & 6 deletions seacharts/display/colors.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import matplotlib.colors as clr
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.axes import Axes
from matplotlib.cm import ScalarMappable
from matplotlib.colorbar import Colorbar


def _blues(bins=9):
# noinspection PyUnresolvedReferences
def _blues(bins: int = 9) -> np.ndarray:
return plt.get_cmap("Blues")(np.linspace(0.6, 1.0, bins))


def _greens(bins=9):
# noinspection PyUnresolvedReferences
def _greens(bins: int = 9) -> np.ndarray:
return plt.get_cmap("Greens")(np.linspace(0.3, 0.9, bins))


Expand Down Expand Up @@ -51,7 +51,7 @@ def _greens(bins=9):
)


def color_picker(name, bins=None):
def color_picker(name: str, bins: int = None) -> tuple:
if isinstance(name, int):
return _blues(bins)[name]
elif name in _ship_colors:
Expand All @@ -66,7 +66,7 @@ def color_picker(name, bins=None):
raise ValueError(f"{name} is not a valid color")


def colorbar(axes, depths):
def colorbar(axes: Axes, depths: list[int]) -> Colorbar:
depths = list(depths)
ocean = list(_blues(len(depths)))
colors = [_layer_colors["shore"]] + ocean[:-1]
Expand Down
Loading

0 comments on commit 21bb427

Please sign in to comment.