Skip to content

Commit 7eade1b

Browse files
authored
rename argument is_polarized_dataset as enable_instrument_settings (#39191)
* rename argument `is_polarized_dataset` as `enable_instrument_settings` The new name describes what the code does more accurately Signed-off-by: Jose Borreguero <borreguero@gmail.com> * Trigger CI build --------- Signed-off-by: Jose Borreguero <borreguero@gmail.com>
1 parent cdf2297 commit 7eade1b

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

Framework/PythonInterface/mantid/utils/reflectometry/orso_helper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ def __init__(
6262
reduction_timestamp: datetime,
6363
creator_name: str,
6464
creator_affiliation: str,
65-
is_polarized_dataset: bool,
65+
enable_instrument_settings: bool,
6666
) -> None:
6767
self._data_columns = data_columns
6868
self._header = None
6969

70-
self._create_mandatory_header(ws, dataset_name, reduction_timestamp, creator_name, creator_affiliation, is_polarized_dataset)
70+
self._create_mandatory_header(ws, dataset_name, reduction_timestamp, creator_name, creator_affiliation, enable_instrument_settings)
7171

7272
@property
7373
def dataset(self) -> OrsoDataset:
@@ -108,7 +108,7 @@ def _create_mandatory_header(
108108
reduction_timestamp: datetime,
109109
creator_name: str,
110110
creator_affiliation: str,
111-
is_polarized_dataset: Optional[bool] = None,
111+
enable_instrument_settings: Optional[bool] = None,
112112
) -> None:
113113
owner = Person(name=None, affiliation=None)
114114

@@ -123,7 +123,7 @@ def _create_mandatory_header(
123123
sample = Sample(name=ws.getTitle())
124124

125125
# This will initially only consider polarization
126-
instrument_settings = InstrumentSettings(None, None) if is_polarized_dataset else None
126+
instrument_settings = InstrumentSettings(None, None) if enable_instrument_settings else None
127127
measurement = Measurement(instrument_settings=instrument_settings, data_files=[])
128128

129129
data_source = DataSource(owner=owner, experiment=experiment, sample=sample, measurement=measurement)

Framework/PythonInterface/plugins/algorithms/SaveISISReflectometryORSO.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ def _create_dataset_with_mandatory_header(
413413
reduction_timestamp=self._get_reduction_timestamp(refl_dataset.reduction_history),
414414
creator_name=self.name(),
415415
creator_affiliation=MantidORSODataset.SOFTWARE_NAME,
416-
is_polarized_dataset=refl_dataset.is_polarized,
416+
enable_instrument_settings=refl_dataset.is_polarized, # instrument settings only for polarization data
417417
)
418418

419419
def _add_optional_header_info(self, dataset: MantidORSODataset, refl_dataset: ReflectometryDataset) -> None:

Framework/PythonInterface/test/python/mantid/utils/reflectometry/orso_helper_test.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,13 @@ def test_create_mantid_orso_dataset(self):
227227
creator_name = "Creator Name"
228228
creator_affiliation = "Creator Affiliation"
229229
dataset = MantidORSODataset(
230-
dataset_name, self._data_columns, self._ws, reduction_timestamp, creator_name, creator_affiliation, is_polarized_dataset=False
230+
dataset_name,
231+
self._data_columns,
232+
self._ws,
233+
reduction_timestamp,
234+
creator_name,
235+
creator_affiliation,
236+
enable_instrument_settings=False,
231237
)
232238

233239
orso_dataset = dataset.dataset
@@ -363,7 +369,7 @@ def test_add_multiple_additional_files_to_mantid_orso_dataset(self):
363369
self._check_files_are_created(dataset, filenames, 0, len(filenames), False)
364370

365371
def _create_test_dataset(self, polarized=False):
366-
return MantidORSODataset("Test dataset", self._data_columns, self._ws, datetime.now(), "", "", is_polarized_dataset=polarized)
372+
return MantidORSODataset("Test dataset", self._data_columns, self._ws, datetime.now(), "", "", enable_instrument_settings=polarized)
367373

368374
def _check_mantid_default_header(self, orso_dataset, dataset_name, ws, reduction_timestamp, creator_name, creator_affiliation):
369375
"""Check that the default header contains only the information that can be shared

0 commit comments

Comments
 (0)