Skip to content

Commit

Permalink
Add download options in calibrate modules
Browse files Browse the repository at this point in the history
  • Loading branch information
rickecon committed May 20, 2024
1 parent 6c66fae commit 41adb12
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ogusa/bequest_transmission.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion ogusa/deterministic_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 11 additions & 1 deletion ogusa/psid_data_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
2 changes: 1 addition & 1 deletion ogusa/transfer_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 41adb12

Please sign in to comment.