Skip to content

Commit 39c7fc3

Browse files
committed
Remove commented code and add documentation placeholders
1 parent 2531312 commit 39c7fc3

File tree

21 files changed

+97
-41
lines changed

21 files changed

+97
-41
lines changed

src/easydiffraction/analysis/categories/aliases.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ def __init__(
6666
),
6767
)
6868

69-
# self._category_entry_attr_name = self.label.name
70-
# self.name = self.label.value
7169
self._identity.category_code = 'alias'
7270
self._identity.category_entry_name = lambda: self.label.value
7371

src/easydiffraction/analysis/categories/constraints.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ def __init__(
6161
]
6262
),
6363
)
64-
# self._category_entry_attr_name = self.lhs_alias.name
65-
# self.name = self.lhs_alias.value
64+
6665
self._identity.category_code = 'constraint'
6766
self._identity.category_entry_name = lambda: self.lhs_alias.value
6867

src/easydiffraction/analysis/categories/joint_fit_experiments.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ def __init__(
6464
),
6565
)
6666

67-
# self._category_entry_attr_name = self.id.name
68-
# self.name = self.id.value
6967
self._identity.category_code = 'joint_fit_experiment'
7068
self._identity.category_entry_name = lambda: self.id.value
7169

src/easydiffraction/core/validation.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ def expected_type(self):
4040
return self.value
4141

4242

43+
# ==============================================================
44+
# Runtime type checking decorator
45+
# ==============================================================
46+
4347
# Runtime type checking decorator for validating those methods
4448
# annotated with type hints, which are writable for the user, and
4549
# which are not covered by custom validators for Parameter attribute
@@ -77,6 +81,8 @@ def wrapper(*args, **kwargs):
7781
# ==============================================================
7882
# Validation stages (enum/constant)
7983
# ==============================================================
84+
85+
8086
class ValidationStage(Enum):
8187
"""Phases of validation for diagnostic logging."""
8288

@@ -274,6 +280,11 @@ def validated(
274280
return value
275281

276282

283+
# ==============================================================
284+
# Attribute specification holding metadata and validators
285+
# ==============================================================
286+
287+
277288
class AttributeSpec:
278289
"""Hold metadata and validators for a single attribute."""
279290

src/easydiffraction/experiments/categories/background/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def calculate(self, x_data: Any) -> Any:
2828
"""
2929
pass
3030

31+
# TODO: Consider moving to CategoryCollection
3132
@abstractmethod
3233
def show(self) -> None:
3334
"""Print a human-readable view of background components."""

src/easydiffraction/experiments/categories/background/enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from enum import Enum
88

99

10+
# TODO: Consider making EnumBase class with: default, description, ...
1011
class BackgroundTypeEnum(str, Enum):
1112
"""Supported background model types."""
1213

src/easydiffraction/experiments/categories/instrument/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"""Instrument category base definitions for CWL/TOF instruments.
2+
3+
This module provides the shared parent used by concrete instrument
4+
implementations under the instrument category.
5+
"""
16
# SPDX-FileCopyrightText: 2021-2025 EasyDiffraction contributors <https://github.com/easyscience/diffraction>
27
# SPDX-License-Identifier: BSD-3-Clause
38

@@ -14,5 +19,6 @@ class InstrumentBase(CategoryItem):
1419
"""
1520

1621
def __init__(self) -> None:
22+
"""Initialize instrument base and set category code."""
1723
super().__init__()
1824
self._identity.category_code = 'instrument'

src/easydiffraction/experiments/categories/instrument/tof.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,30 +124,30 @@ def calib_d_to_tof_offset(self, value):
124124

125125
@property
126126
def calib_d_to_tof_linear(self):
127-
"""Linear dTOF conversion coefficient (µs/Å)."""
127+
"""Linear d to TOF conversion coefficient (µs/Å)."""
128128
return self._calib_d_to_tof_linear
129129

130130
@calib_d_to_tof_linear.setter
131131
def calib_d_to_tof_linear(self, value):
132-
"""Set linear dTOF coefficient (µs/Å)."""
132+
"""Set linear d to TOF coefficient (µs/Å)."""
133133
self._calib_d_to_tof_linear.value = value
134134

135135
@property
136136
def calib_d_to_tof_quad(self):
137-
"""Quadratic dTOF correction coefficient (µs/Ų)."""
137+
"""Quadratic d to TOF correction coefficient (µs/Ų)."""
138138
return self._calib_d_to_tof_quad
139139

140140
@calib_d_to_tof_quad.setter
141141
def calib_d_to_tof_quad(self, value):
142-
"""Set quadratic dTOF correction (µs/Ų)."""
142+
"""Set quadratic d to TOF correction (µs/Ų)."""
143143
self._calib_d_to_tof_quad.value = value
144144

145145
@property
146146
def calib_d_to_tof_recip(self):
147-
"""Reciprocal-velocity dTOF correction (µs·Å)."""
147+
"""Reciprocal-velocity d to TOF correction (µs·Å)."""
148148
return self._calib_d_to_tof_recip
149149

150150
@calib_d_to_tof_recip.setter
151151
def calib_d_to_tof_recip(self, value):
152-
"""Set reciprocal-velocity dTOF correction (µs·Å)."""
152+
"""Set reciprocal-velocity d to TOF correction (µs·Å)."""
153153
self._calib_d_to_tof_recip.value = value

src/easydiffraction/experiments/categories/linked_phases.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ def __init__(
5454
]
5555
),
5656
)
57-
# self._category_entry_attr_name = self.id.name
58-
# self.name = self.id.value
5957
self._identity.category_code = 'linked_phases'
6058
self._identity.category_entry_name = lambda: self.id.value
6159

src/easydiffraction/experiments/categories/peak/factory.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from easydiffraction.experiments.experiment.enums import ScatteringTypeEnum
99

1010

11+
# TODO: Consider inheriting from FactoryBase
1112
class PeakFactory:
1213
"""Factory for creating peak profile objects.
1314

0 commit comments

Comments
 (0)