Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
maffettone committed Apr 3, 2024
1 parent 4cd3369 commit 3ef5fa9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions pdf_agents/monarch_bmm_subject.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,15 @@ def subject_ask(self, batch_size=1) -> Tuple[Sequence[dict[str, ArrayLike]], Seq
suggestions = [suggestions]
# Keep non redundant suggestions and add to knowledge cache
for suggestion in suggestions:
hashable_suggestion = make_hashable(discretize(suggestion, self.motor_resolution))
if suggestion in self.subject_knowledge_cache:
logger.info(f"Suggestion {suggestion} is ignored as already in the subject knowledge cache")
logger.info(
f"Suggestion {suggestion} is ignored as already in the subject knowledge cache: "
f"{hashable_suggestion}"
)
continue
else:
self.subject_knowledge_cache.add(make_hashable(discretize(suggestion, self.motor_resolution)))
self.subject_knowledge_cache.add(hashable_suggestion)
kept_suggestions.append(suggestion)
_default_doc = dict(
elements=self.elements,
Expand Down
2 changes: 1 addition & 1 deletion pdf_agents/startup_scripts/mmm4-kmeans-local.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tiled.client.node
import tiled.client.node # noqa: F401
from bluesky_adaptive.server import register_variable, shutdown_decorator, startup_decorator
from bluesky_queueserver_api.zmq import REManagerAPI

Expand Down
2 changes: 1 addition & 1 deletion pdf_agents/startup_scripts/mmm4-kmeans.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import tiled.client.node
import tiled.client.node # noqa: F401
from bluesky_adaptive.server import register_variable, shutdown_decorator, startup_decorator

from pdf_agents.sklearn import ActiveKmeansAgent
Expand Down

0 comments on commit 3ef5fa9

Please sign in to comment.