Skip to content

Commit

Permalink
add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Morris committed Nov 27, 2024
1 parent 8714c1e commit 72dc293
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/blop/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/blop/objectives.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 72dc293

Please sign in to comment.