DateListPlot failing on Inflation Adjusted TimeSeries



Bug introduced in 10.0 or earlier and solved in 10.4
Bug introduced in 10.0 or earlier and persisting through 11.0.1 or later

First bug. See output of DateListPlot[%]
Second bug. See output of DateListPlot[wtiInflationAdjusted["Path"]]

Ran across this (possible bug) today.

Here's historical West Texas Intermediate oil prices:

wti = TimeSeries[Import["", "XLS"][[2, 4 ;; -2]]];
wti = TimeSeriesMap[Quantity[#, "USDollars"] &, wti]

It plots nicely.


Mathematica graphics

Now to put the data in 2016 dollars and plot:

wtiInflationAdjusted = InflationAdjust[wti, {2016, 1, 1}];

And, well, it fails spectacularly for MMA 10.3 on Win7 x64 (also happens on OS X).

We can go about it another way:


...and we actually get a plot, albeit with a $Failed error thrown in:

Mathematica graphics

The only way I can get around an error is to do a ridiculous Quantity conversion:

take2 = TimeSeriesMap[
 Quantity[QuantityMagnitude[#], "USDollars"] &, InflationAdjust[wti, {2016, 1, 1}]];
DateListPlot[{wti, take2}]

Mathematica graphics

Any ideas? User error or bug?


Posted 2016-01-25T16:29:05.547

Reputation: 10 290

I'll give this until tomorrow before I slap the "bug" tag on it. – kale – 2016-01-25T20:24:28.730

I went ahead and reported to Wolfram and applied the bugs tag since this post got a sarcastically-huge amount of interest! – kale – 2016-01-26T19:48:03.920

1same on V.10.3 + Win 10, but no problem on 10.0 + Win 10 (same machine). Definitely, it is a bug. – garej – 2016-01-26T21:39:58.517

1I added the bug header and specified two bugs. The main bug (evaluation of DateListPlot[%]) is solved as of 10.4; the second (error message of First) persists through 11.0.1 or later. In case the latter should not be considered as a bug, please remove the corresponding parts in the header. – None – 2016-11-09T13:45:49.623



Wolfram confirmed bug. Assigned to [CASE:3521328].


Posted 2016-01-25T16:29:05.547

Reputation: 10 290

@bbgodfrey So the answer (as a CW, by the way) a) confirms that is a bug and b) refers to the case number that Wolfram is using. Disagree with your assessment. – kale – 2016-01-28T16:22:21.467

@bbgodfrey I am fairly certain this has been discussed by the community before, because I remember personally being on the side of allowing an authoritative "it is a bug" as an answer. If you disagree with this position I encourage you to post on [meta], though please first search to see if a discussion already exists there. – Mr.Wizard – 2016-01-30T21:03:49.840

@Mr.Wizard I am happy to accept your advice and shall delete my comment. Thanks. – bbgodfrey – 2016-01-30T21:26:33.347