Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

refactor(framework) Update the constructor of RecordSet #4980

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

panh99
Copy link
Contributor

@panh99 panh99 commented Mar 1, 2025

No description provided.

Comment on lines +160 to +162
if records is not None:
for key, record in records.items():
self[key] = record
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the __setitem__ needs to be tweaked since this:

from flwr.common import RecordSet, MetricsRecord, ConfigsRec
c = RecordSet({'a':MetricsRecord(), 'a': ConfigsRecord()})

won't throw a warning and the resulting record won't have a MetricsRecord.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can do anything about it, really, b/c:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What we get is already a dictionary that only has one item. Users will see a warning if they manually set rs["a"] = MetricsRecord() and then rs["a"] = ConfigsRecord().

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants