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

Store lazy import caches in .sage/cache/ rather than in .sage #12670

Closed
jhpalmieri opened this issue Mar 14, 2012 · 9 comments
Closed

Store lazy import caches in .sage/cache/ rather than in .sage #12670

jhpalmieri opened this issue Mar 14, 2012 · 9 comments

Comments

@jhpalmieri
Copy link
Member

After building and running many versions of Sage, my .sage directory is littered with files with names like

_Applications_sage_builds_sage-5.0.beta7-gcc_devel_sage-main-lazy_import_cache.pickle

We should instead store these in a subdirectory of .sage. The attached patch makes this change.

Component: misc

Author: John Palmieri

Reviewer: Florent Hivert

Merged: sage-5.0.beta10

Issue created by migration from https://trac.sagemath.org/ticket/12670

@jhpalmieri
Copy link
Member Author

(Sage library)

@jhpalmieri
Copy link
Member Author

comment:1

Attachment: trac_12670-lazy-cache.patch.gz

@hivert
Copy link

hivert commented Mar 15, 2012

comment:2

Hi John,

I noticed the same for me. Thanks for tacking care of that. By the way, in my .sage the mentioned file are all only 6 bytes long which seems to be rather small for a cache. Is it normal ? Is the cache actually working ?

Florent

@jhpalmieri
Copy link
Member Author

comment:3

Hi Florent,

My files are only 6 bytes long, too. I don't know anything about the actual code involved in the caches, so I don't know if they're working. (I think they may be the first step toward something more significant, but I'm not sure.) In any case, it's certainly ridiculous to have files with ugly names over 80 characters long, especially if they only contain 6 bytes, stored in a semi-public place.

@hivert
Copy link

hivert commented Mar 16, 2012

comment:4

My files are only 6 bytes long, too. I don't know anything about the actual code involved in the caches, so I don't know if they're working. (I think they may be the first step toward something more significant, but I'm not sure.) In any case, it's certainly ridiculous to have files with ugly names over 80 characters long, especially if they only contain 6 bytes, stored in a semi-public place.

Sure ! I'm reviewing your code and ask for those file on sage-devel. Right no I think it is ready to go I just want to wait the results of the tests.

Florent

@hivert
Copy link

hivert commented Mar 16, 2012

Reviewer: Florent Hivert

@nbruin
Copy link
Contributor

nbruin commented Mar 16, 2012

comment:5

The only calls to save_cache_file I've been able to find are in sage/all.py (this file is apparently skipped by search_src) and in the doctest of save_cache_file. This cache only seems to be involved with get_star_imports and that only gets used in sage.misc.lazy_import if there is a "*" in the input. So indeed, this cache is never used as far as I can see.

@hivert
Copy link

hivert commented Mar 17, 2012

comment:6

The test passes and the code looks good so I'm ok to set the positive review. However, something else has to be done: either to expand the cases where the cache is used or simply to remove it at all. In the mean time I feel that the patch here should enter sage.

@jdemeyer
Copy link

Merged: sage-5.0.beta10

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

No branches or pull requests

5 participants