Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
RBEGamer committed Oct 8, 2024
1 parent 14e11bb commit 62a3f90
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 36 deletions.
68 changes: 35 additions & 33 deletions src/MagneticReadoutProcessing/MRP/MRPReadingEntry.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,41 +38,41 @@ def unit(self) -> MRPReadingEntryUnit:
return self._unit

@unit.setter
def unit(self, value: MRPReadingEntryUnit):
self._unit = value
def unit(self, p_value: MRPReadingEntryUnit):
self._unit = p_value


@property
def temperature(self) -> float:
return self._temperature

@temperature.setter
def temperature(self, value: float):
self._temperature = value
def temperature(self, p_value: float):
self._temperature = p_value

@property
def value(self) -> float:
return self._value

@value.setter
def value(self, value: float):
self._value = value
def value(self, p_value: float):
self._value = p_value

@property
def phi(self) -> float:
return self._phi

@phi.setter
def phi(self, value: float):
self._phi = value
def phi(self, p_value: float):
self._phi = p_value

@property
def theta(self) -> float:
return self._theta

@theta.setter
def theta(self, value: float):
self._theta = value
def theta(self, p_value: float):
self._theta = p_value



Expand All @@ -82,32 +82,32 @@ def reading_index_phi(self) -> int:
return self._reading_index_phi

@reading_index_phi.setter
def reading_index_phi(self, value: int):
self._reading_index_phi = value
def reading_index_phi(self, p_value: int):
self._reading_index_phi = p_value

@property
def reading_index_theta(self) -> int:
return self._reading_index_theta

@reading_index_theta.setter
def reading_index_theta(self, value: int):
self._reading_index_theta = value
def reading_index_theta(self, p_value: int):
self._reading_index_theta = p_value

@property
def is_valid(self) -> bool:
return self._is_valid

@is_valid.setter
def is_valid(self, value: bool):
self._is_valid = value
def is_valid(self, p_value: bool):
self._is_valid = p_value

@property
def id(self) -> int:
return self._id

@id.setter
def id(self, value: int):
self._id = value
def id(self, p_value: int):
self._id = p_value


def __init__(self, p_id: int = None, p_value: float = None, p_phi: float = None, p_theta: float = None, p_rip: int = None, p_rit: int = None, p_is_valid: bool = False, p_temperature: float = -254.0, p_unit: MRPReadingEntryUnit = MRPReadingEntryUnit.UNIT_UNSPECIFIED):
Expand Down Expand Up @@ -180,10 +180,9 @@ def from_dict(self, _dict: dict, _import_scale_factor: float = 1.0):
if 'unit' in _dict:
self._unit = MRPReadingEntryUnit.UNIT_UNSPECIFIED
try:
v = _dict.get('unit', MRPReadingEntryUnit.UNIT_UNSPECIFIED.value)
self._unit = MRPReadingEntryUnit.from_int(v)
self._unit = MRPReadingEntryUnit.from_int(_dict.get('unit', MRPReadingEntryUnit.UNIT_UNSPECIFIED.value))
except:
pass
self._unit = MRPReadingEntryUnit.UNIT_UNSPECIFIED

errors = errors + 1
except Exception as e:
Expand All @@ -192,18 +191,21 @@ def from_dict(self, _dict: dict, _import_scale_factor: float = 1.0):


def __dict__(self) -> dict:
return {
'value': self._value,
'phi': self._phi,
'theta': self._theta,
'reading_index_phi': self._reading_index_phi,
'reading_index_theta': self._reading_index_theta,
'is_valid': self._is_valid,
'id': self._id,
'temperature': self._temperature,
'unit': self._unit.value
}

try:
return {
'value': self._value,
'phi': self._phi,
'theta': self._theta,
'reading_index_phi': self._reading_index_phi,
'reading_index_theta': self._reading_index_theta,
'is_valid': self._is_valid,
'id': self._id,
'temperature': self._temperature,
'unit': self._unit.value
}
except Exception as e:
raise MRPReadingEntryException("__dict__ import failed {}".format(e))


def to_dict(self) -> dict:
return self.__dict__()
2 changes: 1 addition & 1 deletion src/MagneticReadoutProcessing/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "MagneticReadoutProcessing"
version = "2.0.7"
version = "2.0.8"
description = "This library was created for the Low-Field MRI project and allows processing of data measured by magnetic field sensors. The focus is on visualization, followed by the provision of simple interfaces to work with this data. In general its possible to use this lib on all kinds of sensor data."
license = {file = "LICENSE"}
authors = [{name = "Marcel Ochsendorf", email = "[email protected]"}]
Expand Down
2 changes: 1 addition & 1 deletion src/MagneticReadoutProcessing/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = MagneticReadoutProcessing
version = 2.0.7
version = 2.0.8
author = Marcel Ochsendorf
author_email = [email protected]
description = This library was created for the Low-Field MRI project and allows processing of data measured by magnetic field sensors. The focus is on visualization, followed by the provision of simple interfaces to work with this data. In general its possible to use this lib on all kinds of sensor data.
Expand Down
2 changes: 1 addition & 1 deletion src/MagneticReadoutProcessing/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
install_requires = [str(requirement) for requirement in pkg_resources.parse_requirements(requirements_txt)]

setup(name='MagneticReadoutProcessing',
version='2.0.7',
version='2.0.8',
license='Apache 2',
description='This library was created for the Low-Field MRI project and allows processing of data measured by magnetic field sensors. The focus is on visualization, followed by the provision of simple interfaces to work with this data. In general its possible to use this lib on all kinds of sensor data.',
author='Marcel Ochsendorf',
Expand Down

0 comments on commit 62a3f90

Please sign in to comment.