Skip to content

Instantly share code, notes, and snippets.

@raprasad
Created January 7, 2019 19:58
Show Gist options
  • Save raprasad/c8439f71e9eb430f58b2e2bf67192d3e to your computer and use it in GitHub Desktop.
Save raprasad/c8439f71e9eb430f58b2e2bf67192d3e to your computer and use it in GitHub Desktop.
config temp path

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')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment