Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-ligo-segments for openSUSE:Factory checked in at 2022-01-11 21:20:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-ligo-segments (Old) and /work/SRC/openSUSE:Factory/.python-ligo-segments.new.1892 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ligo-segments" Tue Jan 11 21:20:13 2022 rev:3 rq:945444 version:1.4.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-ligo-segments/python-ligo-segments.changes 2021-02-20 22:12:55.711079762 +0100 +++ /work/SRC/openSUSE:Factory/.python-ligo-segments.new.1892/python-ligo-segments.changes 2022-01-11 21:24:23.869175249 +0100 @@ -1,0 +2,11 @@ +Sun Jan 9 13:17:32 UTC 2022 - Atri Bhattacharya <badshah...@gmail.com> + +- Update to version 1.4.0: + * No release notes. +- New BuildRequires: python-six, python-lal required for tests. +- Drop python-ligo-segments-disable-lal-tests.patch: No longer + required since lal has been converted to a multibuild spec with + its main build and testing split into different flavours. +- Disable tests for 32-bit as lal is not available for that arch. + +------------------------------------------------------------------- Old: ---- ligo-segments-1.3.0.tar.gz python-ligo-segments-disable-lal-tests.patch New: ---- ligo-segments-1.4.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-ligo-segments.spec ++++++ --- /var/tmp/diff_new_pack.ErtZEt/_old 2022-01-11 21:24:24.421175637 +0100 +++ /var/tmp/diff_new_pack.ErtZEt/_new 2022-01-11 21:24:24.425175640 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-ligo-segments # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,24 +16,33 @@ # +# Disable tests for 32-bit archs as lal is not supported there +%ifarch %ix86 +%bcond_with tests +%else +%bcond_without tests +%endif + %define skip_python2 1 Name: python-ligo-segments -Version: 1.3.0 +Version: 1.4.0 Release: 0 Summary: Representations of semi-open intervals License: GPL-3.0-only Group: Development/Languages/Python URL: https://git.ligo.org/lscsoft/ligo-segments Source: https://files.pythonhosted.org/packages/source/l/ligo-segments/ligo-segments-%{version}.tar.gz -# PATCH-FEATURE-OPENSUSE python-ligo-segments-disable-lal-tests.patch badshah...@gmail.com -- Disable tests requiring lal to avoid circular build dependency on lal (which also requires python-ligo-segments) -Patch0: python-ligo-segments-disable-lal-tests.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} +BuildRequires: fdupes BuildRequires: python-rpm-macros # SECTION For tests +%if %{with tests} +BuildRequires: %{python_module lal} BuildRequires: %{python_module pytest} +BuildRequires: %{python_module six} +%endif # /SECTION -BuildRequires: fdupes Requires: python-six %python_subpackages @@ -53,6 +62,7 @@ %python_install %python_expand %fdupes %{buildroot}%{$python_sitearch} +%if %{with tests} %check %{python_expand export PYTHON=$python export PYTHONDONTWRITEBYTECODE=1 @@ -62,12 +72,12 @@ %make_build check popd } +%endif %files %{python_files} %doc README.rst %license LICENSE %{python_sitearch}/ligo/ -%{python_sitearch}/ligo_segments-%{version}-py%{python_version}.egg-info/ -%{python_sitearch}/ligo_segments-%{version}-py%{python_version}-nspkg.pth +%{python_sitearch}/ligo_segments-%{version}-py%{python_version}.egg-info %changelog ++++++ ligo-segments-1.3.0.tar.gz -> ligo-segments-1.4.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ligo-segments-1.3.0/PKG-INFO new/ligo-segments-1.4.0/PKG-INFO --- old/ligo-segments-1.3.0/PKG-INFO 2021-01-26 10:49:09.850000000 +0100 +++ new/ligo-segments-1.4.0/PKG-INFO 2021-08-23 11:00:00.259747300 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: ligo-segments -Version: 1.3.0 +Version: 1.4.0 Summary: Representations of semi-open intervals Home-page: UNKNOWN Author: Kipp Cannon diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ligo-segments-1.3.0/debian/control new/ligo-segments-1.4.0/debian/control --- old/ligo-segments-1.3.0/debian/control 2020-10-08 23:54:33.000000000 +0200 +++ new/ligo-segments-1.4.0/debian/control 2021-05-30 12:29:06.529592000 +0200 @@ -34,7 +34,6 @@ Package: python3-ligo-segments Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}, - python3-ligo-common, python3-six Recommends: lal-python3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ligo-segments-1.3.0/ligo/segments/__init__.py new/ligo-segments-1.4.0/ligo/segments/__init__.py --- old/ligo-segments-1.3.0/ligo/segments/__init__.py 2021-01-26 10:48:52.000000000 +0100 +++ new/ligo-segments-1.4.0/ligo/segments/__init__.py 2021-08-23 10:59:12.947642300 +0200 @@ -48,7 +48,7 @@ __author__ = "Kipp Cannon <kipp.can...@ligo.org>" -__version__ = '1.3.0' +__version__ = '1.4.0' __all__ = [ @@ -78,20 +78,35 @@ This class uses comparison-by-identity rather than comparison-by-value. What this means, is there are only ever two instances of this class, representing positive and negative - infinity respectively. All other "instances" of this class are - infact simply references to one of these two, and comparisons are - done by checking which one you've got. This improves speed and - reduces memory use, and is similar in implementation to Python's - boolean True and False objects. + infinity respectively. All other "instances" of this class are in + fact references to one of these two, and comparisons are done by + checking which one you've got. This improves speed and reduces + memory use, and is similar in implementation to Python's boolean + True and False objects. The normal way to obtain references to positive or negative - infinity is to do infinity() or -infinity() respectively. It is - also possible to select the sign by passing a single numeric - argument to the constructor. The sign of the argument causes a - reference to either positive or negative infinity to be returned, - respectively. For example infinity(-1) is equivalent to - -infinity(). However, this feature is a little slower and not - recommended for normal use; it is provided only to simplify the + infinity is + + >>> infinity() + infinity + + or + + >>> -infinity() + -infinity + + respectively. It is also possible to select the sign by passing a + single numeric argument to the constructor. The sign of the + argument causes a reference to either positive or negative infinity + to be returned, respectively. For example + + >>> infinity(-1) + -infinity + >>> -infinity() + -infinity + + are equivalent. However, this feature is a little slower and not + recommended for normal use. It is provided only to simplify the pickling and unpickling of instances of the class. Example: @@ -233,23 +248,23 @@ A segment has a start and an end, and is taken to represent the range of values in the semi-open interval [start, end). Some limited arithmetic operations are possible with segments, but - because the set of (single) segments is not closed under the - sensible definitions of the standard arithmetic operations, the - behaviour of the arithmetic operators on segments may not be as you - would expect. For general arithmetic on segments, use segmentlist + because the set of (single) segments is not closed under sensible + definitions of the standard arithmetic operations, the behaviour of + the arithmetic operators on segments might not be as you would + expect. For general arithmetic on segments, use segmentlist objects. The methods for this class exist mostly for purpose of simplifying the implementation of the segmentlist class. The segment class is a subclass of the tuple built-in class - provided by Python. This means segments are immutable --- you - cannot modify a segment object after creating it, to change the - boundaries of a segment you must create a new segment object with - the desired boundaries. Like tuples, segments can be used as - dictionary keys, and like tuples the comparison used to find a - segment in the dictionary is done by value not by ID. And, like - tuples, a segment can be created from any sequence-like object by - passing it to the constructor (the sequence must have exactly two - elements in it). + provided by Python. This means segments are immutable: you cannot + modify a segment object after creating it, to change the boundaries + of a segment you must create a new segment object with the desired + boundaries. Like tuples, segments can be used as dictionary keys, + and like tuples the comparison used to find a segment in the + dictionary is done by value not by ID. And, like tuples, a segment + can be created from any sequence-like object by passing it to the + constructor, however the sequence must have exactly two elements in + it. Example: @@ -298,11 +313,8 @@ if len(args) == 1: args = args[0] if len(args) != 2: - raise TypeError("__new__() takes 2 arguments, or 1 argument when it is a sequence of length 2") - if args[0] <= args[1]: - return tuple.__new__(cls, args) - else: - return tuple.__new__(cls, (args[1], args[0])) + raise TypeError("__new__() requires 2 arguments, or 1 argument when it is a sequence of length 2") + return tuple.__new__(cls, args) if args[0] <= args[1] else tuple.__new__(cls, (args[1], args[0])) def __repr__(self): return "segment(%s, %s)" % (repr(self[0]), repr(self[1])) @@ -345,41 +357,25 @@ A return value of 0 indicates the two segments would coalesce. """ - if self[0] > other[1]: - return 1 - if self[1] < other[0]: - return -1 - return 0 + return 1 if self[0] > other[1] else -1 if self[1] < other[0] else 0 def __lt__(self, other): - if isinstance(other, tuple): - return tuple.__lt__(self, other) - return self[0] < other + return tuple.__lt__(self, other) if isinstance(other, tuple) else self[0] < other def __le__(self, other): - if isinstance(other, tuple): - return tuple.__le__(self, other) - return self[0] <= other + return tuple.__le__(self, other) if isinstance(other, tuple) else self[0] <= other def __eq__(self, other): - if isinstance(other, tuple): - return tuple.__eq__(self, other) - return self[0] == other + return tuple.__eq__(self, other) if isinstance(other, tuple) else self[0] == other def __ne__(self, other): - if isinstance(other, tuple): - return tuple.__ne__(self, other) - return self[0] != other + return tuple.__ne__(self, other) if isinstance(other, tuple) else self[0] != other def __gt__(self, other): - if isinstance(other, tuple): - return tuple.__gt__(self, other) - return self[0] > other + return tuple.__gt__(self, other) if isinstance(other, tuple) else self[0] > other def __ge__(self, other): - if isinstance(other, tuple): - return tuple.__ge__(self, other) - return self[0] >= other + return tuple.__ge__(self, other) if isinstance(other, tuple) else self[0] >= other # # From @@ -430,12 +426,13 @@ if (self[1] <= other[0]) or (self[0] >= other[1]): # self and other do not intersect return self - if (self in other) or ((self[0] < other[0]) and (self[1] > other[1])): + elif (self in other) or ((self[0] < other[0]) and (self[1] > other[1])): # result is not exactly 1 segment raise ValueError(other) - if self[0] < other[0]: + elif self[0] < other[0]: return tuple.__new__(self.__class__, (self[0], other[0])) - return tuple.__new__(self.__class__, (other[1], self[1])) + else: + return tuple.__new__(self.__class__, (other[1], self[1])) # check for proper intersection and subsetness @@ -455,12 +452,22 @@ def __contains__(self, other): """ Return True if other is wholly contained in self. If other - is an instance of the segment class or an instance of a - subclass of segment then it is treated as an interval whose - upper and lower bounds must not be outside of self, + can be unpacked as a 2-element sequence (for example, it is + an instance of the segment class or an instance of a + subclass of segment) then it is treated as an interval + whose upper and lower bounds must not be outside of self, otherwise other is compared to the bounds of self as a - scalar. + scalar (whether it is a scalar or not). """ + # benchmarks have shown that this method is overwhelmingly + # used in tests involving pairs of segment objects rather + # than in tests of scalars and segment objects, so the + # scalar case is implemented as an exception handler. + # exception handling is extraordinarily slower than a + # conditional statement, but only if the exception is + # raised. if the exception is not raised this approach is + # much faster than paying the price of the conditional + # expression, unconditionally (so to speak). try: a, b = other except (ValueError, TypeError): @@ -519,17 +526,19 @@ "coalesced" state --- consisting solely of disjoint segments listed in ascending order. Using the standard Python sequence-like operations, a segmentlist can be easily constructed that is not in - this state; for example by simply appending a segment to the end - of the list that overlaps some other segment already in the list. - The use of methods that require coalesced lists with lists that are - not coalesced has undefined results. The class provides the - .coalesce() method that can be called to put a segmentlist in the - coalesced state. All arithmetic methods return coalesced results, - so typically the .coalesce() method will be executed once after - importing a segmentlist from an untrusted source, then there is - never a need to call the .coalesce() method again as long as the - segmentlists are manipulated exclusively via the arithmetic - operators. + this state, for example by simply appending a segment to the end of + the list that overlaps some other segment already in the list. The + use of methods that require coalesced lists with lists that are not + coalesced has undefined results. For performance reasons, safety + checks for coalescedness are not included in any moethods, however + the class provides the .coalesce() method that transforms a + segmentlist into the coalesced state in-place and can be used to + sanitize segmentlist objects whose state is not known. All + arithmetic methods return coalesced results, so typically the + .coalesce() method will be executed once after importing a + segmentlist from an untrusted source, then there is never a need to + call the .coalesce() method again as long as the segmentlists are + manipulated exclusively via the arithmetic operators. Example: @@ -557,8 +566,8 @@ case of standard sequence-like objects the in operator checks for an exact match between the given item and one of the contents of the list; for segmentlists, the in operator - checks if the given item is contained within any of the - segments in the segmentlist. + checks if the given item is or sequence of items are + contained within any of the segments in the segmentlist. """ if isinstance(item, self.__class__): return all(seg in self for seg in item) @@ -853,7 +862,7 @@ # if either has zero length, the answer is False. we know # our bool() tests our length, but we use len() on other # explicitly to avoid allowing arithmetic to succeed on - # objects simply because their boolean falue is false + # objects simply because their boolean value is false if not (self and len(other)): return False # walk through both lists in order, searching for a match @@ -1332,16 +1341,21 @@ value.protract(x) return self - def extract_common(self, keys): + def extract_common(self, keys, n = None): """ Return a new segmentlistdict containing only those segmentlists associated with the keys in keys, with each set to their mutual intersection. The offsets are - preserved. + preserved. If n is not None then instead of their mutual + intersection, compute the intervals in which n or more of + the segmentlists named in keys intersect. n = len(keys) is + equivalent to n = None. If keys contains repeated entries, + those segmentlists are still only considered once for the + purpose of counting n. """ keys = set(keys) new = self.__class__() - intersection = self.intersection(keys) + intersection = self.vote(keys, len(keys) if n is None else n) for key in keys: dict.__setitem__(new, key, shallowcopy(intersection)) dict.__setitem__(new.offsets, key, self.offsets[key]) @@ -1376,18 +1390,27 @@ self, other = other, self return any(a.intersects(b) for a in self for b in other) + def vote(self, keys, n): + """ + Return the intervals when n or more of the segment lists + identified by keys are on. Each segment list casts as many + votes as the number of times it appears in keys. + + See also .intersection(). + """ + from .utils import vote + return vote([self[key] for key in keys], n) + def intersection(self, keys): """ Return the intersection of the segmentlists associated with the keys in keys. + + See also .vote(). This method is equivalent to .vote(keys, + len(keys)) with keys uniquified. """ keys = set(keys) - if not keys: - return segmentlist() - seglist = shallowcopy(self[keys.pop()]) - for key in keys: - seglist &= self[key] - return seglist + return self.vote(keys, len(keys)) def union(self, keys): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ligo-segments-1.3.0/ligo/segments/utils.py new/ligo-segments-1.4.0/ligo/segments/utils.py --- old/ligo-segments-1.3.0/ligo/segments/utils.py 2020-10-08 23:54:33.000000000 +0200 +++ new/ligo-segments-1.4.0/ligo/segments/utils.py 2021-05-30 12:29:06.533592200 +0200 @@ -90,7 +90,7 @@ def fromlalcache(cachefile, coltype = int): """ Construct a segmentlist representing the times spanned by the files - identified in the LAL cache contained in the file object file. The + named in the LAL cache contained in the file object cachefile. The segmentlist will be created with segments whose boundaries are of type coltype, which should raise ValueError if it cannot convert its string argument. @@ -112,9 +112,9 @@ # -def fromsegwizard(file, coltype = int, strict = True): +def fromsegwizard(fileobj, coltype = int, strict = True): """ - Read a segmentlist from the file object file containing a segwizard + Read a segmentlist from the file object fileobj containing a segwizard compatible segment list. Parsing stops on the first line that cannot be parsed (which is consumed). The segmentlist will be created with segment whose boundaries are of type coltype, which @@ -136,8 +136,10 @@ fourcolsegpat = re.compile(r"\A\s*([\d]+)\s+([\d.+-eE]+)\s+([\d.+-eE]+)\s+([\d.+-eE]+)\s*\Z") format = None l = segments.segmentlist() - for line in file: - line = commentpat.split(line)[0] + for line in fileobj: + # if part of the line is a comment, delete that part. if + # nothing remains, move on + line = commentpat.sub("", line) if not line: continue try: @@ -171,18 +173,18 @@ return l -def tosegwizard(file, seglist, header = True, coltype = int): +def tosegwizard(fileobj, seglist, header = True, coltype = int): """ - Write the segmentlist seglist to the file object file in a + Write the segmentlist seglist to the file object fileobj in a segwizard compatible format. If header is True, then the output will begin with a comment line containing column names. The segment boundaries will be coerced to type coltype and then passed to str() before output. """ if header: - file.write("# seg\tstart \tstop \tduration\n") + fileobj.write("# seg\tstart \tstop \tduration\n") for n, seg in enumerate(seglist): - file.write("%d\t%s\t%s\t%s\n" % (n, str(coltype(seg[0])), str(coltype(seg[1])), str(coltype(abs(seg))))) + fileobj.write("%d\t%s\t%s\t%s\n" % (n, str(coltype(seg[0])), str(coltype(seg[1])), str(coltype(abs(seg))))) # @@ -190,9 +192,9 @@ # -def fromtama(file, coltype = LIGOTimeGPS): +def fromtama(fileobj, coltype = LIGOTimeGPS): """ - Read a segmentlist from the file object file containing TAMA + Read a segmentlist from the file object fileobj containing TAMA locked-segments data. Parsing stops on the first line that cannot be parsed (which is consumed). The segmentlist will be created with segments whose boundaries are of type coltype, which should @@ -208,7 +210,7 @@ """ segmentpat = re.compile(r"\A\s*\S+\s+\S+\s+\S+\s+([\d.+-eE]+)\s+([\d.+-eE]+)") l = segments.segmentlist() - for line in file: + for line in fileobj: try: [tokens] = segmentpat.findall(line) l.append(segments.segment(list(map(coltype, tokens[0:2])))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ligo-segments-1.3.0/ligo-segments.spec new/ligo-segments-1.4.0/ligo-segments.spec --- old/ligo-segments-1.3.0/ligo-segments.spec 2021-01-26 10:49:09.000000000 +0100 +++ new/ligo-segments-1.4.0/ligo-segments.spec 2021-08-23 11:00:00.215747000 +0200 @@ -1,7 +1,7 @@ %global srcname ligo-segments Name: %{srcname} -Version: 1.3.0 +Version: 1.4.0 Release: 1%{?dist} Summary: Representations of semi-open intervals @@ -39,7 +39,6 @@ %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} Requires: python%{python3_pkgversion}-six -Requires: python%{python3_pkgversion}-ligo-common # not supported by old rpmbuild #Recommends: python3-lal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ligo-segments-1.3.0/ligo-segments.spec.in new/ligo-segments-1.4.0/ligo-segments.spec.in --- old/ligo-segments-1.3.0/ligo-segments.spec.in 2020-10-08 23:54:33.000000000 +0200 +++ new/ligo-segments-1.4.0/ligo-segments.spec.in 2021-05-30 12:29:06.529592000 +0200 @@ -39,7 +39,6 @@ %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} Requires: python%{python3_pkgversion}-six -Requires: python%{python3_pkgversion}-ligo-common # not supported by old rpmbuild #Recommends: python3-lal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ligo-segments-1.3.0/ligo_segments.egg-info/PKG-INFO new/ligo-segments-1.4.0/ligo_segments.egg-info/PKG-INFO --- old/ligo-segments-1.3.0/ligo_segments.egg-info/PKG-INFO 2021-01-26 10:49:09.000000000 +0100 +++ new/ligo-segments-1.4.0/ligo_segments.egg-info/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,30 +0,0 @@ -Metadata-Version: 1.1 -Name: ligo-segments -Version: 1.3.0 -Summary: Representations of semi-open intervals -Home-page: UNKNOWN -Author: Kipp Cannon -Author-email: kipp.can...@ligo.org -License: GPLv3 -Description: UNKNOWN -Platform: UNKNOWN -Classifier: Development Status :: 5 - Production/Stable -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3.4 -Classifier: Programming Language :: Python :: 3.5 -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 -Classifier: Programming Language :: Python :: 3.8 -Classifier: Programming Language :: Python :: 3.9 -Classifier: Intended Audience :: Science/Research -Classifier: Intended Audience :: End Users/Desktop -Classifier: Intended Audience :: Developers -Classifier: Natural Language :: English -Classifier: Topic :: Scientific/Engineering -Classifier: Topic :: Scientific/Engineering :: Astronomy -Classifier: Topic :: Scientific/Engineering :: Physics -Classifier: Operating System :: POSIX -Classifier: Operating System :: Unix -Classifier: Operating System :: MacOS -Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ligo-segments-1.3.0/ligo_segments.egg-info/SOURCES.txt new/ligo-segments-1.4.0/ligo_segments.egg-info/SOURCES.txt --- old/ligo-segments-1.3.0/ligo_segments.egg-info/SOURCES.txt 2021-01-26 10:49:09.000000000 +0100 +++ new/ligo-segments-1.4.0/ligo_segments.egg-info/SOURCES.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,32 +0,0 @@ -LICENSE -MANIFEST.in -README.rst -ligo-segments.spec -ligo-segments.spec.in -setup.py -debian/changelog -debian/compat -debian/control -debian/copyright -debian/rules -debian/source/format -debian/source/options -ligo/__init__.py -ligo/segments/__init__.py -ligo/segments/utils.py -ligo_segments.egg-info/PKG-INFO -ligo_segments.egg-info/SOURCES.txt -ligo_segments.egg-info/dependency_links.txt -ligo_segments.egg-info/namespace_packages.txt -ligo_segments.egg-info/requires.txt -ligo_segments.egg-info/top_level.txt -src/infinity.c -src/segment.c -src/segmentlist.c -src/segments.c -src/segments.h -test/.coverage -test/Makefile -test/segments_utils_verify.py -test/segments_verify.py -test/verifyutils.py \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ligo-segments-1.3.0/ligo_segments.egg-info/dependency_links.txt new/ligo-segments-1.4.0/ligo_segments.egg-info/dependency_links.txt --- old/ligo-segments-1.3.0/ligo_segments.egg-info/dependency_links.txt 2021-01-26 10:49:09.000000000 +0100 +++ new/ligo-segments-1.4.0/ligo_segments.egg-info/dependency_links.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ligo-segments-1.3.0/ligo_segments.egg-info/namespace_packages.txt new/ligo-segments-1.4.0/ligo_segments.egg-info/namespace_packages.txt --- old/ligo-segments-1.3.0/ligo_segments.egg-info/namespace_packages.txt 2021-01-26 10:49:09.000000000 +0100 +++ new/ligo-segments-1.4.0/ligo_segments.egg-info/namespace_packages.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -ligo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ligo-segments-1.3.0/ligo_segments.egg-info/requires.txt new/ligo-segments-1.4.0/ligo_segments.egg-info/requires.txt --- old/ligo-segments-1.3.0/ligo_segments.egg-info/requires.txt 2021-01-26 10:49:09.000000000 +0100 +++ new/ligo-segments-1.4.0/ligo_segments.egg-info/requires.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -six diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ligo-segments-1.3.0/ligo_segments.egg-info/top_level.txt new/ligo-segments-1.4.0/ligo_segments.egg-info/top_level.txt --- old/ligo-segments-1.3.0/ligo_segments.egg-info/top_level.txt 2021-01-26 10:49:09.000000000 +0100 +++ new/ligo-segments-1.4.0/ligo_segments.egg-info/top_level.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -ligo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ligo-segments-1.3.0/setup.cfg new/ligo-segments-1.4.0/setup.cfg --- old/ligo-segments-1.3.0/setup.cfg 2021-01-26 10:49:09.850000000 +0100 +++ new/ligo-segments-1.4.0/setup.cfg 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -[egg_info] -tag_build = -tag_date = 0 - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ligo-segments-1.3.0/setup.py new/ligo-segments-1.4.0/setup.py --- old/ligo-segments-1.3.0/setup.py 2021-01-26 10:48:52.000000000 +0100 +++ new/ligo-segments-1.4.0/setup.py 2021-08-23 10:59:19.627657200 +0200 @@ -17,7 +17,7 @@ import os.path import re -from setuptools import setup, Extension +from distutils.core import setup, Extension import sys Binary files old/ligo-segments-1.3.0/test/.coverage and new/ligo-segments-1.4.0/test/.coverage differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ligo-segments-1.3.0/test/Makefile new/ligo-segments-1.4.0/test/Makefile --- old/ligo-segments-1.3.0/test/Makefile 2020-10-08 23:54:33.000000000 +0200 +++ new/ligo-segments-1.4.0/test/Makefile 2021-08-23 08:16:32.894062800 +0200 @@ -1,4 +1,4 @@ -PYTHON ?= python +PYTHON ?= python3 check : \ segments_verify \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ligo-segments-1.3.0/test/segments_verify.py new/ligo-segments-1.4.0/test/segments_verify.py --- old/ligo-segments-1.3.0/test/segments_verify.py 2020-10-08 23:54:33.000000000 +0200 +++ new/ligo-segments-1.4.0/test/segments_verify.py 2021-08-23 08:29:49.823817000 +0200 @@ -16,24 +16,25 @@ try: - import builtins + import builtins except ImportError: - import __builtin__ as builtins + import __builtin__ as builtins else: - from importlib import reload + from importlib import reload realimport = builtins.__import__ -def no_c_library(name, globals=None, locals=None, fromlist=(), level=0): - if name == '__segments': # refuse to load C segments library - raise ImportError - return realimport( - name, - globals=globals, - locals=locals, - fromlist=fromlist, - level=level) +def no_c_library(name, globals = None, locals=None, fromlist = (), level = 0): + if name == '__segments': # refuse to load C segments library + raise ImportError + return realimport( + name, + globals = globals, + locals = locals, + fromlist = fromlist, + level = level + ) # @@ -105,9 +106,13 @@ self.assertGreater(a, 0) self.assertEqual(a, a) - @unittest.skipIf(sys.version_info.major >= 3, - 'Python 3 does not have cmp') def test__cmp__(self): + try: + cmp() + except NameError: + # Python 3 does not have cmp() builtin + def cmp(a, b): + return (a > b) - (a < b) a = segments.infinity() self.assertEqual( 0, cmp(-a, -a)) self.assertEqual(-1, cmp(-a, 0)) @@ -246,14 +251,17 @@ self.assertEqual(False, [-1, 6] in segments.segment(0, 4)) self.assertEqual(True, 2 in segments.segment(0, 4)) - # Paraphrasing the documentation for glue.segment.__contains__ - # in ligo/segments.py: if a is a segment or a sequence of length two, - # then `a in b` tests if `b[0] <= a[0] <= a[1] <= b[1]`. Otherwise, - # `a in b` tests if `b[0] <= a <= b[1]`. The following four tests - # happen to work and return False in Python 2, but they raise - # a TypeError in Python 3 because Python does not permit comparisons - # of numbers with sequences. The exception message is - # "'<' not supported between instances of 'list' and 'int'". + # Paraphrasing the documentation for + # glue.segment.__contains__ in ligo/segments.py: if a is a + # segment or a sequence of length two, then `a in b` tests + # if `b[0] <= a[0] <= a[1] <= b[1]`. Otherwise, `a in b` + # tests if `b[0] <= a <= b[1]`. The following four tests + # happen to work and return False in Python 2, but they + # raise a TypeError in Python 3 because Python does not + # permit comparisons of numbers with sequences. The + # exception message is "'<' not supported between instances + # of 'list' and 'int'". + if sys.version_info.major <= 2: self.assertEqual(False, [] in segments.segment(0, 4)) self.assertEqual(False, [0] in segments.segment(0, 4)) @@ -496,8 +504,14 @@ raise AssertionError("%s did not raise TypeError" % expr) self.assertEqual(eval("%s | %s" % (w, y)), segments.segmentlist([segments.segment(0, 30)])) - class test_segmentlistdict(unittest.TestCase): + @staticmethod + def random_coalesced_segmentlistdict(n): + seglists = segments.segmentlistdict() + for key in map(chr, range(65, 65 + n)): + seglists[key] = verifyutils.random_coalesced_list(random.randint(1, algebra_listlength)) + return seglists + def testextent_all(self): a = segments.segmentlistdict({"H1": segments.segmentlist(), "L1": segments.segmentlist([segments.segment(25, 35)])}) self.assertEqual(a.extent_all(), segments.segment(25, 35)) @@ -529,6 +543,15 @@ self.assertEqual(a, pickle.loads(pickle.dumps(a, protocol = 1))) self.assertEqual(a, pickle.loads(pickle.dumps(a, protocol = 2))) + def testvote(self): + seglists = self.random_coalesced_segmentlistdict(15) + seglists.vote(seglists, 6) + + def testintersection(self): + seglists = self.random_coalesced_segmentlistdict(15) + keys = ("A", "B", "C", "D") + seglists.intersection(keys) + # # Construct and run the test suite. @@ -544,6 +567,8 @@ finally: # reinstate original import builtins.__import__ = realimport + + print("testing segments module located at %s" % segments.__file__) verifyutils.segments = segments suite = unittest.TestSuite() @@ -562,6 +587,8 @@ # then with C extension implementation reload(segments) # loads C library and executes copyreg.pickle + print("testing segments module located at %s" % segments.__file__) + segments.infinity = segments.infinity segments.NegInfinity = segments.NegInfinity segments.PosInfinity = segments.PosInfinity Binary files old/ligo-segments-1.3.0/test/verifyutils.pyc and new/ligo-segments-1.4.0/test/verifyutils.pyc differ