From dcd76fc4415933fc8afa084f7514629ff7f2c0b9 Mon Sep 17 00:00:00 2001 From: Luke Swanson Date: Fri, 29 Nov 2024 12:38:48 -0600 Subject: [PATCH] Update a copule other places to access loadJSONFile from fileio instead of utils. --- src/ogd/common/interfaces/outerfaces/TSVOuterface.py | 6 +++--- src/ogd/common/schemas/tables/TableSchema.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ogd/common/interfaces/outerfaces/TSVOuterface.py b/src/ogd/common/interfaces/outerfaces/TSVOuterface.py index 8cd9205..70e139b 100644 --- a/src/ogd/common/interfaces/outerfaces/TSVOuterface.py +++ b/src/ogd/common/interfaces/outerfaces/TSVOuterface.py @@ -22,7 +22,7 @@ from ogd.common.schemas.games.GameSchema import GameSchema from ogd.common.schemas.tables.TableSchema import TableSchema from ogd.common.schemas.configs.IndexingSchema import FileIndexingSchema -from ogd.common.utils import utils +from ogd.common.utils import fileio from ogd.common.utils.Logger import Logger from ogd.common.utils.typing import ExportRow from ogd.common.utils.Readme import Readme @@ -305,7 +305,7 @@ def _closeFiles(self) -> None: def _zipFiles(self) -> None: existing_datasets = {} try: - file_directory = utils.loadJSONFile(filename="file_list.json", path=self._data_dir) + file_directory = fileio.loadJSONFile(filename="file_list.json", path=self._data_dir) existing_datasets = file_directory.get(self._game_id, {}) except FileNotFoundError as err: Logger.Log("file_list.json does not exist.", logging.WARNING) @@ -473,7 +473,7 @@ def _updateFileExportList(self, num_sess: int) -> None: file_index = {} existing_datasets = {} try: - file_index = utils.loadJSONFile(filename="file_list.json", path=self._data_dir) + file_index = fileio.loadJSONFile(filename="file_list.json", path=self._data_dir) except FileNotFoundError as err: Logger.Log("file_list.json does not exist.", logging.WARNING) except json.decoder.JSONDecodeError as err: diff --git a/src/ogd/common/schemas/tables/TableSchema.py b/src/ogd/common/schemas/tables/TableSchema.py index 34ee151..77763a9 100644 --- a/src/ogd/common/schemas/tables/TableSchema.py +++ b/src/ogd/common/schemas/tables/TableSchema.py @@ -14,7 +14,7 @@ from ogd.common.schemas.Schema import Schema from ogd.common.schemas.tables.ColumnMapSchema import ColumnMapSchema from ogd.common.schemas.tables.ColumnSchema import ColumnSchema -from ogd.common.utils import utils +from ogd.common.utils import fileio from ogd.common.utils.Logger import Logger from ogd.common.utils.typing import Map @@ -236,7 +236,7 @@ def FromFile(schema_name:str, schema_path:Path = Path(schemas.__file__).parent / if not _table_format_name.lower().endswith(".json"): _table_format_name += ".json" - _schema = utils.loadJSONFile(filename=_table_format_name, path=schema_path) + _schema = fileio.loadJSONFile(filename=_table_format_name, path=schema_path) return TableSchema.FromDict(name=schema_name, all_elements=_schema)