#6927: Extend CachedFunction to handle disk-cache
---------------------------+------------------------------------------------
Reporter: boothby | Owner: boothby
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-feature
Component: misc | Keywords: cache database
Author: boothby | Upstream: N/A
Reviewer: Tim Dumol | Merged:
Work_issues: |
---------------------------+------------------------------------------------
Old description:
> The CachedFunction class is a wonderful decorator that provides cacheing
> of computations, unique rings, etc. However, for any number of
> databases, it would be useful if the computed data was to persist between
> sessions. So, we should extend the CachedFunction class to enable disk
> caches, too.
New description:
The !CachedFunction class is a wonderful decorator that provides caching
of computations, unique rings, etc. However, for any number of databases,
it would be useful if the computed data was to persist between sessions.
So, we should extend the !CachedFunction class to enable disk caches, too.
--
Comment(by mpatel):
I've attached a combined, rebased patch. I've removed
{{{
#!python
return P(arglist)
}}}
from the "ref" patch. Otherwise, the precomputed values are not cached.
Or am I mistaken?
I've also relocated
{{{
#!python
from sage.structure.sage_object import save, load
}}}
to avoid a circular import problem with `sage -docbuild reference html
-j`:
{{{
#!python
Traceback (most recent call last):
File "/home/apps/sage/devel/sage/doc/common/builder.py", line 11, in
<module>
from sage.misc.cachefunc import cached_method
File "/home/apps/sage/local/lib/python2.6/site-
packages/sage/misc/cachefunc.py", line 20, in <module>
from sage.structure.sage_object import save, load
File "/home/apps/sage/local/lib/python2.6/site-
packages/sage/structure/__init__.py", line 1, in <module>
import dynamic_class # allows for sage.structure.dynamic_class?
File "/home/apps/sage/local/lib/python2.6/site-
packages/sage/structure/dynamic_class.py", line 119, in <module>
from sage.misc.cachefunc import cached_method, cached_function
ImportError: cannot import name cached_method
}}}
To the extent it counts, my review is positive, but someone should check
the combined patch.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6927#comment:10>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.