I'm looking to update a large package (with subpackage files called in the same context) to be compatible with version 10. A lot of the functionality surrounds plotting, particularly some custom variants of DateListPlot
. To get my desired PlotRange
s, ticks and date label formats, the package does a lot of manipulation of dates, so it hits the change in the treatment of DateDifference
discussed here.
I wanted to just use the following in the preamble of the package, i.e. between the BeginPackage
statement and Begin["`Private`"]
.
If[$VersionNumber >= 10,
SetSystemOptions["DataOptions" ->
{"ReturnQuantities" -> False, "ReturnEntities" -> False}]
];
However this does not actually set the system options. Loading the package and then evaluating
SystemOptions["DataOptions"]
Returns:
{"DataOptions" -> {"ReturnEntities" -> True,
"ReturnQuantities" -> True, "UseDataWrappers" -> True}}
The alternative to this would be to add a lot of If[$VersionNumber...]
hackery for multiple functions inside the package (and handle DateObject
input for each of my custom plot functions, sigh).
So is there any way to set SystemOptions
when a package is loaded?