probcomp / bayeslite

BayesDB on SQLite. A Bayesian database table for querying the probable implications of data as easily as SQL databases query the data itself.
http://probcomp.csail.mit.edu/software/bayesdb
Apache License 2.0
918 stars 64 forks source link

Feature to dump models as JSON #634

Closed jar398 closed 4 years ago

jar398 commented 4 years ago

Adds a dump_models method to the BayesDB class that writes JSON describing a population and its models, sufficient for simulation.

(@Schaechtle heads-up.)

(hmm, I guess we should put documentation for the JSON somewhere, but where?)

Replaces #633 - based on branch in this repository instead of branch in forked repository

jar398 commented 4 years ago

I spent quite a while trying to figure out how to move the test from test_core.py to test_cgpm.py. It's going to take a bit of work, up to an hour. Should I bother?

jar398 commented 4 years ago

I thought the temp file was deleted after the test? How does the person doing the testing look at the json file?

fsaad commented 4 years ago

I thought the temp file was deleted after the test? How does the person doing the testing look at the json file?

@jar398 Good catch, I added delete=False to NamedTemporaryFile.