hiveplotlib 0.28.0__tar.gz → 0.28.1__tar.gz

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.
Files changed (44) hide show
  1. {hiveplotlib-0.28.0/src/hiveplotlib.egg-info → hiveplotlib-0.28.1}/PKG-INFO +3 -32
  2. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/pyproject.toml +9 -4
  3. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/utils.py +2 -2
  4. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/viz/bokeh.py +28 -7
  5. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/viz/holoviews.py +3 -1
  6. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1/src/hiveplotlib.egg-info}/PKG-INFO +3 -32
  7. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib.egg-info/SOURCES.txt +0 -1
  8. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib.egg-info/requires.txt +1 -2
  9. hiveplotlib-0.28.0/setup.py +0 -8
  10. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/LICENSE +0 -0
  11. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/MANIFEST.in +0 -0
  12. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/README.md +0 -0
  13. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/setup.cfg +0 -0
  14. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/__init__.py +0 -0
  15. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/axis.py +0 -0
  16. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/converters.py +0 -0
  17. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/datasets/__init__.py +0 -0
  18. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/datasets/international_trade.py +0 -0
  19. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/datasets/toy_hive_plots.py +0 -0
  20. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/datasets/toy_p2cps.py +0 -0
  21. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/datasets/trade_data_harvard_growth_lab/international_exports_2019_8112.csv +0 -0
  22. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/datasets/trade_data_harvard_growth_lab/international_exports_metadata_2019_8112.json +0 -0
  23. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/edges.py +0 -0
  24. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/exceptions/__init__.py +0 -0
  25. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/exceptions/hive_plot.py +0 -0
  26. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/exceptions/node.py +0 -0
  27. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/graph_features/__init__.py +0 -0
  28. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/graph_features/networkx/__init__.py +0 -0
  29. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/graph_features/networkx/_helpers.py +0 -0
  30. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/graph_features/networkx/edge_metrics.py +0 -0
  31. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/graph_features/networkx/node_metrics.py +0 -0
  32. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/hiveplot.py +0 -0
  33. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/hiveplot_matrix.py +0 -0
  34. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/node.py +0 -0
  35. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/p2cp.py +0 -0
  36. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/viz/__init__.py +0 -0
  37. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/viz/base.py +0 -0
  38. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/viz/datashader.py +0 -0
  39. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/viz/hiveplot_matrix.py +0 -0
  40. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/viz/input_checks.py +0 -0
  41. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/viz/matplotlib.py +0 -0
  42. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib/viz/plotly.py +0 -0
  43. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib.egg-info/dependency_links.txt +0 -0
  44. {hiveplotlib-0.28.0 → hiveplotlib-0.28.1}/src/hiveplotlib.egg-info/top_level.txt +0 -0
@@ -1,37 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hiveplotlib
3
- Version: 0.28.0
3
+ Version: 0.28.1
4
4
  Summary: Visualize Network Data with Hive Plots
5
5
  Author-email: Gary Koplik <gary.koplik@gmail.com>
6
- License: Copyright (c) 2020 - 2026, Gary Koplik
7
- All rights reserved.
8
-
9
- Redistribution and use in source and binary forms, with or without modification,
10
- are permitted provided that the following conditions are met:
11
-
12
- Redistributions of source code must retain the above copyright notice,
13
- this list of conditions and the following disclaimer.
14
-
15
- Redistributions in binary form must reproduce the above copyright notice,
16
- this list of conditions and the following disclaimer in the documentation
17
- and/or other materials provided with the distribution.
18
-
19
- Neither the name of Gary Koplik nor the names of any contributors
20
- may be used to endorse or promote products derived from this software
21
- without specific prior written permission.
22
-
23
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
33
- THE POSSIBILITY OF SUCH DAMAGE.
34
-
6
+ License-Expression: BSD-3-Clause
35
7
  Project-URL: Documentation, https://hiveplotlib.readthedocs.io/stable/
36
8
  Project-URL: Source, https://gitlab.com/hiveplotlib/hiveplotlib
37
9
  Requires-Python: >=3.10
@@ -56,7 +28,6 @@ Requires-Dist: hiveplotlib[datashader]; extra == "dev"
56
28
  Requires-Dist: hiveplotlib[holoviews]; extra == "dev"
57
29
  Requires-Dist: hiveplotlib[networkx]; extra == "dev"
58
30
  Requires-Dist: hiveplotlib[plotly]; extra == "dev"
59
- Requires-Dist: holoviews>=1.15; extra == "dev"
60
31
  Requires-Dist: jupyter; extra == "dev"
61
32
  Requires-Dist: nx-parallel; extra == "dev"
62
33
  Requires-Dist: pybadges; extra == "dev"
@@ -83,7 +54,7 @@ Requires-Dist: memory_profiler; extra == "perf"
83
54
  Provides-Extra: plotly
84
55
  Requires-Dist: plotly; extra == "plotly"
85
56
  Provides-Extra: ruff
86
- Requires-Dist: ruff; extra == "ruff"
57
+ Requires-Dist: ruff==0.15.22; extra == "ruff"
87
58
  Provides-Extra: testing
88
59
  Requires-Dist: pytest; extra == "testing"
89
60
  Requires-Dist: pytest-cov; extra == "testing"
@@ -7,13 +7,14 @@ build-backend = "setuptools.build_meta"
7
7
  [project]
8
8
  name = "hiveplotlib"
9
9
  requires-python = ">=3.10"
10
- version = "0.28.0"
10
+ version = "0.28.1"
11
11
  authors = [
12
12
  {name="Gary Koplik", email="gary.koplik@gmail.com"}
13
13
  ]
14
14
  description = "Visualize Network Data with Hive Plots"
15
15
  readme = "README.md"
16
- license = {file = "LICENSE"}
16
+ license = "BSD-3-Clause"
17
+ license-files = ["LICENSE"]
17
18
  urls = {Documentation="https://hiveplotlib.readthedocs.io/stable/", Source="https://gitlab.com/hiveplotlib/hiveplotlib" }
18
19
 
19
20
 
@@ -46,7 +47,6 @@ dev = [
46
47
  "hiveplotlib[holoviews]",
47
48
  "hiveplotlib[networkx]",
48
49
  "hiveplotlib[plotly]",
49
- "holoviews>=1.15",
50
50
  "jupyter",
51
51
  "nx-parallel", # CI-testable networkx dispatch backend for `graph_metric_backend` tests
52
52
  "pybadges",
@@ -88,7 +88,7 @@ plotly = [
88
88
 
89
89
  # ruff code hygeine checks
90
90
  ruff = [
91
- "ruff",
91
+ "ruff==0.15.22", # pinned for the life of 0.28.x, ruff 0.16 expanded its default rules and formats markdown
92
92
  ]
93
93
 
94
94
  testing = [
@@ -105,6 +105,11 @@ ty = [
105
105
  "ty==0.0.20", # pinning for now, 0.0.21 would require non trivial type hint changes that affect the user
106
106
  ]
107
107
 
108
+ [tool.uv]
109
+ # scope `uv lock` and `uv audit` to python 3.11+. Python 3.10's resolution is stuck on versions with unfixable advisories
110
+ # (e.g. pillow 13 requires 3.11+), which would keep `uv_audit` red. Python 3.10 installs and CI tests are unaffected.
111
+ environments = ["python_version >= '3.11'"]
112
+
108
113
  [tool.setuptools.packages.find]
109
114
  where = ["src"]
110
115
  include = ["hiveplotlib*"]
@@ -14,7 +14,7 @@ try: # optional dependency
14
14
  _NUMBA_AVAILABLE = True
15
15
  except Exception: # pragma: no cover - numba is optional
16
16
  _NUMBA_AVAILABLE = False
17
- prange = range # type: ignore
17
+ prange = range
18
18
 
19
19
 
20
20
  def cartesian2polar(
@@ -222,7 +222,7 @@ if _NUMBA_AVAILABLE: # pragma: no cover - @njit bodies are invisible to Python
222
222
  total = n * (num_steps + 1)
223
223
  # allocate output based on input dtype (supports float32/float64)
224
224
  out = np.empty((total, 2), dtype=start_x.dtype)
225
- for i in prange(n): # type: ignore[misc]
225
+ for i in prange(n):
226
226
  base = i * (num_steps + 1)
227
227
  for k in range(num_steps):
228
228
  t = k / (num_steps - 1) if num_steps > 1 else 0.0
@@ -12,7 +12,7 @@ except ImportError as ie: # pragma: no cover
12
12
  raise ImportError(msg) from ie
13
13
 
14
14
  import warnings
15
- from typing import Any, Hashable, List, Literal, Optional, Union
15
+ from typing import Any, Hashable, List, Literal, Optional, Union, cast
16
16
 
17
17
  import numpy as np
18
18
  import pandas as pd
@@ -92,6 +92,25 @@ def _bokeh_fig_setup(
92
92
  return fig
93
93
 
94
94
 
95
+ def _bokeh_source_columns(df: pd.DataFrame) -> dict[Any, np.ndarray]:
96
+ """
97
+ Convert a dataframe to numpy columns for a ``bokeh`` ``ColumnDataSource``.
98
+
99
+ Passing the dataframe itself would hit the deprecated ``reset_index(inplace=True)`` call inside ``bokeh``.
100
+
101
+ :param df: dataframe to convert.
102
+ :return: dictionary of column names to numpy arrays, copied because ``bokeh`` requires writable arrays.
103
+ Timezone-aware datetimes become naive UTC, because ``bokeh`` warns on every value of the object arrays they
104
+ otherwise produce.
105
+ """
106
+ columns = {}
107
+ for name, column in df.items():
108
+ if pd.api.types.is_datetime64_any_dtype(column) and column.dt.tz is not None:
109
+ column = column.dt.tz_convert(None)
110
+ columns[name] = column.to_numpy(copy=True)
111
+ return columns
112
+
113
+
95
114
  def axes_viz(
96
115
  instance: Union[BaseHivePlot, HivePlot, P2CP],
97
116
  fig: Optional[figure] = None,
@@ -190,7 +209,7 @@ def axes_viz(
190
209
  df["y"] = to_plot[:, 1]
191
210
  # make sure names are always hover compatible
192
211
  df, original_to_sanitized_map = __sanitize_dataframe_columns(df)
193
- data = ColumnDataSource(data=df)
212
+ data = ColumnDataSource(data=_bokeh_source_columns(df))
194
213
  line = fig.line(
195
214
  x=original_to_sanitized_map["x"],
196
215
  y=original_to_sanitized_map["y"],
@@ -394,7 +413,7 @@ def node_viz(
394
413
  scatter_outputs = []
395
414
  for axis in hive_plot.axes.values():
396
415
  df_to_plot = axis.node_placements.drop(columns=["rho"])
397
- to_plot = ColumnDataSource(df_to_plot)
416
+ to_plot = ColumnDataSource(data=_bokeh_source_columns(df_to_plot))
398
417
  if df_to_plot.shape[0] > 0:
399
418
  scatter = fig.scatter("x", "y", source=to_plot, **final_scatter_kwargs)
400
419
  scatter_outputs.append(scatter)
@@ -625,7 +644,7 @@ def edge_viz(
625
644
  # kill all legend labeling for initial rendering (if there is anything that plotted with labels)
626
645
  if fig.legend != []:
627
646
  for i in fig.legend.items:
628
- i.visible = False # ty:ignore[invalid-assignment]
647
+ i.visible = False
629
648
 
630
649
  return fig
631
650
 
@@ -938,7 +957,7 @@ def p2cp_legend(
938
957
  """
939
958
  # kill all legend labeling before rebuilding legend
940
959
  for i in fig.legend.items:
941
- i.visible = False # ty:ignore[invalid-assignment]
960
+ i.visible = False
942
961
 
943
962
  # need to convert tags to strings, as we needed to coax to strings to make them legend values with bokeh
944
963
  tags = (
@@ -948,8 +967,10 @@ def p2cp_legend(
948
967
  )
949
968
 
950
969
  for i in fig.legend.items:
951
- if str(i.label["value"]) in tags: # ty:ignore[unresolved-attribute]
952
- i.visible = True # ty:ignore[invalid-assignment]
970
+ # legend items built from `legend_label` always hold a `{"value": <label>}` dict
971
+ label = cast("dict", i.label)
972
+ if str(label["value"]) in tags:
973
+ i.visible = True
953
974
 
954
975
  fig.legend.title = title
955
976
 
@@ -253,7 +253,9 @@ def axes_viz(
253
253
  segments_kwargs["tools"] = [hover_tool]
254
254
 
255
255
  # fill NaN values with "N/A" string for hover tooltips
256
- axis_info = axis_info.fillna("N/A")
256
+ # (cast to object first, pandas deprecated silently upcasting numeric columns to fit a string fill value)
257
+ na_columns = axis_info.columns[axis_info.isna().any()]
258
+ axis_info = axis_info.astype(dict.fromkeys(na_columns, object)).fillna("N/A")
257
259
  axis_fig = hv.Segments(
258
260
  axis_info,
259
261
  kdims=[original_to_sanitized_map[i] for i in ["x_0", "y_0", "x_1", "y_1"]],
@@ -1,37 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hiveplotlib
3
- Version: 0.28.0
3
+ Version: 0.28.1
4
4
  Summary: Visualize Network Data with Hive Plots
5
5
  Author-email: Gary Koplik <gary.koplik@gmail.com>
6
- License: Copyright (c) 2020 - 2026, Gary Koplik
7
- All rights reserved.
8
-
9
- Redistribution and use in source and binary forms, with or without modification,
10
- are permitted provided that the following conditions are met:
11
-
12
- Redistributions of source code must retain the above copyright notice,
13
- this list of conditions and the following disclaimer.
14
-
15
- Redistributions in binary form must reproduce the above copyright notice,
16
- this list of conditions and the following disclaimer in the documentation
17
- and/or other materials provided with the distribution.
18
-
19
- Neither the name of Gary Koplik nor the names of any contributors
20
- may be used to endorse or promote products derived from this software
21
- without specific prior written permission.
22
-
23
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
33
- THE POSSIBILITY OF SUCH DAMAGE.
34
-
6
+ License-Expression: BSD-3-Clause
35
7
  Project-URL: Documentation, https://hiveplotlib.readthedocs.io/stable/
36
8
  Project-URL: Source, https://gitlab.com/hiveplotlib/hiveplotlib
37
9
  Requires-Python: >=3.10
@@ -56,7 +28,6 @@ Requires-Dist: hiveplotlib[datashader]; extra == "dev"
56
28
  Requires-Dist: hiveplotlib[holoviews]; extra == "dev"
57
29
  Requires-Dist: hiveplotlib[networkx]; extra == "dev"
58
30
  Requires-Dist: hiveplotlib[plotly]; extra == "dev"
59
- Requires-Dist: holoviews>=1.15; extra == "dev"
60
31
  Requires-Dist: jupyter; extra == "dev"
61
32
  Requires-Dist: nx-parallel; extra == "dev"
62
33
  Requires-Dist: pybadges; extra == "dev"
@@ -83,7 +54,7 @@ Requires-Dist: memory_profiler; extra == "perf"
83
54
  Provides-Extra: plotly
84
55
  Requires-Dist: plotly; extra == "plotly"
85
56
  Provides-Extra: ruff
86
- Requires-Dist: ruff; extra == "ruff"
57
+ Requires-Dist: ruff==0.15.22; extra == "ruff"
87
58
  Provides-Extra: testing
88
59
  Requires-Dist: pytest; extra == "testing"
89
60
  Requires-Dist: pytest-cov; extra == "testing"
@@ -2,7 +2,6 @@ LICENSE
2
2
  MANIFEST.in
3
3
  README.md
4
4
  pyproject.toml
5
- setup.py
6
5
  src/hiveplotlib/__init__.py
7
6
  src/hiveplotlib/axis.py
8
7
  src/hiveplotlib/converters.py
@@ -20,7 +20,6 @@ hiveplotlib[datashader]
20
20
  hiveplotlib[holoviews]
21
21
  hiveplotlib[networkx]
22
22
  hiveplotlib[plotly]
23
- holoviews>=1.15
24
23
  jupyter
25
24
  nx-parallel
26
25
  pybadges
@@ -53,7 +52,7 @@ memory_profiler
53
52
  plotly
54
53
 
55
54
  [ruff]
56
- ruff
55
+ ruff==0.15.22
57
56
 
58
57
  [testing]
59
58
  pytest
@@ -1,8 +0,0 @@
1
- """
2
- Setup.
3
- """
4
-
5
- import setuptools
6
-
7
- if __name__ == "__main__":
8
- setuptools.setup()
File without changes
File without changes
File without changes
File without changes