From 9a8425e4531a088c338591ff11f7c1dcef2046d1 Mon Sep 17 00:00:00 2001 From: jlnav Date: Fri, 20 Mar 2026 09:27:53 -0500 Subject: [PATCH 1/5] ditto --- .../tests/regression_tests/test_persistent_aposmm_dfols.py | 1 + .../tests/regression_tests/test_persistent_aposmm_exception.py | 1 + .../regression_tests/test_persistent_aposmm_external_localopt.py | 1 + .../tests/regression_tests/test_persistent_aposmm_nlopt.py | 1 + .../tests/regression_tests/test_persistent_aposmm_tao_blmvm.py | 1 + 5 files changed, 5 insertions(+) diff --git a/libensemble/tests/regression_tests/test_persistent_aposmm_dfols.py b/libensemble/tests/regression_tests/test_persistent_aposmm_dfols.py index 6e19930691..c810db561e 100644 --- a/libensemble/tests/regression_tests/test_persistent_aposmm_dfols.py +++ b/libensemble/tests/regression_tests/test_persistent_aposmm_dfols.py @@ -69,6 +69,7 @@ def combine_component(x): "gen_f": gen_f, "persis_in": ["f", "fvec"] + [n[0] for n in gen_out], "out": gen_out, + "initial_batch_size": 100, "user": { "initial_sample_size": 100, "localopt_method": "dfols", diff --git a/libensemble/tests/regression_tests/test_persistent_aposmm_exception.py b/libensemble/tests/regression_tests/test_persistent_aposmm_exception.py index b197dc3f07..09544e51d1 100644 --- a/libensemble/tests/regression_tests/test_persistent_aposmm_exception.py +++ b/libensemble/tests/regression_tests/test_persistent_aposmm_exception.py @@ -69,6 +69,7 @@ def assertion(passed): "gen_f": gen_f, "persis_in": ["f"] + [n[0] for n in gen_out], "out": gen_out, + "initial_batch_size": 100, "user": { "initial_sample_size": 100, "localopt_method": "LN_BOBYQA", diff --git a/libensemble/tests/regression_tests/test_persistent_aposmm_external_localopt.py b/libensemble/tests/regression_tests/test_persistent_aposmm_external_localopt.py index dd01d1069e..22cf47325f 100644 --- a/libensemble/tests/regression_tests/test_persistent_aposmm_external_localopt.py +++ b/libensemble/tests/regression_tests/test_persistent_aposmm_external_localopt.py @@ -75,6 +75,7 @@ "gen_f": gen_f, "persis_in": ["f"] + [n[0] for n in gen_out], "out": gen_out, + "initial_batch_size": 100, "user": { "initial_sample_size": 100, "sample_points": np.round(minima, 1), diff --git a/libensemble/tests/regression_tests/test_persistent_aposmm_nlopt.py b/libensemble/tests/regression_tests/test_persistent_aposmm_nlopt.py index 9d42784439..bf5914573f 100644 --- a/libensemble/tests/regression_tests/test_persistent_aposmm_nlopt.py +++ b/libensemble/tests/regression_tests/test_persistent_aposmm_nlopt.py @@ -64,6 +64,7 @@ "gen_f": gen_f, "persis_in": ["f"] + [n[0] for n in gen_out], "out": gen_out, + "initial_batch_size": 100, "user": { "initial_sample_size": 100, "sample_points": np.round(minima, 1), diff --git a/libensemble/tests/regression_tests/test_persistent_aposmm_tao_blmvm.py b/libensemble/tests/regression_tests/test_persistent_aposmm_tao_blmvm.py index 39ff3b79fd..8a3c762871 100644 --- a/libensemble/tests/regression_tests/test_persistent_aposmm_tao_blmvm.py +++ b/libensemble/tests/regression_tests/test_persistent_aposmm_tao_blmvm.py @@ -67,6 +67,7 @@ "gen_f": gen_f, "persis_in": ["f", "grad"] + [n[0] for n in gen_out], "out": gen_out, + "initial_batch_size": 100, "user": { "initial_sample_size": 100, "sample_points": np.round(minima, 1), From d4a516021d82b70916fc130c1f9e8190812b94ca Mon Sep 17 00:00:00 2001 From: jlnav Date: Wed, 25 Mar 2026 13:11:02 -0500 Subject: [PATCH 2/5] Refactoring and rewording gen_specs options, including those that were previously alloc options. Remove globus_compute_endpoint option for gen_specs due to overwhelming prevalance of using gest-api and other persistent gens --- docs/platforms/platforms_index.rst | 2 +- libensemble/specs.py | 41 ++++++++----------- .../tests/unit_tests/test_ufunc_runners.py | 8 ++-- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/docs/platforms/platforms_index.rst b/docs/platforms/platforms_index.rst index 79285aa7b0..ac175f9982 100644 --- a/docs/platforms/platforms_index.rst +++ b/docs/platforms/platforms_index.rst @@ -225,7 +225,7 @@ accessible on the remote system:: exctr.register_app(full_path="/home/user/forces.x", app_name="forces") task = exctr.submit(app_name="forces", num_procs=64) -Specify a Globus Compute endpoint in either :class:`sim_specs` or :class:`gen_specs` via the ``globus_compute_endpoint`` +Specify a Globus Compute endpoint in :class:`sim_specs` via the ``globus_compute_endpoint`` argument. For example:: from libensemble.specs import SimSpecs diff --git a/libensemble/specs.py b/libensemble/specs.py index 70c18bddd2..7d7790efb8 100644 --- a/libensemble/specs.py +++ b/libensemble/specs.py @@ -157,18 +157,23 @@ def set_fields_from_vocs(self): class GenSpecs(BaseModel): """ - Specifications for configuring a Generator Function. + Specifications for configuring a Generator. """ - gen_f: object | None = None + generator: object | None = None """ - Python function matching the ``gen_f`` interface. Produces parameters for evaluation by a + A pre-initialized generator object. Produces parameters for evaluation by a simulator function, and makes decisions based on simulator function output. + + These inherit from the `gest-api` + (https://github.com/campa-consortium/gest-api) base class. Recommended over + the classic ``gen_f`` interface. """ - generator: object | None = None + gen_f: object | None = None """ - A pre-initialized generator object. + Python function matching the ``gen_f`` interface. Produces parameters for evaluation by a + simulator function, and makes decisions based on simulator function output. """ inputs: list[str] | None = Field(default=[], alias="in") @@ -191,13 +196,6 @@ class GenSpecs(BaseModel): Also used to construct libEnsemble's history array. """ - globus_compute_endpoint: str | None = "" - """ - A Globus Compute (https://www.globus.org/compute) ID corresponding to an active endpoint on a remote system. - libEnsemble's workers will submit generator function instances to this endpoint instead of - calling them locally. - """ - initial_batch_size: int = 0 """ Initial sample size. @@ -243,7 +241,6 @@ class GenSpecs(BaseModel): they will be automatically derived from VOCS. """ - # Only used if using the only_persistent_gens allocation function (default) num_active_gens: int = 1 """ Maximum number of persistent generators to start. Default: 1. @@ -252,33 +249,31 @@ class GenSpecs(BaseModel): async_return: bool = False """ - Return results to gen as they come in (after sample). Default: False (batch return). + Return results to generator as they come in (after sample). Default: False (batch return). Only used if using the ``only_persistent_gens`` allocation function (the default). """ active_recv_gen: bool = False """ - Create gen in active receive mode. If True, the manager does not need to wait - for a return from the generator before sending further returned points. - Default: False. Only used if using the ``only_persistent_gens`` allocation function (the default). + Initialize generator in active-receive mode. The manager won't wait for new points + from the generator upon passing back simulation results or other instructions. + This eliminates the "handshake" between manager and generator. + Only used if using the ``only_persistent_gens`` allocation function (the default). """ give_all_with_same_priority: bool = False """ - If True, then all points with the same priority value are given as a batch to the sim. - Default: False. Only used if using the ``only_persistent_gens`` allocation function (the default). + Give all points with the same priority value as a batch to the sim. """ alt_type: bool = False """ - If True, then the specialized allocator behavior for some persistent gens is used. - Only used if using the ``only_persistent_gens`` allocation function (the default). + Enable specialized allocator behavior for ``only_persistent_gens``. """ batch_mode: bool = False """ - If True, then the generator will not be started if there are still simulations - running. Only used if using the ``give_sim_work_first`` allocation function. + Don't query the generator until all running simulations have finished. """ @model_validator(mode="after") diff --git a/libensemble/tests/unit_tests/test_ufunc_runners.py b/libensemble/tests/unit_tests/test_ufunc_runners.py index 0b362700fd..79fda7c28a 100644 --- a/libensemble/tests/unit_tests/test_ufunc_runners.py +++ b/libensemble/tests/unit_tests/test_ufunc_runners.py @@ -112,10 +112,10 @@ def test_globus_compute_runner_pass(): def test_globus_compute_runner_fail(): calc_in, sim_specs, gen_specs = get_ufunc_args() - gen_specs["globus_compute_endpoint"] = "4321" + sim_specs["globus_compute_endpoint"] = "4321" with mock.patch("globus_compute_sdk.Executor"): - runner = Runner.from_specs(gen_specs) + runner = Runner.from_specs(sim_specs) # Creating Mock Globus ComputeExecutor and Globus Compute future object - yes exception globus_compute_mock = mock.Mock() @@ -124,12 +124,12 @@ def test_globus_compute_runner_fail(): globus_compute_future.exception.return_value = Exception runner.globus_compute_executor = globus_compute_mock - runners = {2: runner.run} + runners = {1: runner.run} libE_info = {"H_rows": np.array([2, 3, 4]), "workerID": 1, "comm": "fakecomm"} with pytest.raises(Exception): - out, persis_info = runners[2](calc_in, {"libE_info": libE_info, "persis_info": {}, "tag": 2}) + out, persis_info = runners[1](calc_in, {"libE_info": libE_info, "persis_info": {}, "tag": 1}) pytest.fail("Expected exception") From 587331672e1c36f729bc04b51e814daa93d2949e Mon Sep 17 00:00:00 2001 From: jlnav Date: Wed, 25 Mar 2026 13:14:49 -0500 Subject: [PATCH 3/5] replace give_all_with_same_priority with batch_evaluate_same_priority --- libensemble/alloc_funcs/give_sim_work_first.py | 4 ++-- libensemble/alloc_funcs/start_only_persistent.py | 4 ++-- libensemble/specs.py | 4 ++-- .../tests/functionality_tests/test_GPU_gen_resources.py | 2 +- .../tests/functionality_tests/test_mpi_gpu_settings.py | 2 +- .../tests/functionality_tests/test_mpi_gpu_settings_env.py | 2 +- .../test_mpi_gpu_settings_mock_nodes_multi_task.py | 2 +- .../test_persistent_sampling_CUDA_variable_resources.py | 2 +- .../functionality_tests/test_runlines_adaptive_workers.py | 2 +- .../test_runlines_adaptive_workers_persistent.py | 2 +- ...unlines_adaptive_workers_persistent_oversubscribe_rsets.py | 2 +- libensemble/tests/functionality_tests/test_stats_output.py | 2 +- .../test_uniform_sampling_with_variable_resources.py | 2 +- .../tests/regression_tests/test_GPU_variable_resources.py | 2 +- .../test_GPU_variable_resources_multi_task.py | 2 +- .../tests/regression_tests/test_ensemble_platform_workdir.py | 2 +- 16 files changed, 19 insertions(+), 19 deletions(-) diff --git a/libensemble/alloc_funcs/give_sim_work_first.py b/libensemble/alloc_funcs/give_sim_work_first.py index 11ccf211f0..96245f7a98 100644 --- a/libensemble/alloc_funcs/give_sim_work_first.py +++ b/libensemble/alloc_funcs/give_sim_work_first.py @@ -25,7 +25,7 @@ def give_sim_work_first( work is given out unless all entries in ``H`` are returned. Can give points in highest priority, if ``"priority"`` is a field in ``H``. - If ``gen_specs["give_all_with_same_priority"]`` or ``alloc_specs["user"]["give_all_with_same_priority"]`` is set to True, then + If ``gen_specs["batch_evaluate_same_priority"]`` or ``alloc_specs["user"]["batch_evaluate_same_priority"]`` is set to True, then all points with the same priority value are given as a batch to the sim. Workers performing sims will be assigned resources given in H["resource_sets"] @@ -54,7 +54,7 @@ def give_sim_work_first( return {}, persis_info # Initialize alloc_specs["user"] as user. - batch_give = user.get("give_all_with_same_priority", False) + batch_give = user.get("batch_evaluate_same_priority", False) gen_in = gen_specs.get("in", []) manage_resources = libE_info["use_resource_sets"] diff --git a/libensemble/alloc_funcs/start_only_persistent.py b/libensemble/alloc_funcs/start_only_persistent.py index 801dd11802..0f35a7d147 100644 --- a/libensemble/alloc_funcs/start_only_persistent.py +++ b/libensemble/alloc_funcs/start_only_persistent.py @@ -34,7 +34,7 @@ def only_persistent_gens(W, H, sim_specs, gen_specs, alloc_specs, persis_info, l async_return: Boolean, optional Return results to gen as they come in (after sample). Default: False (batch return). - give_all_with_same_priority: Boolean, optional + batch_evaluate_same_priority: Boolean, optional If True, then all points with the same priority value are given as a batch to the sim. Default is False @@ -62,7 +62,7 @@ def only_persistent_gens(W, H, sim_specs, gen_specs, alloc_specs, persis_info, l active_recv_gen = user.get("active_recv_gen", False) # Persistent gen can handle irregular communications initial_batch_size = user.get("initial_batch_size", 0) # Always batch return until this many evals complete - batch_give = user.get("give_all_with_same_priority", False) + batch_give = user.get("batch_evaluate_same_priority", False) support = AllocSupport(W, manage_resources, persis_info, libE_info) gen_count = support.count_persis_gens() diff --git a/libensemble/specs.py b/libensemble/specs.py index 7d7790efb8..d8095cdcac 100644 --- a/libensemble/specs.py +++ b/libensemble/specs.py @@ -261,9 +261,9 @@ class GenSpecs(BaseModel): Only used if using the ``only_persistent_gens`` allocation function (the default). """ - give_all_with_same_priority: bool = False + batch_evaluate_same_priority: bool = False """ - Give all points with the same priority value as a batch to the sim. + Pass all points with the same priority value as a batch to a single simulator call. """ alt_type: bool = False diff --git a/libensemble/tests/functionality_tests/test_GPU_gen_resources.py b/libensemble/tests/functionality_tests/test_GPU_gen_resources.py index 8feb36ea77..3630e6a30a 100644 --- a/libensemble/tests/functionality_tests/test_GPU_gen_resources.py +++ b/libensemble/tests/functionality_tests/test_GPU_gen_resources.py @@ -79,7 +79,7 @@ "persis_in": ["f", "x", "sim_id"], "out": [("num_procs", int), ("num_gpus", int), ("x", float, n)], "initial_batch_size": nworkers - 1, - "give_all_with_same_priority": False, + "batch_evaluate_same_priority": False, "async_return": False, "user": { "max_procs": nworkers - 1, # Any sim created can req. 1 worker up to all. diff --git a/libensemble/tests/functionality_tests/test_mpi_gpu_settings.py b/libensemble/tests/functionality_tests/test_mpi_gpu_settings.py index 203a1ca459..e54810f330 100644 --- a/libensemble/tests/functionality_tests/test_mpi_gpu_settings.py +++ b/libensemble/tests/functionality_tests/test_mpi_gpu_settings.py @@ -86,7 +86,7 @@ "gen_f": gen_f, "persis_in": ["f", "x", "sim_id"], "out": [("priority", float), ("resource_sets", int), ("x", float, n)], - "give_all_with_same_priority": False, + "batch_evaluate_same_priority": False, "async_return": False, "initial_batch_size": nworkers - 1, "user": { diff --git a/libensemble/tests/functionality_tests/test_mpi_gpu_settings_env.py b/libensemble/tests/functionality_tests/test_mpi_gpu_settings_env.py index 30c737cbfe..1adbd36360 100644 --- a/libensemble/tests/functionality_tests/test_mpi_gpu_settings_env.py +++ b/libensemble/tests/functionality_tests/test_mpi_gpu_settings_env.py @@ -69,7 +69,7 @@ "persis_in": ["f", "x", "sim_id"], "out": [("priority", float), ("resource_sets", int), ("x", float, n)], "initial_batch_size": nworkers - 1, - "give_all_with_same_priority": False, + "batch_evaluate_same_priority": False, "async_return": False, "user": { "max_resource_sets": nworkers - 1, # Any sim created can req. 1 worker up to all. diff --git a/libensemble/tests/functionality_tests/test_mpi_gpu_settings_mock_nodes_multi_task.py b/libensemble/tests/functionality_tests/test_mpi_gpu_settings_mock_nodes_multi_task.py index 1234c64821..5ca478aea4 100644 --- a/libensemble/tests/functionality_tests/test_mpi_gpu_settings_mock_nodes_multi_task.py +++ b/libensemble/tests/functionality_tests/test_mpi_gpu_settings_mock_nodes_multi_task.py @@ -68,7 +68,7 @@ "persis_in": ["f", "x", "sim_id"], "out": [("priority", float), ("num_procs", int), ("num_gpus", int), ("x", float, n)], "initial_batch_size": nsim_workers, - "give_all_with_same_priority": False, + "batch_evaluate_same_priority": False, "async_return": False, "user": { "max_procs": max(nsim_workers // 2, 1), # Any sim created can req. 1 worker up to max diff --git a/libensemble/tests/functionality_tests/test_persistent_sampling_CUDA_variable_resources.py b/libensemble/tests/functionality_tests/test_persistent_sampling_CUDA_variable_resources.py index d80818920a..e13b3d68bb 100644 --- a/libensemble/tests/functionality_tests/test_persistent_sampling_CUDA_variable_resources.py +++ b/libensemble/tests/functionality_tests/test_persistent_sampling_CUDA_variable_resources.py @@ -62,7 +62,7 @@ "persis_in": ["f", "x", "sim_id"], "out": [("resource_sets", int), ("x", float, n)], "initial_batch_size": nworkers - 1, - "give_all_with_same_priority": False, + "batch_evaluate_same_priority": False, "async_return": True, "user": { "max_resource_sets": nworkers - 1, # Any sim created can req. 1 worker up to all. diff --git a/libensemble/tests/functionality_tests/test_runlines_adaptive_workers.py b/libensemble/tests/functionality_tests/test_runlines_adaptive_workers.py index cbff4e2792..c48eed15db 100644 --- a/libensemble/tests/functionality_tests/test_runlines_adaptive_workers.py +++ b/libensemble/tests/functionality_tests/test_runlines_adaptive_workers.py @@ -52,7 +52,7 @@ "in": ["sim_id"], "out": [("priority", float), ("resource_sets", int), ("x", float, n), ("x_on_cube", float, n)], "batch_mode": False, - "give_all_with_same_priority": True, + "batch_evaluate_same_priority": True, "num_active_gens": 1, "initial_batch_size": 5, "user": { diff --git a/libensemble/tests/functionality_tests/test_runlines_adaptive_workers_persistent.py b/libensemble/tests/functionality_tests/test_runlines_adaptive_workers_persistent.py index 8f80ddb67d..4124aab890 100644 --- a/libensemble/tests/functionality_tests/test_runlines_adaptive_workers_persistent.py +++ b/libensemble/tests/functionality_tests/test_runlines_adaptive_workers_persistent.py @@ -61,7 +61,7 @@ "persis_in": ["x", "f", "sim_id"], "out": [("priority", float), ("resource_sets", int), ("x", float, n), ("x_on_cube", float, n)], "initial_batch_size": nworkers - 1, - "give_all_with_same_priority": False, + "batch_evaluate_same_priority": False, "user": { "max_resource_sets": max_rsets, "lb": np.array([-3, -2]), diff --git a/libensemble/tests/functionality_tests/test_runlines_adaptive_workers_persistent_oversubscribe_rsets.py b/libensemble/tests/functionality_tests/test_runlines_adaptive_workers_persistent_oversubscribe_rsets.py index a317d90433..7eaac50536 100644 --- a/libensemble/tests/functionality_tests/test_runlines_adaptive_workers_persistent_oversubscribe_rsets.py +++ b/libensemble/tests/functionality_tests/test_runlines_adaptive_workers_persistent_oversubscribe_rsets.py @@ -63,7 +63,7 @@ "persis_in": ["f", "x", "sim_id"], "out": [("priority", float), ("resource_sets", int), ("x", float, n), ("x_on_cube", float, n)], "initial_batch_size": nworkers - 1, - "give_all_with_same_priority": False, + "batch_evaluate_same_priority": False, "user": { "max_resource_sets": max_rsets, "lb": np.array([-3, -2]), diff --git a/libensemble/tests/functionality_tests/test_stats_output.py b/libensemble/tests/functionality_tests/test_stats_output.py index b6377f8665..5cf8f1ac73 100644 --- a/libensemble/tests/functionality_tests/test_stats_output.py +++ b/libensemble/tests/functionality_tests/test_stats_output.py @@ -71,7 +71,7 @@ ("x_on_cube", float, n), ], "batch_mode": False, - "give_all_with_same_priority": True, + "batch_evaluate_same_priority": True, "num_active_gens": 1, "async_return": True, "batch_size": 5, diff --git a/libensemble/tests/functionality_tests/test_uniform_sampling_with_variable_resources.py b/libensemble/tests/functionality_tests/test_uniform_sampling_with_variable_resources.py index c895d12a8c..22a7fd5c2c 100644 --- a/libensemble/tests/functionality_tests/test_uniform_sampling_with_variable_resources.py +++ b/libensemble/tests/functionality_tests/test_uniform_sampling_with_variable_resources.py @@ -69,7 +69,7 @@ ], "batch_size": 5, "batch_mode": False, - "give_all_with_same_priority": True, + "batch_evaluate_same_priority": True, "num_active_gens": 1, "async_return": True, "user": { diff --git a/libensemble/tests/regression_tests/test_GPU_variable_resources.py b/libensemble/tests/regression_tests/test_GPU_variable_resources.py index 940688501e..932aebbada 100644 --- a/libensemble/tests/regression_tests/test_GPU_variable_resources.py +++ b/libensemble/tests/regression_tests/test_GPU_variable_resources.py @@ -69,7 +69,7 @@ persis_in=["f", "x", "sim_id"], out=[("num_procs", int), ("num_gpus", int), ("x", float, 2)], initial_batch_size=gpu_test.nworkers - 1, - give_all_with_same_priority=False, + batch_evaluate_same_priority=False, async_return=False, user={ "max_procs": gpu_test.nworkers - 1, # Any sim created can req. 1 worker up to max diff --git a/libensemble/tests/regression_tests/test_GPU_variable_resources_multi_task.py b/libensemble/tests/regression_tests/test_GPU_variable_resources_multi_task.py index 87b450db58..c924bae939 100644 --- a/libensemble/tests/regression_tests/test_GPU_variable_resources_multi_task.py +++ b/libensemble/tests/regression_tests/test_GPU_variable_resources_multi_task.py @@ -79,7 +79,7 @@ persis_in=["f", "x", "sim_id"], out=[("num_procs", int), ("num_gpus", int), ("x", float, 2)], initial_batch_size=nworkers - 1, - give_all_with_same_priority=False, + batch_evaluate_same_priority=False, async_return=False, user={ "max_procs": (nworkers - 1) // 2, # Any sim created can req. 1 worker up to max diff --git a/libensemble/tests/regression_tests/test_ensemble_platform_workdir.py b/libensemble/tests/regression_tests/test_ensemble_platform_workdir.py index bb5a63488a..958aca1043 100644 --- a/libensemble/tests/regression_tests/test_ensemble_platform_workdir.py +++ b/libensemble/tests/regression_tests/test_ensemble_platform_workdir.py @@ -50,7 +50,7 @@ "persis_in": ["f", "x", "sim_id"], "out": [("priority", float), ("resource_sets", int), ("x", float, n)], "initial_batch_size": ensemble.nworkers - 1, - "give_all_with_same_priority": False, + "batch_evaluate_same_priority": False, "async_return": False, "user": { "max_resource_sets": ensemble.nworkers - 1, # Any sim created can req. 1 worker up to all. From 70b51a899f16096d9107a0898c8d80ab23c38e69 Mon Sep 17 00:00:00 2001 From: jlnav Date: Wed, 25 Mar 2026 13:17:30 -0500 Subject: [PATCH 4/5] remove alloc_specs["out"]. this field isn't used anywhere in our codebase --- libensemble/specs.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/libensemble/specs.py b/libensemble/specs.py index d8095cdcac..d4cf86d132 100644 --- a/libensemble/specs.py +++ b/libensemble/specs.py @@ -243,13 +243,13 @@ class GenSpecs(BaseModel): num_active_gens: int = 1 """ - Maximum number of persistent generators to start. Default: 1. + Maximum number of persistent generators to start. Only used if using the ``only_persistent_gens`` allocation function (the default). """ async_return: bool = False """ - Return results to generator as they come in (after sample). Default: False (batch return). + Return results to generator as they come in (after sample). Default of False implies batch return. Only used if using the ``only_persistent_gens`` allocation function (the default). """ @@ -342,13 +342,6 @@ class AllocSpecs(BaseModel): As of libEnsemble v2.0, generator-specific allocation options (e.g., ``async_return``, ``num_active_gens``) have been moved to :class:`GenSpecs`. """ - - outputs: list[tuple] = Field([], alias="out") - """ - list of 2- or 3-tuples corresponding to NumPy dtypes. e.g. ``("dim", int, (3,))``, or ``("path", str)``. - Allocation functions that modify libEnsemble's History array with additional fields should list those - fields here. Also used to construct libEnsemble's history array. - """ # end_alloc_tag From 45100867433020e77e53a6de2e244ae4f63d0759 Mon Sep 17 00:00:00 2001 From: jlnav Date: Thu, 26 Mar 2026 13:41:11 -0500 Subject: [PATCH 5/5] pydantic merging of fields for alloc_specs out no longer necessary --- libensemble/utils/pydantic_bindings.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/libensemble/utils/pydantic_bindings.py b/libensemble/utils/pydantic_bindings.py index 6ae28efe8b..f53b73b76d 100644 --- a/libensemble/utils/pydantic_bindings.py +++ b/libensemble/utils/pydantic_bindings.py @@ -47,9 +47,6 @@ model["inputs"] = FieldInfo.merge_field_infos(model["inputs"], Field(alias="in")) model["outputs"] = FieldInfo.merge_field_infos(model["outputs"], Field(alias="out")) -model = specs.AllocSpecs.model_fields -model["outputs"] = FieldInfo.merge_field_infos(model["outputs"], Field(alias="out")) - specs.SimSpecs.model_rebuild(force=True) specs.GenSpecs.model_rebuild(force=True) specs.AllocSpecs.model_rebuild(force=True)