diff --git a/hed/tools/analysis/hed_tag_counts.py b/hed/tools/analysis/hed_tag_counts.py index 1dd86d89..1265ab75 100644 --- a/hed/tools/analysis/hed_tag_counts.py +++ b/hed/tools/analysis/hed_tag_counts.py @@ -86,6 +86,8 @@ def update_event_counts(self, hed_string_obj, file_name): """ if file_name not in self.files: self.files[file_name] = "" + if not hed_string_obj: + return tag_list = hed_string_obj.get_all_tags() tag_dict = {} for tag in tag_list: diff --git a/hed/tools/remodeling/cli/run_remodel.py b/hed/tools/remodeling/cli/run_remodel.py index eb29576f..45fce71a 100644 --- a/hed/tools/remodeling/cli/run_remodel.py +++ b/hed/tools/remodeling/cli/run_remodel.py @@ -197,14 +197,15 @@ def main(arg_list=None): if not os.path.isdir(args.data_dir): raise HedFileError("DataDirectoryDoesNotExist", f"The root data directory {args.data_dir} does not exist", "") backup_name = handle_backup(args) - dispatch = Dispatcher(operations, data_root=args.data_dir, backup_name=backup_name, hed_versions=args.hed_versions) save_dir = None if args.work_dir: save_dir = os.path.realpath(os.path.join(args.work_dir, Dispatcher.REMODELING_SUMMARY_PATH)) - files = get_file_list(dispatch.data_root, name_suffix=args.file_suffix, extensions=args.extensions, + files = get_file_list(args.data_dir, name_suffix=args.file_suffix, extensions=args.extensions, exclude_dirs=args.exclude_dirs) task_dict = parse_tasks(files, args.task_names) for task, files in task_dict.items(): + dispatch = Dispatcher(operations, data_root=args.data_dir, backup_name=backup_name, + hed_versions=args.hed_versions) if args.use_bids: run_bids_ops(dispatch, args, files) else: diff --git a/hed/tools/remodeling/operations/base_summary.py b/hed/tools/remodeling/operations/base_summary.py index 725e854a..9075bdb6 100644 --- a/hed/tools/remodeling/operations/base_summary.py +++ b/hed/tools/remodeling/operations/base_summary.py @@ -143,11 +143,11 @@ def _save_summary_files(self, save_dir, file_format, summary, individual_summari time_stamp = '_' + get_timestamp() else: time_stamp = '' - if task_name: + if task_name: task_name = "_" + task_name this_save = os.path.join(save_dir, self.op.summary_name + '/') os.makedirs(os.path.realpath(this_save), exist_ok=True) - filename = os.path.realpath(os.path.join(this_save, + filename = os.path.realpath(os.path.join(this_save, self.op.summary_filename + task_name + time_stamp + file_format)) individual = summary.get("Individual files", {}) if individual_summaries == "none" or not individual: diff --git a/hed/tools/remodeling/operations/summarize_column_values_op.py b/hed/tools/remodeling/operations/summarize_column_values_op.py index 577d6302..4c440188 100644 --- a/hed/tools/remodeling/operations/summarize_column_values_op.py +++ b/hed/tools/remodeling/operations/summarize_column_values_op.py @@ -76,7 +76,7 @@ def do_op(self, dispatcher, df, name, sidecar=None): Returns: DataFrame: A copy of df. - Side-effect: + Side effect: Updates the relevant summary. """