Skip to content

Commit

Permalink
123 fix dpi computation (#124)
Browse files Browse the repository at this point in the history
* fix

* update version to 1.1.1
  • Loading branch information
akanz1 authored Jul 27, 2023
1 parent d8c0231 commit 374f03c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/klib-plots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"output_type": "stream",
"text": [
"2.0.3\n",
"1.0.7\n",
"1.1.0\n",
"5.15.0\n"
]
}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "klib"
version = "1.1.0"
version = "1.1.1"
description = "Customized data preprocessing functions for frequent tasks."
authors = ["Andreas Kanz <andreas@akanz.de>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src/klib/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Current version of klib."""

__version__ = "1.1.0"
__version__ = "1.1.1"
11 changes: 5 additions & 6 deletions src/klib/describe.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def corr_interactive_plot(
),
)

dpi = 96 # more or less arbitrary default value
dpi = None
for monitor in get_monitors():
if monitor.is_primary:
if monitor.width_mm is None or monitor.height_mm is None:
Expand All @@ -623,12 +623,11 @@ def corr_interactive_plot(
break

if dpi is None:
try:
monitor = get_monitors()[0]
monitor = get_monitors()[0]
if monitor.width_mm is None or monitor.height_mm is None:
dpi = 96 # more or less arbitrary default value
else:
dpi = monitor.width / (monitor.width_mm / 25.4)
except ValueError as exc:
msg = "Monitor doesn't exist"
raise LookupError(msg) from exc

heatmap.update_layout(
title=f"Feature-correlation ({method})",
Expand Down

0 comments on commit 374f03c

Please sign in to comment.