Code to get the D3M temp directory accessible by TA2/TA2
from os.path import join
from tworaven_apps.configurations.utils import \
(get_latest_d3m_config,)
d3m_config = get_latest_d3m_config()
if not d3m_config:
print('no config available')
# Note: "d3m_config" is a D3MConfiguration object
# - Attribute for the temp storage directory is:
d3m_config.temp_storage_root
# e.g.: new file output
#
new_data_file = join(d3m_config.temp_storage_root, 'my_dir', 'my_file.csv')