Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
initialise _ui_offset_scale_factor
Browse files Browse the repository at this point in the history
  • Loading branch information
ggoneiESS committed Oct 25, 2023
1 parent a5e93cc commit 499df19
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions nexus_constructor/model/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Transformation(Dataset):
_dependents = attr.ib(type=list, init=False)
_ui_value = attr.ib(type=float, default=None)
_ui_scale_factor = attr.ib(type=float, default=1.0, init=False)
_ui_offset_scale_factor = attr.ib(type=float, default=1.0, init=False)

@property
def absolute_path(self):
Expand Down Expand Up @@ -168,11 +169,7 @@ def _evaluate_ui_scale_factor(self, units):
pass

def _evaluate_ui_offset_scale_factor(self, units):
try:
if self.transform_type == TransformationType.TRANSLATION:
self._ui_offset_scale_factor = calculate_unit_conversion_factor(units, METRES)
except Exception:
pass
self._ui_offset_scale_factor = calculate_unit_conversion_factor(units, METRES)

@property
def depends_on(self) -> "Transformation":
Expand Down

0 comments on commit 499df19

Please sign in to comment.