You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is #2044 (comment) turned into an issue. Currently, AgentSet.get requires member agents to possess the attribute(s) it specifies. This may not be convenient if user wants to quickly get the result and intentionally want to specify undefined attribute(s) as None.
Describe the solution you'd like
What I have in mind is to add an extra optional argument called handle_undefined, which defaults to "raise_exception" (raise AttributeError). The other option would be "fallback_none" to fallback to None without raising an exception. Though user might want to fallback to np.nan instead of None, so this idea still needs further iteration.
The text was updated successfully, but these errors were encountered:
@EwoutH
Here's a brief overview of the proposed change:
Add handle_undefined parameter with default "raise_exception".
Introduce fallback_value parameter to specify the value to return when handle_undefined is set to "fallback_value".
This modification aims to offer more flexibility and convenience for users dealing with diverse agent attributes. I believe this could be a valuable addition to our project, and I'm eager to hear your thoughts, suggestions, or any concerns you might have regarding this proposal.
What's the problem this feature will solve?
This is #2044 (comment) turned into an issue. Currently,
AgentSet.get
requires member agents to possess the attribute(s) it specifies. This may not be convenient if user wants to quickly get the result and intentionally want to specify undefined attribute(s) asNone
.Describe the solution you'd like
What I have in mind is to add an extra optional argument called
handle_undefined
, which defaults to"raise_exception"
(raise AttributeError). The other option would be"fallback_none"
to fallback toNone
without raising an exception. Though user might want to fallback tonp.nan
instead ofNone
, so this idea still needs further iteration.The text was updated successfully, but these errors were encountered: