Adds methods to all sm_database objects to dump and/or instantiate the data to a dictionary
Adds methods to sm_utils for deadling with the different OpenQuake rupture object typologies in the case that a rupture surface is present
Adds a general load_database method that allows the user to load a database simply from the database directory path - adopting .pkl or .json depending on what format the metadata file found is.
Tests for json IO
Regarding the performance issues:
It seems as though a json file for the metadata database is about 2.5 times larger in terms of diskspace than its pickle equivalent.
On the tests so far, it is also about 2.5 times slower to build the db from json than to load in the pkl.
As anticipated, this is not the fastest or most compact way of storing metadata but it is, for me at least, an acceptable cost to having a transferable file format.
In any case, both formats will be supported for the foreseeable future
Addresses issue https://github.com/GEMScienceTools/gmpe-smtk/issues/79, which raised the idea of using json as an alternative and transferable means of storing the metadata of the strong motion database.
Several changes:
sm_database
objects to dump and/or instantiate the data to a dictionarysm_utils
for deadling with the different OpenQuake rupture object typologies in the case that a rupture surface is presentload_database
method that allows the user to load a database simply from the database directory path - adopting .pkl or .json depending on what format the metadata file found is.Regarding the performance issues: