Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

123 fix dpi computation #124

Merged
merged 2 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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