From 1db48231caa6981ab182ca2c73a8084dc569b3b5 Mon Sep 17 00:00:00 2001 From: IanCa Date: Fri, 16 Feb 2024 15:42:23 -0600 Subject: [PATCH] Minor fixes to install/misc --- .codeclimate.yml | 1 + hed/models/base_input.py | 4 ++-- hed/models/spreadsheet_input.py | 4 ---- pyproject.toml | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.codeclimate.yml b/.codeclimate.yml index 71a01ba87..9175b4a04 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -60,6 +60,7 @@ exclude_patterns: - "**/spec/" - "**/test/" - "**/tests/" +- "**/spec_tests/" - "**/docs/" - "Tests/" - "**/vendor/" diff --git a/hed/models/base_input.py b/hed/models/base_input.py index 2f7a14b89..04677f6bc 100644 --- a/hed/models/base_input.py +++ b/hed/models/base_input.py @@ -29,7 +29,7 @@ def __init__(self, file, file_type=None, worksheet_name=None, has_column_names=T """ Constructor for the BaseInput class. Parameters: - file (str or file-like or pandas dataframe): An xlsx/tsv file to open. + file (str or file-like or pd.Dataframe): An xlsx/tsv file to open. file_type (str or None): ".xlsx" (Excel), ".tsv" or ".txt" (tab-separated text). Derived from file if file is a filename. Ignored if pandas dataframe. worksheet_name (str or None): Name of Excel workbook worksheet name to use. @@ -554,7 +554,7 @@ def _open_dataframe_file(self, file, has_column_names, input_type): elif input_type in self.TEXT_EXTENSION: try: self._dataframe = pandas.read_csv(file, delimiter='\t', header=pandas_header, - dtype=str, keep_default_na=True, na_values=["", "null"]) + dtype=str, keep_default_na=True, na_values=("", "null")) except Exception as e: raise HedFileError(HedExceptions.INVALID_FILE_FORMAT, str(e), self.name) from e # Convert nan values to a known value diff --git a/hed/models/spreadsheet_input.py b/hed/models/spreadsheet_input.py index 4332bef1d..8715e83b6 100644 --- a/hed/models/spreadsheet_input.py +++ b/hed/models/spreadsheet_input.py @@ -37,11 +37,7 @@ def __init__(self, file=None, file_type=None, worksheet_name=None, tag_columns=N - An invalid dataframe was passed with size 0. - An invalid extension was provided. - A duplicate or empty column name appears. - - :raises OSError: - Cannot open the indicated file. - - :raises KeyError: - The specified worksheet name does not exist. """ diff --git a/pyproject.toml b/pyproject.toml index d442c2620..7e73e6353 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,7 +72,7 @@ include = ["hed*"] namespaces = false [tool.setuptools.package-data] -hed = ["schema/schema_data/*.xml"] +hed = ["schema/schema_data/*.xml", "resources/*.png"] [tool.codespell] skip = '*.git,*.pdf,*.xml,*.mediawiki,*.svg,versioneer.py,venv*,*.tsv,*.yaml,*.yml,*.json,*.rdf,*.jsonld,spec_tests'