From fed05d76e21e6d022f924810bc5f754161252744 Mon Sep 17 00:00:00 2001 From: AdityaSavara <39929571+AdityaSavara@users.noreply.github.com> Date: Sat, 9 Oct 2021 15:26:25 -0400 Subject: [PATCH 1/2] Update InverseProblem.py --- CheKiPEUQ/InverseProblem.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/CheKiPEUQ/InverseProblem.py b/CheKiPEUQ/InverseProblem.py index 8d210952..178a9aee 100644 --- a/CheKiPEUQ/InverseProblem.py +++ b/CheKiPEUQ/InverseProblem.py @@ -2941,10 +2941,13 @@ def setMatPlotLibAgg(matPlotLibAggSetting = 'auto'): #no return needed. def pickleAnObject(objectToPickle, base_file_name, file_name_prefix ='', file_name_suffix='', file_name_extension='.pkl'): - import pickle - data_filename = file_name_prefix + base_file_name + file_name_prefix + file_name_extension - with open(data_filename, 'wb') as picklefile: - pickle.dump(objectToPickle, picklefile) + try: + import pickle + data_filename = file_name_prefix + base_file_name + file_name_prefix + file_name_extension + with open(data_filename, 'wb') as picklefile: + pickle.dump(objectToPickle, picklefile) + except Exception as theError: + print("pickleAnObject was unable to perform pickling. The error was:", theError) def unpickleAnObject(base_file_name, file_name_prefix ='', file_name_suffix='', file_name_extension='.pkl'): import pickle @@ -2961,8 +2964,12 @@ def dillpickleAnObject(objectToPickle, base_file_name, file_name_prefix ='', fi except: print("To use this feature requires dill. If you don't have it, open an anaconda prompt and type 'pip install dill' or use conda install. https://anaconda.org/anaconda/dill") data_filename = file_name_prefix + base_file_name + file_name_prefix + file_name_extension - with open(data_filename, 'wb') as picklefile: - dill.dump(objectToPickle, picklefile) + try: + with open(data_filename, 'wb') as picklefile: + dill.dump(objectToPickle, picklefile) + except Exception as theError: + print("dillpickleAnObject was unable to perform dill pickling. The error was:", theError) + def unDillpickleAnObject(base_file_name, file_name_prefix ='', file_name_suffix='', file_name_extension='.dill'): try: From 27fc5fef594984f146e35431f6cf2a3e46fd8a86 Mon Sep 17 00:00:00 2001 From: AdityaSavara <39929571+AdityaSavara@users.noreply.github.com> Date: Sat, 9 Oct 2021 15:51:43 -0400 Subject: [PATCH 2/2] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f8f15cfe..3706c525 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ EMAIL = 'AditySavara2008@u.northwestern.edu' #Eric A. Walker is a co-author and can be reached at WALKER, ERIC AUTHOR = 'Aditya Savara' REQUIRES_PYTHON = '>=3.5.0' -VERSION = '0.9.6' +VERSION = '0.9.7' LICENSE = 'BSD-3-Clause' # What packages are required for this module to be executed?