Skip to content

Commit e13f990

Browse files
authored
fix: add pint call to enforce initialization of unit registry (#1146)
Workaround for hgrecco/pint#2039 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Integrated `pint` library for unit management, improving flexibility and precision in handling measurements. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 733b168 commit e13f990

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

package/PartSeg/common_backend/base_settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import napari.utils.theme
1515
import numpy as np
16+
import pint
1617
from napari.qt import get_stylesheet
1718
from napari.utils import Colormap
1819
from napari.utils.theme import get_theme
@@ -471,6 +472,7 @@ def __init__(self, json_path: Union[Path, str], profile_name: str = "default"):
471472
self.history_index = -1
472473
self.last_executed_algorithm = ""
473474
self._points = None
475+
pint.get_application_registry()("nm") # enforce pint registry initialization
474476

475477
def _image_changed(self):
476478
super()._image_changed()

0 commit comments

Comments
 (0)