diff --git a/HISTORY.rst b/HISTORY.rst index 08eb1b6b24..a2005147ea 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -44,12 +44,16 @@ Unreleased Changes * Updated the package installation instructions in the API docs for clarity and also to highlight the ease of installation through ``conda-forge``. https://github.com/natcap/invest/issues/1256 - * ``utils.build_lookup_from_csv`` now accepts kwargs for ``pandas.read_csv`` - (`#1319 `_) + * ``utils.build_lookup_from_csv`` has been deprecated and its functionality + has been merged into ``utils.read_csv_to_dataframe`` + (`#1319 `_), + (`#1327 `_) * Workbench * Fixed a bug where sampledata downloads failed silently (and progress bar became innacurate) if the Workbench did not have write permission to the download location. https://github.com/natcap/invest/issues/1070 +* Forest Carbon + * The biophysical table is now case-insensitive. * HRA * Fixed a bug in HRA where the model would error when all exposure and consequence criteria were skipped for a single habitat. The model now diff --git a/src/natcap/invest/utils.py b/src/natcap/invest/utils.py index 80e4eb9c73..ce028bfee2 100644 --- a/src/natcap/invest/utils.py +++ b/src/natcap/invest/utils.py @@ -598,8 +598,8 @@ def expand_path(path, base_path): def read_csv_to_dataframe( - path, index_col=None, usecols=None, cols_to_lower=True, - vals_to_lower=True, expand_path_cols=[], sep=None, engine='python', + path, index_col=False, usecols=None, cols_to_lower=True, + vals_to_lower=True, expand_path_cols=None, sep=None, engine='python', encoding='utf-8-sig', **kwargs): """Return a dataframe representation of the CSV. diff --git a/src/natcap/invest/wave_energy.py b/src/natcap/invest/wave_energy.py index bf7ef6502c..be424b1bd0 100644 --- a/src/natcap/invest/wave_energy.py +++ b/src/natcap/invest/wave_energy.py @@ -743,8 +743,7 @@ def execute(args): # arrays. Also store the amount of energy the machine produces # in a certain wave period/height state as a 2D array machine_perf_dict = {} - machine_perf_data = utils.read_csv_to_dataframe( - args['machine_perf_path'], cols_to_lower=False, vals_to_lower=False) + machine_perf_data = utils.read_csv_to_dataframe(args['machine_perf_path']) # Get the wave period fields, starting from the second column of the table machine_perf_dict['periods'] = machine_perf_data.columns.values[1:] # Build up the height field by taking the first column of the table