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

chore: remove unused/nonfunctional cache on graphcontainer #30

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

vincentkoppen
Copy link
Contributor

The GraphContainer still had a cache method, but we do not implement cache on GraphModel anymore. Instead when caching the grid, we just cache the arrays and with from_cache we restore the graph using from_arrays.

def from_cache(cls: Type[Self], cache_path: Path, load_graphs: bool = True) -> Self:
"""Read from cache and build .graphs from arrays
Args:
cache_path (Path): The path to the cache
load_graphs (bool, optional): Whether to load the graphs. Defaults to True.
Returns:
Self: The grid loaded from cache
"""
pickle_path = get_pickle_path(cache_path)
grid = cls._from_pickle(pickle_path=pickle_path)
if load_graphs:
grid.graphs = GraphContainer.from_arrays(grid)
return grid

Copy link

sonarqubecloud bot commented Feb 4, 2025

@vincentkoppen vincentkoppen added the bug Something isn't working label Feb 4, 2025
@Thijss Thijss merged commit d28aba7 into main Feb 4, 2025
20 checks passed
@Thijss Thijss deleted the chore/remove_unused_cache branch February 4, 2025 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants