16 July 2026

Problem with some leap years

The time series covers years 1980 through 2026.
Only 1988, 1992, 1996 and 2024 cause problems (some leap years).
In[]:=
dateslevel=
dateslevel
;(*arraywithdatesandwaterlevels.Therearenoduplicateddates*)
A continuous time series is created with TemporalRegularity False
In[]:=
tseriescontinuous=TimeSeries[dateslevel[[All,2]],{dateslevel[[All,1]]},TemporalRegularity->False]
Out[]=
TimeSeries
Time: Tue 1 Jan 1980 00:00:00 to Tue 14 Jul 2026 00:00:00 GMT-06:00
Length: 16196
Duration:
46
yr
6
mo
13
days

Now we create an array with a time series for each of the 47 years.
In[]:=
lastyear=2026;​​tseriesyearly=Table[​​TimeSeriesWindow[tseriescontinuous,{{i,1,1},{i,12,31}}],{i,Range[1980,lastyear]}];
We shift all years to 2026 to compare the water level on the same dates, but different years.
In[]:=
tsshifted=TimeSeriesShift[tseriesyearly[[#-1979]],{{lastyear-#,"Year"},{0,"Day"}}]&/@Range[1980,lastyear];

Everything works fine, except for the iconization - NOT QUITE

In[]:=
Iconize[tsshifted,"tsshifted"]
Out[]=
tsshifted
Now there is a problem with the iconized array of time series.
In[]:=
tsshifted
In[]:=

tsshifted
[[9]],
tsshifted
[[13]],
tsshifted
[[17]],
tsshifted
[[-3]]
Out[]=
TimeSeriesFailure

Tag: NotUnique
,TabularColumn
Element type: Real64
Length: 334
,ResamplingMethodLinearInterpolation,TimeSeriesFailure

Tag: NotUnique
,TabularColumn
Element type: Real64
Length: 334
,ResamplingMethodLinearInterpolation,TimeSeriesFailure

Tag: NotUnique
,TabularColumn
Element type: Real64
Length: 359
,ResamplingMethodLinearInterpolation,TimeSeriesFailure

Tag: NotUnique
,TabularColumn
Element type: Real64
Length: 229
,ResamplingMethodLinearInterpolation

detail - one of your original tsshifted problem data items

In[]:=
aProblemTS=tsshifted[[9]];​​aProblemTS["Properties"]​​aProblemTS["Tabular"]
Out[]=
{ComponentKeys,ComponentTypes,Dates,DatePath,DatesQ,FirstDate,FirstTime,FirstTimestamp,LastDate,LastTime,LastTimestamp,MetaInformation,MinimumTimeIncrement,NormalPath,NormalValues,OptionsSummary,Path,PathComponent,PathComponents,PathLength,ResamplingType,Tabular,TimeObservationWindow,Times,Timestamps,TimestampType,TimeZone,UniformlySpacedQ,Values,ValueType}
Out[]=
Tabular
Row count: 334
Column count: 2

We can see that the underlying Tabular structure has a problem (it is blank). Tally the Timestamps of the aProblemTS and we see we have 2 entries for one Timestamp. Clearly there is a Duplicate Timestamp in tsshifted.
In[]:=
Select[Tally[Normal[aProblemTS][[All,1]]],Last[#]>1&]
Out[]=

Sat 28 Feb 2026 00:00:00GMT-6
,2
In[]:=
{aProblemTS[[59]],aProblemTS[[60]]}
Out[]=

Sat 28 Feb 2026 00:00:00GMT-6
,553.4,
Sat 28 Feb 2026 00:00:00GMT-6
,552.574
The tsshifted looks fine as the
TimeSeries[Failure["NotUnique",<||>],...]
element only lives within the one sub entry.
​
The Iconized function itself fails as this DUPLICATED Timestamp is obviously not unique.
​
To reiterate, the problem is with the Timeseries itself and NOT with the Iconization.
​
Applying the previously supplied shiftAndJitterDuplicates workaround of jittering the Timestamp data works.
In[]:=
tsshifted2=shiftAndJitterDuplicates/@​​(TimeSeriesShift[tsv[[#-1979]],{{aniofinal-#,"Year"},{0,"Day"}}]&/@Range[1980,aniofinal]);​​Iconize[tsshifted2,"tsshifted2"]
Out[]=
tsshifted2
In[]:=
aProblemTS2=tsshifted2[[9]];​​aProblemTS2["Properties"]​​aProblemTS2["Tabular"]
Out[]=
{ComponentKeys,ComponentTypes,Dates,DatePath,DatesQ,FirstDate,FirstTime,FirstTimestamp,LastDate,LastTime,LastTimestamp,MetaInformation,MinimumTimeIncrement,NormalPath,NormalValues,OptionsSummary,Path,PathComponent,PathComponents,PathLength,ResamplingType,Tabular,TimeObservationWindow,Times,Timestamps,TimestampType,TimeZone,UniformlySpacedQ,Values,ValueType}
Out[]=
Tabular
Row count: 333
Column count: 2

Here the aProblemTS2 entry’s Tabular shows correctly. Tally the Timestamps and we see we have No Duplicates.
In[]:=
Select[Tally[Normal[aProblemTS2][[All,1]]],Last[#]>1&]
Out[]=
{}