-
Notifications
You must be signed in to change notification settings - Fork 9
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
possble DelayedArray constructor over IntegerList
(or other List
)
#27
Comments
Hi Qian, There are 2 ways to deal with this: (1) the quick-and-dirty way that would only let you wrap a List object in a 1-dimensional DelayedArray object, and (2) the more general solution that would let you wrap a List object in a DelayedArray object of arbitrary dimensions. But first some background: Objects passed to
Solution (1) only requires that you define a
Now that List objects comply with the "seed contract", they can be passed to
However, I'm not sure about the exact consequences of defining this Solution (2) is more general and much cleaner. It involves the following: The easiest way to set arbitrary dimensions on a List object is to wrap the object in a thin wrapper that can hold the dim information. Something like this:
Note that we use composition here instead of inheritance, which is a key aspect of this solution and why it is cleaner and safer than solution (1).
Before we can pass this to
Then:
And finally, in the same fashion that we have the HDF5ArraySeed/HDF5Array/HDF5Matrix trio, we would need to complete this with the ListArray and ListMatrix classes (would extend DelayedArray and DelayedMatrix, respectively), and with the
and this would return a ListMatrix instance which would degrade to a DelayedMatrix instance as soon as you start operating on it e.g. As an extra convenience, the So this is feasible, but will require some significant new developments. Adding this to the TODO list but don't think I'll be able to get to this before September... H. |
The 2nd solution looks good and robust. I guess we are not in rush of this, but will be a great feature to be added in DelayedArray. We can close the issue for now if you want, as you already have it in your TODO list. :) |
Let's keep it open. My TODO list is virtual and opened issues are part of it ;-) |
Hi @hpages ,
In the
VariantAnnotation
package, theCollapsedVCF
(orExpandedVCF
) are saving the data entries inIntegerList / CharacterList...
. And in the development ofVCFArray
, we are trying to represent these data entries asDelayedArray
instances. Now we are converting the data entries intoarray
to add dimension, and then use theDelayedArray
constructor over thearray
. Is it possible to have theDelayedArray
constructor directly work onList
object? so that the internal data saving are still using a more efficient way inList
structure than the ordinarylist
? @mtmorganThe text was updated successfully, but these errors were encountered: