Skip to content

Commit 5979a5b

Browse files
committed
Merge branch 'develop' into deps/bump
2 parents 8b3e342 + 00063cb commit 5979a5b

17 files changed

Lines changed: 44 additions & 66 deletions

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ updates:
1010
- package-ecosystem: github-actions
1111
directory: /
1212
schedule:
13-
interval: weekly # Reduced frequency
13+
interval: monthly # Reduced frequency
1414
target-branch: "develop"
1515
groups:
1616
actions-updates:
@@ -20,7 +20,7 @@ updates:
2020
- package-ecosystem: pip
2121
directory: /
2222
schedule:
23-
interval: weekly # Reduced frequency
23+
interval: monthly # Reduced frequency
2424
target-branch: "develop"
2525
groups:
2626
python-updates:
@@ -30,7 +30,7 @@ updates:
3030
- package-ecosystem: gitsubmodule
3131
directory: /
3232
schedule:
33-
interval: weekly # Reduced frequency
33+
interval: monthly # Reduced frequency
3434
target-branch: "develop"
3535
groups:
3636
submodule-updates:

.github/workflows/basic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,4 @@ jobs:
9898
runs-on: ubuntu-latest
9999
steps:
100100
- uses: actions/checkout@v6
101-
- uses: crate-ci/typos@v1.45.1
101+
- uses: crate-ci/typos@v1.46.0

.github/workflows/extra.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,4 @@ jobs:
111111
runs-on: ubuntu-latest
112112
steps:
113113
- uses: actions/checkout@v6
114-
- uses: crate-ci/typos@v1.45.1
114+
- uses: crate-ci/typos@v1.46.0

docs/data_structures/libE_specs.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,6 @@ libEnsemble is primarily customized by setting options within a ``LibeSpecs`` in
209209
**H_file_prefix** str | None = ``"libE_history"``
210210
Prefix for ``H`` filename.
211211

212-
**use_persis_return_gen** [bool] = ``False``:
213-
Adds persistent generator output fields to the History array on return.
214-
215-
**use_persis_return_sim** [bool] = ``False``:
216-
Adds persistent simulator output fields to the History array on return.
217-
218212
**final_gen_send** [bool] = ``False``:
219213
Send final simulation results to persistent generators before shutdown.
220214
The results will be sent along with the ``PERSIS_STOP`` tag.

docs/dev_guide/release_management/release_platforms/rel_spack.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Do ONCE in your local checkout:
2424

2525
To set upstream repo::
2626

27-
git remote add upstream https://github.com/spack/spack.git
27+
git remote add upstream https://github.com/spack/spack-packages.git
2828
git remote -v # check added
2929

3030
(Optional) To prevent accidental pushes to upstream::
@@ -80,12 +80,15 @@ See the Spack packaging_ and contribution_ guides for more info.
8080
Quick example to update libEnsemble
8181
-----------------------------------
8282

83+
The libEnsemble ``package.py`` file can be viewed online at:
84+
https://github.com/spack/spack-packages/blob/develop/repos/spack_repo/builtin/packages/py_libensemble/package.py
85+
8386
This will open the libEnsemble ``package.py`` file in your editor (given by
8487
environment variable ``EDITOR``)::
8588

8689
spack edit py-libensemble # SPACK_ROOT must be set (see above) (Python packages use "py-" prefix)
8790

88-
Or just open it manually: ``var/spack/repos/builtin/packages/py-libensemble/package.py``.
91+
Or just open it manually: ``repos/spack_repo/builtin/packages/py_libensemble/package.py``.
8992

9093
Now get the checksum for new lines:
9194

@@ -119,7 +122,7 @@ Express Summary: Make Fork Identical to Upstream
119122
Quick summary for bringing the develop branch on a forked repo up to speed with upstream
120123
(YOU WILL LOSE ANY CHANGES)::
121124

122-
git remote add upstream https://github.com/spack/spack.git
125+
git remote add upstream https://github.com/spack/spack-packages.git
123126
git fetch upstream
124127
git checkout develop
125128
git reset --hard upstream/develop

libensemble/gen_funcs/persistent_fd_param_finder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,4 @@ def fd_param_finder(H, persis_info, gen_specs, libE_info):
119119
tag, Work, calc_in = ps.send_recv(H0)
120120

121121
persis_info["Fnoise"] = Fnoise
122-
return H0, persis_info, FINISHED_PERSISTENT_GEN_TAG
122+
return None, persis_info, FINISHED_PERSISTENT_GEN_TAG

libensemble/gen_funcs/persistent_sampling.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ def sample_corners_with_probability(corners, p, b):
121121
running_total[row["corner_id"]] += row["f"]
122122

123123
# Having received a PERSIS_STOP, update f_est field for all points and return
124-
# For manager to honor final H_o return, must have set libE_specs["use_persis_return_gen"] = True
125124
f_est = running_total / number_of_samples
126125
H_o = np.zeros(len(sent), dtype=[("sim_id", int), ("corner_id", int), ("f_est", float)])
127126
for count, i in enumerate(sent):

libensemble/gen_funcs/uniform_or_localopt.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ def uniform_or_localopt(H, persis_info, gen_specs, libE_info):
2525
`test_uniform_sampling_then_persistent_localopt_runs.py <https://github.com/Libensemble/libensemble/blob/develop/libensemble/tests/functionality_tests/test_uniform_sampling_then_persistent_localopt_runs.py>`_ # noqa
2626
"""
2727
if libE_info.get("persistent"):
28-
x_opt, persis_info_updates, tag_out = try_and_run_nlopt(H, gen_specs, libE_info)
29-
H_o = []
30-
return H_o, persis_info_updates, tag_out
28+
return try_and_run_nlopt(H, gen_specs, libE_info)
3129
else:
3230
rng = get_rng(gen_specs, libE_info)
3331
ub = gen_specs["user"]["ub"]
@@ -109,10 +107,9 @@ def nlopt_obj_fun(x, grad):
109107
if exit_code > 0 and exit_code < 5:
110108
persis_info_updates["x_opt"] = x_opt
111109
except Exception: # Raised when manager sent PERSIS_STOP or STOP_TAG
112-
x_opt = []
113110
persis_info_updates = {}
114111

115-
return x_opt, persis_info_updates, FINISHED_PERSISTENT_GEN_TAG
112+
return None, persis_info_updates, FINISHED_PERSISTENT_GEN_TAG
116113

117114

118115
def add_to_Out(H_o, x, i, ub, lb, local=False, active=False):

libensemble/history.py

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,22 @@ def __init__(
6868
H[field][: len(H0)] = H0[field]
6969

7070
if "sim_started" not in fields:
71-
logger.manager_warning("Marking entries in H0 as having been 'sim_started' and 'sim_ended'")
71+
logger.manager_warning( # type: ignore[attr-defined]
72+
"Marking entries in H0 as having been " + "'sim_started' and 'sim_ended'"
73+
)
74+
7275
H["sim_started"][: len(H0)] = 1
7376
H["sim_ended"][: len(H0)] = 1
7477
elif "sim_ended" not in fields:
75-
logger.manager_warning("Marking entries in H0 as having been 'sim_ended' if 'sim_started'")
78+
logger.manager_warning( # type: ignore[attr-defined]
79+
"Marking entries in H0 as having been " + "'sim_ended' if 'sim_started'"
80+
)
81+
7682
H["sim_ended"][: len(H0)] = H0["sim_started"]
7783

7884
if "sim_id" not in fields:
79-
logger.manager_warning("Assigning sim_ids to entries in H0")
85+
logger.manager_warning("Assigning sim_ids to entries in H0") # type: ignore[attr-defined]
86+
8087
H["sim_id"][: len(H0)] = np.arange(0, len(H0))
8188
else:
8289
H = np.zeros(L + len(H0), dtype=specs_dtype_list)
@@ -130,8 +137,11 @@ def update_history_f(self, D: dict, kill_canceled_sims: bool = False) -> None:
130137

131138
for j, ind in enumerate(new_inds):
132139
for field in fields:
133-
if self.safe_mode:
134-
assert field not in protected_libE_fields, "The field '" + field + "' is protected"
140+
if field in protected_libE_fields:
141+
if self.safe_mode:
142+
assert False, "The field '" + field + "' is protected"
143+
continue
144+
135145
if np.isscalar(returned_H[field][j]) or returned_H.dtype[field].hasobject:
136146
self.H[field][ind] = returned_H[field][j]
137147
else:
@@ -194,9 +204,10 @@ def update_history_to_gen(self, q_inds: npt.NDArray):
194204
self.H["gen_informed"][ind] = True
195205

196206
if self.using_H0 and not self.given_back_warned:
197-
logger.manager_warning(
198-
"Giving entries in H0 back to gen. Marking entries in H0 as 'gen_informed' if 'sim_ended'."
207+
logger.manager_warning( # type: ignore[attr-defined]
208+
"Giving entries in H0 back to gen. Marking entries in " + "H0 as 'gen_informed' if 'sim_ended'."
199209
)
210+
200211
self.given_back_warned = True
201212

202213
self.H["gen_informed_time"][q_inds] = t
@@ -250,8 +261,11 @@ def update_history_x_in(self, gen_worker: int, D: npt.NDArray, gen_started_time:
250261
update_inds = D["sim_id"]
251262

252263
for field in D.dtype.names:
253-
if self.safe_mode:
254-
assert field not in protected_libE_fields, "The field '" + field + "' is protected"
264+
if field in protected_libE_fields:
265+
if self.safe_mode:
266+
assert False, "The field '" + field + "' is protected"
267+
continue
268+
255269
self.H[field][update_inds] = D[field]
256270

257271
first_gen_inds = update_inds[self.H["gen_ended_time"][update_inds] == 0]

libensemble/manager.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
)
3535
from libensemble.resources.resources import Resources
3636
from libensemble.tools.fields_keys import protected_libE_fields
37-
from libensemble.tools.tools import _PERSIS_RETURN_WARNING, _USER_CALC_DIR_WARNING
37+
from libensemble.tools.tools import _USER_CALC_DIR_WARNING
3838
from libensemble.utils.misc import _WorkerIndexer, extract_H_ranges
3939
from libensemble.utils.output_directory import EnsembleDirectory
4040
from libensemble.utils.timer import Timer
@@ -488,13 +488,11 @@ def _update_state_on_worker_msg(self, persis_info: dict, D_recv: dict, w: int) -
488488
if calc_status in [FINISHED_PERSISTENT_SIM_TAG, FINISHED_PERSISTENT_GEN_TAG]:
489489
final_data = D_recv.get("calc_out", None)
490490
if isinstance(final_data, np.ndarray):
491-
if calc_status is FINISHED_PERSISTENT_GEN_TAG and self.libE_specs.get("use_persis_return_gen", False):
491+
if calc_status is FINISHED_PERSISTENT_GEN_TAG:
492492
self._ensure_sim_id_in_persis_in(final_data)
493493
self.hist.update_history_x_in(w, final_data, self.W[w]["gen_started_time"])
494-
elif calc_status is FINISHED_PERSISTENT_SIM_TAG and self.libE_specs.get("use_persis_return_sim", False):
494+
elif calc_status is FINISHED_PERSISTENT_SIM_TAG:
495495
self.hist.update_history_f(D_recv, self.kill_canceled_sims)
496-
else:
497-
logger.info(_PERSIS_RETURN_WARNING)
498496
self.W[w]["persis_state"] = 0
499497
if self.W[w]["active_recv"]:
500498
self.W[w]["active"] = 0

0 commit comments

Comments
 (0)