Adding WriterBuilder::begin_2d#83
Conversation
|
Sounds exciting! I've got a bit of a headache right now but I will take a look this week |
|
Taking a look right now |
|
I really appreciate the division into two commits. The first commit deserves a chef's kiss. It took me a surprisingly long time to come up with compelling evidence for the transpose argument without needing to do some jank like " I ended up needing to go as far as having 3 arrays all alias the exact same buffer in memory. While I can't directly show that they share the same bytes, I can show that they share the same address in memory! 😂 |
|
|
Whay is |
|
I was wondering that myself. I don't recall how I chose that number. I should add a unit test for begin_1d that has item size zero and len u64::MAX. |
I can investigate and add a unit test for that while I am amending the PR if you want. |
|
Sure, I'd appreciate it. Now that I think about it I probably have one already (can't check on my phone), but it might be succeeding too easily due to the extra space for alignment... that could make it really hard to make a test that reliably detects a regression and might not be worth it. As an alternative, we could maybe just write the max |
I think using your |
This is to accomodate max number of digits in a u64 number.
|
@ExpHP I have amended the PR to:
I could not find what you think is problematic currently regarding |
Good argument, I agree.
Eh, it's just the fact that the total number of characters written depends on the number of spaces and presence/lack of trailing commas, and that it's not immediately obvious that these factors match between the two places. I will merge this as is, play around with it a bit and prep for release. |
|
also going to audit for any other |
Hi @ExpHP, here is the PR adding
WriterBuilder::begin_2das discussed in #78.The only thing which remains unclear to me is whether shape should be written the other way around when using FORTRAN order, but I think not.
I have used
record_sizeas per your suggestion.Have a great day,