probcomp / cgpm

Library of composable generative population models which serve as the modeling and inference backend of BayesDB.
Apache License 2.0
25 stars 11 forks source link

VsCGPM.to_metadata is not compatible with JSON #186

Closed fsaad closed 7 years ago

fsaad commented 7 years ago

The keys of self.obs and its structures therein are often integers, causing a havoc when i.e. a user (such as cgpm_metamodel in bayeslite) takes that metadata and converts it to JSON then stores it in the bdb. Per the CGPM interface

    def to_metadata(self):
        """Return the binary (json-friendly) representation of the CGpm.

so VscGPM is responsible for converting keys to/from strings, not the user.