Skip to content

Commit

Permalink
COMPAT: explictly cast numpy floats to native floats (#163)
Browse files Browse the repository at this point in the history
* COMPAT: explictly cast numpy floats to native floats

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
martinfleis and pre-commit-ci[bot] authored Apr 3, 2024
1 parent 32cd619 commit 18ecd5d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion branca/colormap.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ def __init__(self, vmin=0.0, vmax=1.0, caption="", max_labels=10):
def render(self, **kwargs):
"""Renders the HTML representation of the element."""
self.color_domain = [
self.vmin + (self.vmax - self.vmin) * k / 499.0 for k in range(500)
float(self.vmin + (self.vmax - self.vmin) * k / 499.0) for k in range(500)
]
self.color_range = [self.__call__(x) for x in self.color_domain]

# sanitize possible numpy floats to native python floats
self.index = [float(i) for i in self.index]

if self.tick_labels is None:
self.tick_labels = legend_scaler(self.index, self.max_labels)

Expand Down

0 comments on commit 18ecd5d

Please sign in to comment.