Group Abstract Group Abstract

Message Boards Message Boards

0
|
148 Views
|
9 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Problem iconizing an array of TimeSeries in Wolfram 15

Posted 3 days ago

For a couple of years I've been using an array of Time series, which I Iconize in order to insert in an application. Recently I upgraded to Wolfram 15 and get an error message.

See attached file showing the problem.

The error message is Failure, Tag not Unique. See the image below. The array is fine, but there is a problem when it is Iconized

enter image description here

Attachments:
9 Replies
Posted 2 days ago

Hi Ricardo, Ok, I went down the rabbit hole... new approach takes your tseriesyearly and remaps to give a direct replacement for your 2. Comparación de comportamiento anual Manipulates tsvsh data.

HTH. Hope you have a great weekend ;)

Attachments:
POSTED BY: Karl Fraser

Thank you Karl for taking the time to clarify the issue. I will read in detail your comments later today or over the weekend. Have a nice weekend!

Posted 2 days ago

Hi Ricardo,

The problem is not with Iconize itself, but the underlying Timeseries. Please see the mod notebooks detail section ;)

POSTED BY: Karl Fraser

Hi Karl,

The function shiftAndJitterDuplicates[ts_] solved the specific problem of one of the arrays, tahnk you. Now I have to make several corrections to the application. I wonder if the time series can be corrected from its origin in order to avoid making changes to the rest of the code.

There are no duplicate dates. The problem seems to occur only with some leap years: 1988, 1992, 1996, and 2024. The problem only occurs when the array is iconized. Please see the attached notebook with the original time series.

I am also attaching the end result. I just wanted to update the data.

Posted 2 days ago

Thank you Karl. I will try it with my data.

POSTED BY: Updating Name

Thank you Karl. I will try it with my data.

Posted 3 days ago

Hi Ricardo,

The issue is some of the input time series already contains duplicate timestamps after the shift. Probably something like:
- the source data already had repeated timestamps,
- the shift changes leap-year alignment,
- the series has irregular timestamps that become duplicated after normalization,
- or the time series includes identical dates at different positions.

You need to disambiguate the duplicated timestamps, one way being to add a tiny jitter (10^9 seconds) only when a year has exact duplicate timestamps, which should preserve the original order. So rebuild each series with explicit {time, value} pairs and then create the TimeSeries with TemporalRegularity -> False so not to force a regular grid.

ClearAll[shiftAndJitterDuplicates];
shiftAndJitterDuplicates[ts_] := Module[{pairs, adjustedPairs},
     pairs = Normal @ ts;
     adjustedPairs = Flatten[
         Map[
            Function[group,
               Module[{n = Length[group], times, values},
                  times = group[[All, 1]];
                  values = group[[All, 2]];    
        Transpose[{times + Range[0, n - 1]*Quantity[10^-9, "Seconds"],
           values}]]
             ],
            GatherBy[pairs, First]
          ], 1];
     TimeSeries[adjustedPairs, TemporalRegularity -> False]];

tsvsh2 = shiftAndJitterDuplicates /@ 
     (TimeSeriesShift[
       tsv[[# - 1979]], {{aniofinal - #, "Year"}, {0, "Day"}}] & /@ 
     Range[1980, aniofinal]);

Other series are not affected.
tsvsh[[44]] === tsvsh2[[44]] - TRUE

Hope this helps.

POSTED BY: Karl Fraser

Thank you Ahmed. Anything you suggest I should do while the problem is fixed?

Hi Ricardo,

Thank you for reporting this. Relevant teams are aware of this issue, but the notebook you provided is helpful and they have it now. They are actively working on it.

POSTED BY: Ahmed Elbanna
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard