Changes between Version 10 and Version 17 of Ticket #18555
- Timestamp:
- 07/05/16 10:21:02 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #18555
-
Property
Status
changed from
new
toneeds_review
-
Property
Branch
changed from
u/andrew.mathas/pickling_global_options
topublic/misc/pickling_global_options-18555
- Property Keywords days78 added
-
Property
Commit
changed from
12cb84666d10cab49c8d8b21aad73485c2fedaef
to3f5e0e91e2289dcee18ad56b30c6884f9d26c890
-
Property
Status
changed from
-
Ticket #18555 – Description
v10 v17 10 10 A.options(foobar=1) 11 11 }}} 12 This ticket implements both of these features and, in addition, makes it possible to construct options classes dynamically. 12 This ticket implements both of these features and, in addition, makes it possible to construct options classes dynamically. 13 14 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 the `options` 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. 13 15 14 16 The pickling is done by adding an extra `module` argument to the `GlobalOptions` 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 the `options_class` argument. The options class is assumed to have an `options` 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, to `GlobalOptions` 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. 15 17 16 As 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. This is cleaned up the code a little and it seems to speed up the sage start-up time.