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

Local cache of atlases #127

Open
alessandrofelder opened this issue Jan 5, 2024 · 1 comment
Open

Local cache of atlases #127

alessandrofelder opened this issue Jan 5, 2024 · 1 comment

Comments

@alessandrofelder
Copy link
Member

alessandrofelder commented Jan 5, 2024

Is it worth caching the results of get_downloaded_atlases(), get_atlases_lastversions(), and get_all_atlases_lastversions() somewhere and updating them when model().referesh_data() is called?

Same for

def get_tooltip_text(cls, atlas_name: str):
"""Returns the atlas metadata as a formatted string,
as well as instructions on how to interact with the atlas."""
if atlas_name in get_downloaded_atlases():
metadata = read_atlas_metadata_from_file(atlas_name)
metadata_as_string = ""
for key, value in metadata.items():
metadata_as_string += f"{key}:\t{value}\n"
tooltip_text = f"{format_atlas_name(atlas_name)}\
(double-click to add to viewer)\
\n{metadata_as_string}"

Originally posted by @IgorTatarnikov in #124 (comment)

@alessandrofelder alessandrofelder changed the title Is it worth caching the results of get_downloaded_atlases(), get_atlases_lastversions(), and get_all_atlases_lastversions() somewhere and updating them when model().referesh_data() is called? Local cache of atlases Jan 5, 2024
@alessandrofelder
Copy link
Member Author

https://doc.qt.io/qt-6/qabstractitemmodel.html#match may come in handy here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant