From 885af0aa6aea4da0685394e7d6fbe2e8a6e3688e Mon Sep 17 00:00:00 2001 From: Kay Robbins <1189050+VisLab@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:56:03 -0600 Subject: [PATCH 1/2] Updated release instructions --- RELEASE_GUIDE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASE_GUIDE.md b/RELEASE_GUIDE.md index 87e0db1d..807862c0 100644 --- a/RELEASE_GUIDE.md +++ b/RELEASE_GUIDE.md @@ -75,7 +75,7 @@ Add a new entry at the top of `CHANGELOG.md` with: - Documentation improvements - Breaking changes (if any) -\*\*Recommend asking coPilot to produce a draft change log reflecting changes between the last release and the current commit on the main branch. +**Recommend asking coPilot to produce a draft change log reflecting changes between the last release and the current commit on the main branch.** **Example:** @@ -213,7 +213,7 @@ Zenodo automatically creates a DOI and archives the release when a GitHub releas **Wait a few minutes** after creating the GitHub release for Zenodo to process it. -1. Go to: https://zenodo.org/records/17866854 (or the latest Zenodo record for hed-python) +1. Go to: https://zenodo.org/records/8056010 (or the latest Zenodo record for hed-python) 2. Verify that a new version appears for your release 3. Check that the DOI is generated 4. Confirm the metadata is correct (title, authors, description) From 1fd670fd24c598a5d42afeac795c27c59fc61f99 Mon Sep 17 00:00:00 2001 From: Kay Robbins <1189050+VisLab@users.noreply.github.com> Date: Fri, 23 Jan 2026 07:44:12 -0600 Subject: [PATCH 2/2] Removed the HedLogger from the project --- hed/tools/__init__.py | 1 - hed/tools/analysis/file_dictionary.py | 8 +- hed/tools/util/hed_logger.py | 76 ------------------- .../validation_tests/SCHEMA_LOAD_FAILED.json | 2 +- .../validation_tests/TAG_INVALID.json | 2 +- tests/tools/util/test_hed_logger.py | 59 -------------- 6 files changed, 3 insertions(+), 145 deletions(-) delete mode 100644 hed/tools/util/hed_logger.py delete mode 100644 tests/tools/util/test_hed_logger.py diff --git a/hed/tools/__init__.py b/hed/tools/__init__.py index 73755bc5..0f37ea58 100644 --- a/hed/tools/__init__.py +++ b/hed/tools/__init__.py @@ -40,7 +40,6 @@ from .remodeling.operations.summarize_column_values_op import SummarizeColumnValuesOp from .remodeling.operations.summarize_hed_type_op import SummarizeHedTypeOp -from .util.hed_logger import HedLogger from .util.data_util import get_new_dataframe, get_value_dict, replace_values, reorder_columns from .util.io_util import check_filename, clean_filename, extract_suffix_path, get_file_list, make_path from .util.io_util import get_path_components diff --git a/hed/tools/analysis/file_dictionary.py b/hed/tools/analysis/file_dictionary.py index 19659a32..c4bb3d8a 100644 --- a/hed/tools/analysis/file_dictionary.py +++ b/hed/tools/analysis/file_dictionary.py @@ -105,19 +105,15 @@ def key_diffs(self, other_dict): diffs = set(self._file_dict.keys()).symmetric_difference(set(other_dict.file_dict.keys())) return list(diffs) - def output_files(self, title=None, logger=None): + def output_files(self, title=None): """Return a string with the output of the list. Parameters: title (None, str): Optional title. - logger (HedLogger): Optional HED logger for recording. Returns: str: The dictionary in string form. - Notes: - - The logger is updated if available. - """ output_list = [] if title: @@ -125,8 +121,6 @@ def output_files(self, title=None, logger=None): for key, _value in self._file_dict.items(): basename = os.path.basename(self.get_file_path(key)) output_list.append(f"{key}: {basename}") - if logger: - logger.add(key, f"{self.name}: {basename}") return "\n".join(output_list) @staticmethod diff --git a/hed/tools/util/hed_logger.py b/hed/tools/util/hed_logger.py deleted file mode 100644 index 3c5ae8ac..00000000 --- a/hed/tools/util/hed_logger.py +++ /dev/null @@ -1,76 +0,0 @@ -"""Logger class with messages organized by key""" - - -class HedLogger: - """Log status messages organized by key.""" - - def __init__(self, name=None): - """Constructor for the HED logger. - - Parameters: - name (str): Identifying name of the logger. - - """ - self.log = {} - self.name = name - - def add(self, key, msg, level="", also_print=False): - """Add an entry to this log. - - Parameters: - key (str): Key used to organize log messages. - msg (str): Message to log. - level (str): Level of importance for filtering messages. - also_print (bool): If False (the default) nothing is output, otherwise the log entry output to stdout. - - """ - if key not in self.log: - self.log[key] = [] - self.log[key].append({"key": key, "msg": msg, "level": level}) - if also_print: - print(f"{key} [{level}]: {msg}") - - def get_log(self, key): - """Get all the log entries stored under the key. - - Parameters: - key (str): The key whose log messages are retrieved. - - Returns: - list: List of log entries associated with this key. - - - """ - if key in self.log: - return self.log[key] - else: - return [] - - def get_log_keys(self): - """Return a list of keys for this log. - - Returns: - list: list of organizational keys for this log. - - """ - return list(self.log.keys()) - - def get_log_string(self, level=None): - """Return the log as a string, with entries separated by newlines. - - Parameters: - level (str or None): Include only the entries from this level. If None, do all. - - Returns: - str: The log as a string separated by newlines. - - """ - - log_lines = [f"Name:{str(self.name)} Level:{str(level)}"] - for key, item in self.log.items(): - log_lines.append(f"{key}:") - if item: - for entry in item: - if not level or (entry["level"] == level): - log_lines.append(f"\t[{entry['level']} {entry['msg']}]") - return "\n".join(log_lines) diff --git a/spec_tests/hed-tests/json_test_data/validation_tests/SCHEMA_LOAD_FAILED.json b/spec_tests/hed-tests/json_test_data/validation_tests/SCHEMA_LOAD_FAILED.json index 18d0f141..629d1379 100644 --- a/spec_tests/hed-tests/json_test_data/validation_tests/SCHEMA_LOAD_FAILED.json +++ b/spec_tests/hed-tests/json_test_data/validation_tests/SCHEMA_LOAD_FAILED.json @@ -88,7 +88,7 @@ }, { "error_code": "SCHEMA_LOAD_FAILED", - "name": "incompatible-merge-schemas ", + "name": "incompatible-merge-schemas", "description": "Schemas in a merge group must be associated with the same standard schema].", "schema": [ "score_2.0.0", diff --git a/spec_tests/hed-tests/json_test_data/validation_tests/TAG_INVALID.json b/spec_tests/hed-tests/json_test_data/validation_tests/TAG_INVALID.json index e85dad66..38d48fde 100644 --- a/spec_tests/hed-tests/json_test_data/validation_tests/TAG_INVALID.json +++ b/spec_tests/hed-tests/json_test_data/validation_tests/TAG_INVALID.json @@ -149,7 +149,7 @@ { "error_code": "TAG_INVALID", "alt_codes": [], - "name": "tag-has-extra-white space", + "name": "tag-has-extra-whitespace", "description": "A HED tag has extra internal whitespace, including directly before or after slashes.", "warning": false, "schema": "8.4.0", diff --git a/tests/tools/util/test_hed_logger.py b/tests/tools/util/test_hed_logger.py deleted file mode 100644 index dbe81445..00000000 --- a/tests/tools/util/test_hed_logger.py +++ /dev/null @@ -1,59 +0,0 @@ -import unittest -from hed.tools.util.hed_logger import HedLogger - - -class Test(unittest.TestCase): - - def test_hed_logger_constructor(self): - status = HedLogger() - self.assertIsInstance(status, HedLogger, "HED logger creates") - keys = status.get_log_keys() - self.assertFalse(keys, "The logger should have no keys when constructed") - - def test_add_get(self): - status = HedLogger() - status.add("baloney", "Test message 1") - status.add("baloney", "Test message 2") - keys = status.get_log_keys() - self.assertEqual(len(keys), 1, "It should have one key if only messages for same key") - baloney_log = status.get_log("baloney") - self.assertEqual(len(baloney_log), 2, "It should have the right number of ") - - def test_get_keys(self): - status = HedLogger() - status.add("baloney", "Test message") - keys = status.get_log_keys() - self.assertEqual(len(keys), 1, "It should have one key after one message") - self.assertEqual(keys[0], "baloney", "It should have the correct key after insertion") - - def test_get_log_string(self): - status = HedLogger() - status.add("baloney", "Test message 1", level="ERROR") - status.add("baloney", "Test message 2") - status.add("bacon", "Test message 3", level="ERROR") - status.add("olives", "Test message 4", level="ERROR") - stuff1 = status.get_log_string() - self.assertGreater(len(stuff1), 0, "get_log should contain messages.") - self.assertEqual(stuff1.count("\n"), 7, "get_log should output right number of lines.") - status.add("banana", "Test message 5") - stuff2 = status.get_log_string() - self.assertEqual(stuff2.count("\n"), 9, "get_log should output right number of lines.") - stuff3 = status.get_log_string(level="ERROR") - self.assertEqual(stuff3.count("\n"), 7, "get_log should output right number of lines when level is given.") - - def test_get_log(self): - status = HedLogger(name="help") - status.add("baloney", "Test message 1", level="ERROR") - status.add("baloney", "Test message 2", level="ERROR") - status.add("bacon", "Test message 3", level="ERROR") - status.add("olives", "Test message 4", level="ERROR") - baloney = status.get_log("baloney") - self.assertIsInstance(baloney, list) - self.assertEqual(len(baloney), 2) - oranges = status.get_log("oranges") - self.assertIsInstance(baloney, list) - self.assertEqual(len(oranges), 0) - - -if __name__ == "__main__": - unittest.main()