Opened 8 years ago

Closed 8 years ago

#12670 closed enhancement (fixed)

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

Reported by: jhpalmieri Owned by: jason
Priority: minor Milestone: sage-5.0
Component: misc Keywords:
Cc: Merged in: sage-5.0.beta10
Authors: John Palmieri Reviewers: Florent Hivert
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

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.

Attachments (1)

trac_12670-lazy-cache.patch (1.6 KB) - added by jhpalmieri 8 years ago.
(Sage library)

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by jhpalmieri

(Sage library)

comment:1 Changed 8 years ago by jhpalmieri

  • Status changed from new to needs_review

comment:2 Changed 8 years ago by hivert

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

comment:3 follow-up: Changed 8 years ago by jhpalmieri

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.

comment:4 in reply to: ↑ 3 Changed 8 years ago by hivert

  • Reviewers set to Florent Hivert

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

comment:5 Changed 8 years ago by nbruin

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.

comment:6 Changed 8 years ago by hivert

  • Status changed from needs_review to positive_review

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.

comment:7 Changed 8 years ago by jdemeyer

  • Merged in set to sage-5.0.beta10
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.