Skip to content
Snippets Groups Projects

Resolve "Remove usage of electric to describe machine current"

4 unresolved threads

Closes #108

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
48 49
49 50 @property
50 51 def machine_electric_current(self) -> list:
52 warnings.warn(
53 "machine_electric_current is deprecated and will be removed in a future version. Use machine_current instead.",
54 DeprecationWarning,
55 stacklevel=2,
56 )
57 return self.machine_current
  • Comment on lines 50 to +57

    Thanks for the deprecation :muscle: Usually on this case we use tomoscan.utils.io deprecated function to have it as a decorator and within a common format.

    Suggested change
    50 @property
    51 def machine_electric_current(self) -> list:
    52 warnings.warn(
    53 "machine_electric_current is deprecated and will be removed in a future version. Use machine_current instead.",
    54 DeprecationWarning,
    55 stacklevel=2,
    56 )
    57 return self.machine_current
    50 @property
    51 @deprecated(replacement="machine_current", since_version="2.2.0")
    52 def machine_electric_current(self) -> list:
    53 return self.machine_current
  • Please register or sign in to reply
  • payno
    payno @payno started a thread on the diff
  • 50 51 def machine_electric_current(self) -> list:
    52 warnings.warn(
    53 "machine_electric_current is deprecated and will be removed in a future version. Use machine_current instead.",
    54 DeprecationWarning,
    55 stacklevel=2,
    56 )
    57 return self.machine_current
    58
    59 @machine_electric_current.setter
    60 def machine_electric_current(self, machine_current: Iterable | None):
    61 warnings.warn(
    62 "machine_electric_current is deprecated and will be removed in a future version. Use machine_current instead.",
    63 DeprecationWarning,
    64 stacklevel=2,
    65 )
    66 self.machine_current = machine_current
    • Comment on lines +59 to +66

      Same we can use the decorator.

      Suggested change
      59 @machine_electric_current.setter
      60 def machine_electric_current(self, machine_current: Iterable | None):
      61 warnings.warn(
      62 "machine_electric_current is deprecated and will be removed in a future version. Use machine_current instead.",
      63 DeprecationWarning,
      64 stacklevel=2,
      65 )
      66 self.machine_current = machine_current
      59 @machine_electric_current.setter
      60 @deprecated(replacement="machine_current", since_version="2.2.0")
      61 def machine_electric_current(self, machine_current: Iterable | None):
      62 self.machine_current = machine_current
    • Please register or sign in to reply
  • payno
    payno @payno started a thread on the diff
  • 517 518
    518 519 @property
    519 520 def electric_current(self) -> tuple:
    520 """Return the sample name"""
    521 raise NotImplementedError("Base class")
    521 warnings.warn(
    522 "electric_current is deprecated and will be removed in a future version. Use machine_current instead.",
    523 DeprecationWarning,
    524 stacklevel=2,
    525 )
    526 return self.machine_current
    • Comment on lines 520 to +526
      Suggested change
      520 def electric_current(self) -> tuple:
      521 warnings.warn(
      522 "electric_current is deprecated and will be removed in a future version. Use machine_current instead.",
      523 DeprecationWarning,
      524 stacklevel=2,
      525 )
      526 return self.machine_current
      520 @deprecated(replacement="machine_current", since_version="2.2.0")
      521 def electric_current(self) -> tuple:
      522 return self.machine_current
    • Please register or sign in to reply
  • payno
    payno @payno started a thread on the diff
  • 521 raise NotImplementedError("Base class")
    521 warnings.warn(
    522 "electric_current is deprecated and will be removed in a future version. Use machine_current instead.",
    523 DeprecationWarning,
    524 stacklevel=2,
    525 )
    526 return self.machine_current
    522 527
    523 528 @electric_current.setter
    524 529 def electric_current(self, current: tuple | None) -> None:
    530 warnings.warn(
    531 "electric_current is deprecated and will be removed in a future version. Use machine_current instead.",
    532 DeprecationWarning,
    533 stacklevel=2,
    534 )
    535 self.machine_current = current
    • Comment on lines 528 to +535
      Suggested change
      528 @electric_current.setter
      529 def electric_current(self, current: tuple | None) -> None:
      530 warnings.warn(
      531 "electric_current is deprecated and will be removed in a future version. Use machine_current instead.",
      532 DeprecationWarning,
      533 stacklevel=2,
      534 )
      535 self.machine_current = current
      528 @electric_current.setter
      529 @deprecated(replacement="machine_current", since_version="2.2.0")
      530 def electric_current(self, current: tuple | None) -> None:
      531 self.machine_current = current
    • Please register or sign in to reply
  • payno approved this merge request

    approved this merge request

  • Please register or sign in to reply
    Loading