Open matthewgilbert opened 6 years ago
More generally, it it likely a good idea to separate the on disk reading of data into a helper module. This reduces class bloat and provides a cleaner interface for adding new on disk data types as they arise in the future.
It would be nice to implement a
from_hdf5
method similar to thefrom_folder
method that currently exists. In addition to adding this, it would make sense to add a util.py file with a function of the formfolder_to_hdf5(path_to_prices, path_to_contract_dates, path_to_meta_data)
for converting a folder structure with the appropriate meta data, price and expiry files into an hdf5 file in the appropriate format forfrom_hdf5
to read from.One possibility is just to encapsulate the price data in the hdf5 file, since this is the largest and slowest data to read.
The benefit of also including expiry data and instrument meta data in this file is it simplifies the API from something like
from_hdf5(meta_data_file, expiry_file, price_hdf5)
to simply
from_hdf5(hdf5_data)