Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IQuerable interface to build hyperslabs? #2

Closed
Apollo3zehn opened this issue Feb 26, 2021 · 0 comments
Closed

Add IQuerable interface to build hyperslabs? #2

Apollo3zehn opened this issue Feb 26, 2021 · 0 comments

Comments

@Apollo3zehn
Copy link
Owner

Apollo3zehn commented Feb 26, 2021

Edit (2023-01-03)

An experimental IQueryable support has been implemented as dataset.AsQueryable(). Stream support could be implemented similar in the form of dataset.AsStream();.

However, this is still an option:

dataset.Read().Execute(),
dataset.Read().Skip(1).Take(2).Execute()
dataset.Read().AsStream()

The advanage is that dataset.Read.Execute() is also a query, so there is only query and stream. But it is not quite clean to create a IQueryable first to finally get a stream.

Stream and query make mostly sense for 1-dimensional data. Stream cannot be implemented on multidimensional data since the data are not written linerarly into the memory.

Original Issue

LINQ to HDF?

// this could build a netCDF hyperslab (start, stop, stride)
dataset
   .Skip([]) // = start
   .Take(ulong[]) // = stop - start
   .Where((x, n) => n % nth == 0) // stride
   .Read<int>();
// this could build an HDF5 hyperslab (start, stride, count, block)
dataset
   .Skip([]) // = start
   .Where((x, n) => n % nth == 0) // stride
   .Repeat(y) // count (https://fuqua.io/Rx.NET/ix-docs/html/M_System_Linq_QueryableEx_Repeat__1_3.htm)
   .Take(ulong[]) // block
   .Read<int>();

https://jacopretorius.net/2010/01/implementing-a-custom-linq-provider.html

LINQ Part 3: An Introduction to IQueryable - CodeProject
https://www.codeproject.com/Articles/1240553/LINQ-Part-An-Introduction-to-IQueryable

Returning IEnumerable vs. IQueryable - Stack Overflow
https://stackoverflow.com/questions/2876616/returning-ienumerablet-vs-iqueryablet

@Apollo3zehn Apollo3zehn mentioned this issue Jan 25, 2023
70 tasks
@Apollo3zehn Apollo3zehn transferred this issue from Apollo3zehn/HDF5.NET Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant