-
Notifications
You must be signed in to change notification settings - Fork 29
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
Why a bitmask of extensions? #151
Comments
Hi Alexander, sorry for the late response - I indeed have not forgotten your mail and just did not get to it yet (also because our lab evaluation period just starts in various fields...). I will still try to answer your other questions in the e-mail, but indeed the openPMD issue tracker is the right place to ask: here we can publicly archive, link, check and improve orthogonal questions and improvements :)
A bitmask is just the most efficient representation of such a possible combination and was taken for the sake of very simple parsing (in C/C++/Fortran). With the property we used they are "extensible" The Proposed Change to a StringThis would improve human readability, make writing not much more complicated, introduces a bit of negligible overhead during meta data read and makes parsing a bit more lines in strongly typed languages. Also, named collisions are less likely to occur than number collisions if someone is writing an extension and forgets to ping the issue tracker first for an ID. 🚀 ✨ 👍 |
CCing @DavidSagan and @CFGrote as they suggest the same change. Thx! |
I cannot resist the temptation to answer.
A maximum of 32 extensions doesn't sound future-proof.
Oh yay, let's save a thousand CPU cycles of overhead and a few dozen of bytes. In a file with megabytes or gigabytes of finely gridded data, where each particle or grid point takes way more than 4 bytes! Sorry, that doesn't sound reasonable. |
Ah I should cross-check my writing before submit!
Oh you got me wrong, I very much agree with changing that since parsing an attribute is negligible in cost :) Sorry if that came across the wrong way since I forgot to remove my I thought the last paragraph states I fully agree with the proposal:
I only see positive points in changing it to a string list! ✨ If nobody insists it will go into 2.0.0 |
I updated the post above to cross the |
Fixed by PR #185 |
I have a handful of questions I've asked @ax3l by email some time ago. I've got no answer, so maybe I'll try asking them here.
openPMDextension
is a measlyuint32
bitmask, why? Why isn't it an set of attributes, an array of strings, or basically anything more flexible/extensible? It may seem to be an non-issue now, but the more it will become one, the harder it'll be to change.The text was updated successfully, but these errors were encountered: