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

Support Double Values #103

Open
jamadden opened this issue Mar 21, 2019 · 1 comment
Open

Support Double Values #103

jamadden opened this issue Mar 21, 2019 · 1 comment

Comments

@jamadden
Copy link
Member

jamadden commented Mar 21, 2019

This was requested on the BTrees mailing list:

On Mar 14, 2019, at 13:16, Tres Seaver wrote:

On 3/14/19 10:28 AM, Qiwen Chen wrote:
Is there an easy to extend the F (32-bit C float) type in BTrees ( such as IFBTree, LFBTree) to a DOUBLE type?
I currently use IOBTree and LOBTree for storing double type. But I would assume it's not as efficient.

There is no knob to allow that. You could cobble it together yourself, following the pattern for the float-value trees:

  • Copy 'BTrees/floatvalue.h' -> 'doublevalue.h' and make the appropriate changes (figure out which Python API calls need to change).
  • Add new interfaces to 'BTrees/Interfaces.py' (IIntegerDoubleBTreeModule, ILongDoubleBTreeMoudle)
  • Copy 'BTrees/_IFBTree.c' -> '_IDBTree.c' and make appopriate changes ('#include "doublevaluemacros.h"', etc. Ditto for 'BTrees/LFBTree.c'.
  • Copy 'BTrees/IFBTree.py' -> 'IDBTree.py' and make appropriate changes. Ditto for 'BTrees/LFBTree.py'.
  • Copy 'BTrees/tests/test_IFBTree.py' and make appropriate chagnes. Ditto for 'BTrees/tests/test_LFBtree.py'. You could maybe skip this part, but they would be required if you wanted to get your branch merged.
  • Update 'setup.py' to add the new 'FLAVORS' and 'FAMILIES' values.
  • Test thoroughly, including measuring RAM saved over the 'IO' / 'LO' variants. :)
@jamadden
Copy link
Member Author

jamadden commented Mar 5, 2020

#123 makes this easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant