Skip to content
Browse files

dg_mosaic: Strings and array can be compared simply with ==

  • Loading branch information...
1 parent 50fd549 commit 049fb9693b968e4a84cd659811f7da9f831b92ca @oleg-alexandrov oleg-alexandrov committed Apr 1, 2013
Showing with 5 additions and 8 deletions.
  1. +5 −8 src/asp/Tools/dg_mosaic.py.in
View
13 src/asp/Tools/dg_mosaic.py.in
@@ -19,10 +19,6 @@
import os, sys, string, subprocess, math, re, optparse
from datetime import datetime, timedelta
import xml.etree.ElementTree as ET
-import collections
-
-# Compare for equality two strings, arrays, etc.
-compare = lambda x, y: collections.Counter(x) == collections.Counter(y)
class Usage(Exception):
def __init__(self, msg):
@@ -191,16 +187,17 @@ def main():
eph_list, att_list] = read_xml( xml_name(filename) )
# Sanity checks
- if not compare(ref_originx, originx):
+ if ref_originx != originx:
+ print(ref_originx, originx)
raise Exception('InputError', 'Must have the same originx in: '
+ xml_name(args[0]) + ' ' + xml_name(filename) )
- if not compare(ref_pd, pd):
+ if ref_pd != pd:
raise Exception('InputError', 'Must have the same pd in: '
+ xml_name(args[0]) + ' ' + xml_name(filename) )
- if not compare(ref_eph_list, eph_list):
+ if ref_eph_list != eph_list:
raise Exception('InputError', 'Must have the same ephem in: '
+ xml_name(args[0]) + ' ' + xml_name(filename) )
- if not compare(ref_att_list, att_list):
+ if ref_att_list != att_list:
raise Exception('InputError', 'Must have the same att in: '
+ xml_name(args[0]) + ' ' + xml_name(filename) )

0 comments on commit 049fb96

Please sign in to comment.
Something went wrong with that request. Please try again.