8000 [maint, enh] Add experimental settings status to napari --info by psobolewskiPhD · Pull Request #7857 · napari/napari · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[maint, enh] Add experimental settings status to napari --info #7857

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

Merged
merged 4 commits into from
Apr 29, 2025
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
1 change: 1 addition & 0 deletions napari/settings/_experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def __init__(self, **data: dict[str, Any]):
"The 'pure python' backend uses the default Python triangulation from vispy.\n"
"The 'fastest available' backend will select the fastest available backend.\n"
),
env='napari_triangulation_backend',
)

compiled_triangulation: bool = Field(
Expand Down
23 changes: 20 additions & 3 deletions napari/utils/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,32 @@
except PackageNotFoundError:
text += f' - {name} not installed<br>'

text += '<br><b>Settings path:</b><br>'
try:
from napari.settings import get_settings

text += f' - {get_settings().config_path}'
_async_setting = str(get_settings().experimental.async_)
_autoswap_buffers = str(get_settings().experimental.autoswap_buffers)
_triangulation_backend = str(
get_settings().experimental.triangulation_backend
)
_config_path = get_settings().config_path
except ValueError:
from napari.utils._appdirs import user_config_dir

text += f' - {os.getenv("NAPARI_CONFIG", user_config_dir())}'
_async_setting = str(os.getenv('NAPARI_ASYNC', 'False'))
_autoswap_buffers = str(os.getenv('NAPARI_AUTOSWAP', 'False'))
_triangulation_backend = str(

Check warning on line 228 in napari/utils/info.py

View check run for this annotation

Codecov / codecov/patch

napari/utils/info.py#L226-L228

Added lines #L226 - L228 were not covered by tests
os.getenv('NAPARI_TRIANGULATION_BACKEND', 'Fastest available')
)
_config_path = os.getenv('NAPARI_CONFIG', user_config_dir())

Check warning on line 231 in napari/utils/info.py

View check run for this annotation

Codecov / codecov/patch

napari/utils/info.py#L231

Added line #L231 was not covered by tests
Comment on lines +226 to +231
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need this ValueError path?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dunno, you added it 🤣
I'm not sure what case triggers it, maybe CI?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, confirm it was added in #5333. That discussion was fun to read a few years later 😊 but offered no clues as to why this try/except is here. 😕 I agree with @psobolewskiPhD that it's probably best not to mess with it in this PR.


text += '<br><b>Experimental Settings:</b><br>'
text += f' - Async: {_async_setting}<br>'
text += f' - Autoswap buffers: {_autoswap_buffers}<br>'
text += f' - Triangulation backend: {_triangulation_backend}<br>'

text += '<br><b>Settings path:</b><br>'
text += f' - {_config_path}'

if not as_html:
text = (
Expand Down
Loading
0