Skip to content

Commit

Permalink
fix: add pint call to enforce initialization of unit registry (#1146)
Browse files Browse the repository at this point in the history
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 -->
  • Loading branch information
Czaki authored Jul 15, 2024
1 parent 733b168 commit e13f990
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package/PartSeg/common_backend/base_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import napari.utils.theme
import numpy as np
import pint
from napari.qt import get_stylesheet
from napari.utils import Colormap
from napari.utils.theme import get_theme
Expand Down Expand Up @@ -471,6 +472,7 @@ def __init__(self, json_path: Union[Path, str], profile_name: str = "default"):
self.history_index = -1
self.last_executed_algorithm = ""
self._points = None
pint.get_application_registry()("nm") # enforce pint registry initialization

def _image_changed(self):
super()._image_changed()
Expand Down

0 comments on commit e13f990

Please sign in to comment.