NDataSeries .FillFromEnumerable with Linq expression throws NotImplementException


Author
Message
Marcus Förster
Marcus Förster
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 1, Visits: 35
It looks like NDataSeries<T>.FillFromEnumerable calls Reset on its argument.
The IEnumerable object returned by System.Linq.Enumerable.Select (and possibly other Linq methods) does not implement Reset, and throws NotImplementedException.

To reproduce:
new NDataSeriesDouble().FillFromEnumerable(new double[] { 0, 1 }.Select(x => x));

Expected behavior: Fills the series with the values 0 and 1.
Observed behavior: Throws NotImplementedException.


Tags
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.1K
Hi Marcus,

Yes that's correct - it does call Reset internally just to make sure the enumerator starts from the first item. We have removed the Reset and this problem will not appear in future SP's. For the time being you can use the following code to workaround the
NDataSeriesDouble dataSeries = new NDataSeriesDouble();

IEnumerator enumerator = new double[] { 0, 1 }.Select(x => x).GetEnumerator();
while (enumerator.MoveNext())
{
dataSeries.Add(enumerator.Current);
}

Hope this helps - let us know if you meet any problems or have any questions.



Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic
1 active, 1 guest, 0 members, 0 anonymous
No members currently viewing this topic!

Login

Explore
Messages
Mentions
Search