Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

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 PlotRanges, 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 herediscussed 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?

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 PlotRanges, 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?

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 PlotRanges, 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?

Tweeted twitter.com/#!/StackMma/status/577809809522720769
deleted 10 characters in body
Source Link
halirutan
  • 113.4k
  • 7
  • 266
  • 479

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 PlotRanges, 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`"]Begin["`Private`"] (ignore that double backtick, you know what I mean).

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?

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 PlotRanges, 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`"] (ignore that double backtick, you know what I mean).

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?

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 PlotRanges, 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?

Source Link
Verbeia
  • 34.5k
  • 10
  • 110
  • 225

SetSystemOptions in a package

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 PlotRanges, 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`"] (ignore that double backtick, you know what I mean).

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?