Skip to content

Commit 79b5c91

Browse files
committed
Rename user_fields to vocs_field_names
1 parent f4672cb commit 79b5c91

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

libensemble/generators.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ def finalize(self) -> None:
213213
self.gen_result = self._running_gen_f.result()
214214

215215
def export(
216-
self, user_fields: bool = False, as_dicts: bool = False
216+
self, vocs_field_names: bool = False, as_dicts: bool = False
217217
) -> tuple[npt.NDArray | list | None, dict | None, int | None]:
218218
"""Return the generator's results
219219
Parameters
220220
----------
221-
user_fields : bool, optional
221+
vocs_field_names : bool, optional
222222
If True, return local_H with variables unmapped from arrays back to individual fields.
223223
Default is False.
224224
as_dicts : bool, optional
@@ -227,7 +227,7 @@ def export(
227227
Returns
228228
-------
229229
local_H : npt.NDArray | list
230-
Generator history array (unmapped if user_fields=True, as dicts if as_dicts=True).
230+
Generator history array (unmapped if vocs_field_names=True, as dicts if as_dicts=True).
231231
persis_info : dict
232232
Persistent information.
233233
tag : int
@@ -236,10 +236,10 @@ def export(
236236
if not self.gen_result:
237237
return (None, None, None)
238238
local_H, persis_info, tag = self.gen_result
239-
if user_fields and local_H is not None and self.variables_mapping:
239+
if vocs_field_names and local_H is not None and self.variables_mapping:
240240
local_H = unmap_numpy_array(local_H, self.variables_mapping)
241241
if as_dicts and local_H is not None:
242-
if user_fields and self.variables_mapping:
242+
if vocs_field_names and self.variables_mapping:
243243
local_H = np_to_list_dicts(local_H, self.variables_mapping)
244244
else:
245245
local_H = np_to_list_dicts(local_H)

libensemble/tests/unit_tests/test_persistent_aposmm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,8 @@ def _run_aposmm_export_test(variables_mapping):
584584
assert "x" in H.dtype.names and H["x"].ndim == 2
585585
assert "f" in H.dtype.names and H["f"].ndim == 1
586586

587-
# Test export with user_fields
588-
H_unmapped, _, _ = aposmm.export(user_fields=True)
587+
# Test export with vocs_field_names
588+
H_unmapped, _, _ = aposmm.export(vocs_field_names=True)
589589
print(f"H_unmapped: {H_unmapped}") # Debug
590590
if H_unmapped is not None:
591591
assert "core" in H_unmapped.dtype.names
@@ -598,7 +598,7 @@ def _run_aposmm_export_test(variables_mapping):
598598
assert "x" in H_dicts[0] # x remains as array
599599
assert "f" in H_dicts[0]
600600
# Test export with both options
601-
H_both, _, _ = aposmm.export(user_fields=True, as_dicts=True)
601+
H_both, _, _ = aposmm.export(vocs_field_names=True, as_dicts=True)
602602
assert isinstance(H_both, list)
603603
assert "core" in H_both[0]
604604
assert "edge" in H_both[0]

0 commit comments

Comments
 (0)