38 / d4-format

The D4 Quantitative Data Format
MIT License
150 stars 20 forks source link

Multitrack D4 from python API without writing multiple intermediate d4 files #53

Closed mrvollger closed 2 years ago

mrvollger commented 2 years ago

Hello,

Thanks for the d4 toolkit, it is really useful.

I want to make a multitrack d4 file using the python API but I don't want to write a bunch of d4 files to disk just to read them back in with D4Merge.

Is there anyway to create a multitrack d4 without writing to disk?

Thanks! Mitchell

38 commented 2 years ago

Hi Mitchell,

Thanks for using D4! I agree that we are able to directly write a multi-track D4 file and this make the API way more easier to use, which means pyd4 creates temporary single track d4 file and automatically merge them.

When speaking the direct creation of multi-track this is harder to implement due to some multi-threading limits. For more detailed explain is each track of D4 file requires a continuous region in the file, however, the file size is unknown unless we actually created the file. But still, we potentially have a way to support this feature but requires more work.

I am wondering what's your concern on writing temporary file to disk?

Thanks, Hao

mrvollger commented 2 years ago

Hi Hao,

I opened this before I found for_sparse_data() and then left it open when I found that issue with for_sparse_data. Now that it works and the temp-files are small I don't mind writing all of these to disk anymore.

Feel free to close.

Thanks, Mitchell