-
Notifications
You must be signed in to change notification settings - Fork 18
Better indexing and sorting #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
breuleux
commented
Jan 26, 2026
- Update to serieux 0.3.8
- Use FileBacked from serieux as a backing for FileCollection
- Replace Finder by Index, make it more generic
- Sort papers by latest venue
89382ba to
9be4698
Compare
5bd4239 to
b4b19e8
Compare
| def index(self, entry: T): | ||
| for name, fn in self.indexers.items(): | ||
| idx = self.indexes[name] | ||
| for value in fn(entry): | ||
| idx[value] = entry |
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.
Would the following be useful to avoid unexpected replacement of an entry?
| def index(self, entry: T): | |
| for name, fn in self.indexers.items(): | |
| idx = self.indexes[name] | |
| for value in fn(entry): | |
| idx[value] = entry | |
| def index(self, entry: T): | |
| for name, fn in self.indexers.items(): | |
| idx = self.indexes[name] | |
| for value in fn(entry): | |
| assert value not in idx or idx[value] == entry | |
| idx[value] = entry |
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.
Collisions aren't necessarily a big deal here, they might happen for titles, but that's not really going to break anything.