From 41adb124c294b8158999fc8dca6052c9484a1932 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Sun, 19 May 2024 22:42:03 -0600 Subject: [PATCH] Add download options in calibrate modules --- ogusa/bequest_transmission.py | 2 +- ogusa/deterministic_profiles.py | 2 +- ogusa/psid_data_setup.py | 12 +++++++++++- ogusa/transfer_distribution.py | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ogusa/bequest_transmission.py b/ogusa/bequest_transmission.py index 77e380ef..5514986b 100644 --- a/ogusa/bequest_transmission.py +++ b/ogusa/bequest_transmission.py @@ -23,7 +23,7 @@ def get_bequest_matrix( except: # This is the case when a Jupyter notebook is calling this function CURDIR = os.getcwd() - output_fldr = "csv_output_files" + output_fldr = "io_files" output_dir = os.path.join(CURDIR, output_fldr) if not os.access(output_dir, os.F_OK): os.makedirs(output_dir) diff --git a/ogusa/deterministic_profiles.py b/ogusa/deterministic_profiles.py index 65a89bab..fc85e3b4 100644 --- a/ogusa/deterministic_profiles.py +++ b/ogusa/deterministic_profiles.py @@ -13,7 +13,7 @@ except: # This is the case when a Jupyter notebook is calling this function cur_dir = os.getcwd() -output_fldr = "csv_output_files" +output_fldr = "io_files" output_dir = os.path.join(cur_dir, output_fldr) if not os.access(output_dir, os.F_OK): os.makedirs(output_dir) diff --git a/ogusa/psid_data_setup.py b/ogusa/psid_data_setup.py index 4f36b1a7..616859ee 100644 --- a/ogusa/psid_data_setup.py +++ b/ogusa/psid_data_setup.py @@ -16,7 +16,17 @@ pandas2ri.activate() pd.options.mode.chained_assignment = "raise" -CURDIR = os.path.split(os.path.abspath(__file__))[0] +try: + # This is the case when a separate script is calling this function in + # this module + CURDIR = os.path.split(os.path.abspath(__file__))[0] +except: + # This is the case when a Jupyter notebook is calling this function + CURDIR = os.getcwd() +output_fldr = "io_files" +output_dir = os.path.join(CURDIR, output_fldr) +if not os.access(output_dir, os.F_OK): + os.makedirs(output_dir) def prep_data(data="psid1968to2015.RData"): diff --git a/ogusa/transfer_distribution.py b/ogusa/transfer_distribution.py index ef9322b0..1af8819a 100644 --- a/ogusa/transfer_distribution.py +++ b/ogusa/transfer_distribution.py @@ -22,7 +22,7 @@ def get_transfer_matrix( except: # This is the case when a Jupyter notebook is calling this function CURDIR = os.getcwd() - output_fldr = "csv_output_files" + output_fldr = "io_files" output_dir = os.path.join(CURDIR, output_fldr) if not os.access(output_dir, os.F_OK): os.makedirs(output_dir)