py-pilecore 0.7.0__py3-none-any.whl → 0.7.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of py-pilecore might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py-pilecore
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary: Public python SDK for the CEMS PileCore web-API.
5
5
  License: MIT License
6
6
 
@@ -1,5 +1,5 @@
1
1
  pypilecore/__init__.py,sha256=oJvwYShj_7FyNVlUgQda4tTdYyLIi5H1asdiS_uYt9M,162
2
- pypilecore/_version.py,sha256=MCrXa9Xoh2jGlyzUGX0O346XcUwgg1UzXaK6GJAguWs,175
2
+ pypilecore/_version.py,sha256=lwhPyTTgYzs-cvOxSAquZ8lujNcRnmmZe1m2wWaWutg,175
3
3
  pypilecore/api.py,sha256=QwwHXR6HYtrF-gCHQWLvMHZnTxf5fjTlWI2cGfYSkUc,7165
4
4
  pypilecore/exceptions.py,sha256=-MZOfsxyHLCI0k1-wZFfVsMxc1lya5buuhLks5rxlCo,89
5
5
  pypilecore/plot_utils.py,sha256=rK5_067-4-x7LzZgt_t6ahcGrZInxNrqHqsy0RzCnq8,954
@@ -36,9 +36,9 @@ pypilecore/viewers/interactive_figures/__init__.py,sha256=u6fkLqDB35J2bdGvUewzRC
36
36
  pypilecore/viewers/interactive_figures/figure_cpt_group_results_versus_ptls.py,sha256=RzNOYQmP_yT8oYeIMW9aYNl7aAKU-uFQfygxP9AwDsU,6471
37
37
  pypilecore/viewers/interactive_figures/figure_cpt_results_plan_view.py,sha256=y1no2w0zN0yUpkNB_-WAFwQfa-IS70hJMhc-c0pOeMs,9268
38
38
  pypilecore/viewers/interactive_figures/figure_cpt_results_versus_ptls.py,sha256=6huCKcQ4bsBE-LNY-ZPa13IWuye0ENxPK4wT1dcCFRs,5964
39
- pypilecore/viewers/interactive_figures/utils.py,sha256=Wl5hNsTdgh6wPm_sVGg1bfKamHzGnVNpuepgOg-oOFY,1582
40
- py_pilecore-0.7.0.dist-info/LICENSE,sha256=3OCAZXffN0Bettjeya8uF_ZYegyvvCfH1WUt6CrHb_0,1061
41
- py_pilecore-0.7.0.dist-info/METADATA,sha256=aBHbPcfhifQUyeFmdyn5cg5C6H3ZSnCbe17THb9VBzI,5653
42
- py_pilecore-0.7.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
43
- py_pilecore-0.7.0.dist-info/top_level.txt,sha256=7BKIWZuSkbQtJ0ho5P1JvcaEbHzqADCcBuOduZmIaiI,11
44
- py_pilecore-0.7.0.dist-info/RECORD,,
39
+ pypilecore/viewers/interactive_figures/utils.py,sha256=B2X8hbbmJqjm8E2VrS2EoX5F1yQ5qOQnQUG_vbsseT8,1692
40
+ py_pilecore-0.7.1.dist-info/LICENSE,sha256=3OCAZXffN0Bettjeya8uF_ZYegyvvCfH1WUt6CrHb_0,1061
41
+ py_pilecore-0.7.1.dist-info/METADATA,sha256=_EToNm1nMkzfEYcHpOMioBk8Uc5IGfPWE3UPOOxpNXw,5653
42
+ py_pilecore-0.7.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
43
+ py_pilecore-0.7.1.dist-info/top_level.txt,sha256=7BKIWZuSkbQtJ0ho5P1JvcaEbHzqADCcBuOduZmIaiI,11
44
+ py_pilecore-0.7.1.dist-info/RECORD,,
pypilecore/_version.py CHANGED
@@ -4,4 +4,4 @@ try:
4
4
  __version__ = version("py-pilecore")
5
5
  # during CI
6
6
  except PackageNotFoundError:
7
- __version__ = "0.7.0"
7
+ __version__ = "0.7.1"
@@ -1,5 +1,6 @@
1
1
  from typing import Any
2
2
 
3
+ import numpy as np
3
4
  import plotly
4
5
 
5
6
 
@@ -19,14 +20,14 @@ def get_continuous_color(colorscale: Any, intermed: float) -> Any:
19
20
  colorscale = plotly.colors.make_colorscale(viridis_colors, scale=scale)
20
21
 
21
22
  :param colorscale: A plotly continuous colorscale defined with RGB string colors.
22
- :param intermed: value in the range [0, 1]
23
+ :param intermed: value in the range [0, 1]. If `intermed` is NaN, it returns the first color in the colorscale.
23
24
  :return: color in rgb string format
24
25
  :rtype: str
25
26
  """
26
27
  if len(colorscale) < 1:
27
28
  raise ValueError("colorscale must have at least one color")
28
29
 
29
- if intermed <= 0 or len(colorscale) == 1:
30
+ if intermed <= 0 or len(colorscale) == 1 or np.isnan(intermed):
30
31
  return colorscale[0][1]
31
32
  if intermed >= 1:
32
33
  return colorscale[-1][1]