-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
@N-Wouda Could you have a quick look at this? You don't have to look at the details, just a high-level review of the main points (listed in the PR) would be already enough! |
I'll have a look at this in a minute! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, few comments. I didn't look at the Environment in great detail, but it seems to do what it should do so no comments there.
# object's consensus parameters. | ||
# | ||
# Using these arguments, the consensus function should return which requests | ||
# to dispatch and which to postpone. | ||
CONSENSUS: dict[str, Callable] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this have values of type ConsensusFunction
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mypy complains about this:
agents/consensus/__init__.py:7: error: Dict entry 0 has incompatible type "str": "Callable[[List[Tuple[Dict[Any, Any], List[List[int]]]], Dict[Any, Any], Any, Any, float, float], Tuple[Any, Any]]"; expected "str": "ConsensusFunction" [dict-item]
agents/consensus/__init__.py:8: error: Dict entry 1 has incompatible type "str": "Callable[[List[Tuple[Dict[Any, Any], List[List[int]]]], Dict[Any, Any], Any, Any, float], Any]"; expected "str": "ConsensusFunction" [dict-item]
agents/consensus/__init__.py:9: error: Dict entry 2 has incompatible type "str": "Callable[[List[Tuple[Dict[Any, Any], List[List[int]]]], Any, Any, Any, float, int, float], Tuple[Any, Any]]"; expected "str": "ConsensusFunction" [dict-item]
I couldn't really figure out how to get this to work. Tried to add **kwargs to ConsensusFunction but that didn't work either. I'm OK with this now, at least it's a bit more explicit then what I had before :-)
Closes #58. This PR:
Environment
with classmethods for the EURO-NeurIPS variant as well as our paper variant.SamplingMethod
protocol.ConsensFunction
protocol.