From 72dc293c36df76ab94b5168a603e5e8a17630687 Mon Sep 17 00:00:00 2001 From: Thomas Morris Date: Wed, 27 Nov 2024 13:03:42 -0500 Subject: [PATCH] add docstring --- src/blop/agent.py | 2 ++ src/blop/objectives.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/blop/agent.py b/src/blop/agent.py index 4e95546..df04907 100644 --- a/src/blop/agent.py +++ b/src/blop/agent.py @@ -192,6 +192,8 @@ def sample(self, n: int = DEFAULT_MAX_SAMPLES, normalize: bool = False, method: How many points to sample. method : str How to sample the points. Must be one of 'quasi-random', 'random', or 'grid'. + normalize: bool + If True, sample the unit hypercube. If False, sample the parameter space of the agent. """ active_dofs = self.dofs(active=True) diff --git a/src/blop/objectives.py b/src/blop/objectives.py index 1f9f10d..5479767 100644 --- a/src/blop/objectives.py +++ b/src/blop/objectives.py @@ -334,10 +334,10 @@ def _test_obj(obj, active=None, fitness=None, constraint=None): if obj.active != active: return False if fitness is not None: - if obj.target is None: + if fitness != (obj.target is not None): return False if constraint is not None: - if obj.constraint is None: + if constraint != (obj.constraint is not None): return False return True