From d12f53d1bde3d9c56d46bf6d27114bb93c8455fb Mon Sep 17 00:00:00 2001 From: jlnav Date: Wed, 7 Jan 2026 13:40:20 -0600 Subject: [PATCH] initial small changes to add returns_id attribute to APOSMM class --- libensemble/gen_classes/aposmm.py | 2 ++ libensemble/generators.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libensemble/gen_classes/aposmm.py b/libensemble/gen_classes/aposmm.py index b081a1d07..8f77748c7 100644 --- a/libensemble/gen_classes/aposmm.py +++ b/libensemble/gen_classes/aposmm.py @@ -172,6 +172,8 @@ class APOSMM(PersistentGenInterfacer): Seed for the random number generator. """ + returns_id = True + def _validate_vocs(self, vocs: VOCS): if len(vocs.constraints): warnings.warn("APOSMM does not support constraints in VOCS. Ignoring.") diff --git a/libensemble/generators.py b/libensemble/generators.py index 588c13c90..745c42337 100644 --- a/libensemble/generators.py +++ b/libensemble/generators.py @@ -68,7 +68,8 @@ def __init__( ): # e.g. {"f": ["f"]} doesn't need mapping self.variables_mapping["f"] = self._get_unmapped_keys(self.VOCS.objectives, "f") # Map sim_id to _id - self.variables_mapping["sim_id"] = ["_id"] + if self.returns_id: + self.variables_mapping["sim_id"] = ["_id"] if len(kwargs) > 0: # so user can specify gen-specific parameters as kwargs to constructor if not self.gen_specs.get("user"):