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
Pickling and otherwise enhancing global options #18555
Comments
Changed keywords from none to options |
This comment has been minimized.
This comment has been minimized.
Author: Andrew Mathas |
comment:3
As I am cleaning this up a related question comes to mind: the name Thoughts? |
This comment has been minimized.
This comment has been minimized.
Commit: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
This comment has been minimized.
This comment has been minimized.
comment:12
Replying to @sagetrac-git: This was to remove 20618 from the commit tree as it shouldn't have been there... |
Changed branch from u/andrew.mathas/pickling_global_options to public/misc/pickling_global_options-18555 |
comment:13
Okay, I fixed the doctest failures with The other doctest failures were due to lack of conversion to This is a very nice improvement over the current interface to (global) options. If the doctest pass for you and my changes are good, then you can set this to a positive review. New commits:
|
Changed keywords from options to days78, options |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:15
There's some doc issues in the |
comment:21
Reviewer name is missing |
Reviewer: Travis Scrimshaw |
comment:23
Merge conflict, try next beta |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:25
Merged into 7.3.beta7. Tests pass. |
comment:26
Fails on 32-bit
|
comment:27
This just needs to mark the different output as |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:29
Replying to @tscrim:
Thanks Travis! Fixed and changed back to a positive review. |
Changed branch from public/misc/pickling_global_options-18555 to |
Instances of the GlobalOptions class in
sage.structure.global_options
do not pickle, which is annoying and causes various problems. (This is a defect.)In addition, when the
GlobalOptions
class was introduced it was suggested in sage-dev that it "would be nice" if we could implement the syntax used in the IPython configuration:This ticket implements both of these features and, in addition, makes it possible to construct options classes dynamically.
As was also suggested on sage-dev, I have also renamed all of the global_options methods simply as options, with the global_options variants being deprecated. The "stand-alone" options classes such as
PartitionOoptions
,TableauxOptions
, ... have also been deprecated and, instead, put inside their "parent" classes where they are accessible using theoptions
method (global_options
methods have been deprecated). This is cleaned up the code a little and it seems to speed up the sage start-up time.The pickling is done by adding an extra
module
argument to theGlobalOptions
that specifies the module which contains the class that the options are attached --name
of of the class defaults to the name of the options class but this can be explicitly set using theoptions_class
argument. The options class is assumed to have anoptions
method, and this is used to unpickle a pickle for an options class.GlobalOptions
that do not arise as options methods for standard sage classes cannot be unpickled. The reason why the name of the module and class are passed, as strings, toGlobalOptions
rather than the actual class is that this approach allows the options to be constructed during the initialisation of the (instance of the) class and, in turn, this allows the class to dynamically construct their options classes.CC: @nathanncohen @tscrim
Component: interfaces
Keywords: days78, options
Author: Andrew Mathas
Branch/Commit:
ba7dd98
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/18555
The text was updated successfully, but these errors were encountered: