Skip to content
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

add a .location property to Index classes #1434

Closed
ctb opened this issue Apr 3, 2021 · 2 comments
Closed

add a .location property to Index classes #1434

ctb opened this issue Apr 3, 2021 · 2 comments

Comments

@ctb
Copy link
Contributor

ctb commented Apr 3, 2021

(this is currently being added in #1392 but that's a bit experimental still so I wanted to document in an issue also.)

there are a few different places where we are talking about adding a location property to Index classes.

location could serve a few different purposes -

In #1406, locations are returned from MultIndex.signatures_with_location() mainly for UX purposes, to alert people to where signature are being loaded from in case of error. This code also useful in command_summarize.py:load_singletons_and_count(...) where it is used to get the right source filename for reporting. This resolved #810 (comment). Here, however, location is only used in MultiIndex because this Index subclass is the only one where we load from many different files that should be visible to the user.

In #1392, where a general location property for Index is introduced, it is used to make Index.find and consuming methods more generic. This is still mostly for reporting, in that there is no explicit suggestion that location be resolvable for others.

Eventually, we should probably change location to be something that can be resolvable to the container for signatures, so that we can do something like

# pull location and a signature md5sum from somewhere
loc = ...
sig_md5 = ...

# load location
db = _load_datatabase(loc)

# find signature by md5sum
sigs = db.select(md5sum=sig_md5)
sig = list(sig)[0]

This would be useful for lazy loading and manifests and other stuff, per #1097.

@ctb
Copy link
Contributor Author

ctb commented Apr 3, 2021

(a different approach would be to have the location be resolvable to the actual signature.)

@ctb
Copy link
Contributor Author

ctb commented Apr 23, 2021

closed by #1392

@ctb ctb closed this as completed Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant