Opened 6 years ago

Last modified 5 years ago

#18555 closed enhancement

Pickling and otherwise enhancing global options — at Version 8

Reported by: andrew.mathas Owned by:
Priority: major Milestone: sage-7.3
Component: interfaces Keywords: days78, options
Cc: ncohen, tscrim Merged in:
Authors: Andrew Mathas Reviewers:
Report Upstream: N/A Work issues:
Branch: u/andrew.mathas/pickling_global_options (Commits, GitHub, GitLab) Commit: 2ba392f42e9ee4b362cf61e8ddd2a9d419f0787e
Dependencies: Stopgaps:

Status badges

Description (last modified by andrew.mathas)

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:

    A.options.foobar = 1

in addition to

    A.options(foobar=1)

Implementing this is an enhancement, and most of the work, which is why this ticket is listed as an enhancement!

The attached patch implements both of these features. There are a few failing doc-tests that I need to fix but is seems basically OK.

Change History (8)

comment:1 Changed 6 years ago by ncohen

  • Cc ncohen added

comment:2 Changed 6 years ago by andrew.mathas

  • Authors set to Andrew Mathas
  • Component changed from PLEASE CHANGE to interfaces
  • Description modified (diff)
  • Keywords options added
  • Summary changed from Pickling global options to Pickling and otherwise enhancing global options
  • Type changed from PLEASE CHANGE to enhancement

comment:3 Changed 6 years ago by andrew.mathas

As I am cleaning this up a related question comes to mind: the name GlobalOptions is slightly unfortunate because instances of this class are really just options for an associated family of objects. I can sort of forgive myself for using this name for the class, but in all of the instances of this class the associated "parent" classes have a global_options method that points back to its options class. This method is now being enshrined more firmly inside the code because it is exploited to allow pickling. I would be happier if these methods were simply called options, rather than global_options, even though this change would necessitate deprecating the existing global_options methods.

Thoughts?

Last edited 5 years ago by andrew.mathas (previous) (diff)

comment:4 Changed 6 years ago by andrew.mathas

  • Description modified (diff)

comment:5 Changed 6 years ago by andrew.mathas

  • Cc tscrim added

comment:6 Changed 6 years ago by andrew.mathas

  • Branch set to u/andrew.mathas/pickling_global_options

comment:7 Changed 6 years ago by andrew.mathas

  • Commit set to 2ba392f42e9ee4b362cf61e8ddd2a9d419f0787e
  • Description modified (diff)

New commits:

f006a84Adding pickling methods
2ba392fInitial version - some failing doctests

comment:8 Changed 6 years ago by andrew.mathas

  • Description modified (diff)
Note: See TracTickets for help on using tickets.