iqplot 0.3.8__tar.gz → 0.3.9__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.
@@ -1,3 +1,4 @@
1
+ .ipynb_checkpoints/
1
2
  build/
2
3
  dist/
3
4
  iqplot.egg-info/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: iqplot
3
- Version: 0.3.8
3
+ Version: 0.3.9
4
4
  Summary: Generate Bokeh plots for data sets with one quantitative variable.
5
5
  Project-URL: Homepage, https://github.com/justinbois/iqplot
6
6
  Project-URL: Documentation, http://iqplot.github.io/
@@ -7,4 +7,4 @@ from .dist import *
7
7
 
8
8
  __author__ = """Justin Bois"""
9
9
  __email__ = "bois@caltech.edu"
10
- __version__ = "0.3.8"
10
+ __version__ = "0.3.9"
@@ -343,17 +343,17 @@ def strip(
343
343
  q_range = [p.y_range.start, p.y_range.end]
344
344
  else:
345
345
  if log_q:
346
- q_range_width = np.log10(data[q]).max() - np.log10(data[q]).min()
347
- q_range = [
348
- np.log10(data[q]).min() - 0.05 * q_range_width,
349
- np.log10(data[q]).max() + 0.05 * q_range_width,
350
- ]
346
+ q_min, q_max = np.log10(data[q]).min(), np.log10(data[q]).max()
351
347
  else:
352
- q_range_width = data[q].max() - data[q].min()
353
- q_range = [
354
- data[q].min() - 0.05 * q_range_width,
355
- data[q].max() + 0.05 * q_range_width,
356
- ]
348
+ q_min, q_max = data[q].min(), data[q].max()
349
+
350
+ q_range_width = q_max - q_min
351
+ if q_range_width == 0:
352
+ # Single unique value: any nonzero width works since all
353
+ # points are at the same pixel position.
354
+ q_range_width = 1.0
355
+
356
+ q_range = [q_min - 0.05 * q_range_width, q_max + 0.05 * q_range_width]
357
357
 
358
358
  swarm_transform = (
359
359
  grouped[q]
@@ -1716,6 +1716,11 @@ def _swarm_px(
1716
1716
  else:
1717
1717
  raise NotImplementedError("Custom `priority` not yet implemented.")
1718
1718
 
1719
+ if not np.isfinite(x_range).all() or x_range[1] == x_range[0]:
1720
+ raise RuntimeError(
1721
+ "Quantitative axis range is degenerate; cannot compute swarm."
1722
+ )
1723
+
1719
1724
  x_pixels = (x[inds] - x_range[0]) * frame_width / (x_range[1] - x_range[0])
1720
1725
  y_pixels = np.inf * np.ones_like(x_pixels)
1721
1726
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes