-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improved reporting of baseline file count mismatch
- Loading branch information
1 parent
96c3c18
commit f6ea4a1
Showing
1 changed file
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f6ea4a1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be a lot of extra code which may still end up trying a cprnc on two completely different files. For less code, you can get filename mismatches. Is there a reason not to just look for filename differences? Something like:
hnames1 = set([ x[:len(x)-len(suffix1)] for x in hists1 ])
hnames2 = set([ x[:len(x)-len(suffix2)] for x in hists2 ])
if len(set1 - set2) > 0:
comments += " No match in %s for following files from %s: %s\n"%(from_dir2, from_dir1, ", ".join(set1 - set2)
elif len(set2 - set1) > 0:
comments += " No match in %s for following files from %s: %s\n"%(from_dir1, from_dir2, ", ".join(set2 - set1)
else:
# Go ahead and compare all the files
f6ea4a1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - you could do the same file basename strip that we do in compare_namelists.