Commit dc0f2c44 authored by Kipp Cannon's avatar Kipp Cannon

complete the removal of the segments package

- a few last places that refer to glue.segments and glue.segmentsUtils are updated
- the subpackage is removed from the packaging scripts
parent 49b733b1
......@@ -51,8 +51,9 @@ For example,
import os,sys,optparse,re
from ligo import segments
from ligo.segments import utils as segmentsUtils
from glue import datafind
from glue import segmentsUtils,git_version
from glue import git_version
__author__ = "Scott Koranda <scott.koranda@ligo.org>, Duncan M. Macleod <duncan.macleod@ligo.org>"
__version__ = git_version.id
......
......@@ -32,7 +32,7 @@ from optparse import OptionParser
from ligo import segments
from glue import lal
from glue import segmentsUtils
from ligo.segments import utils as segmentsUtils
from glue import gpstime
import glue.pipeline
......@@ -129,7 +129,7 @@ class diskcacheEntry(object):
return self.__frame_segments__
self.__frame_segments__ = segments.segmentlist([])
for seg in self.segments:
self.__frame_segments__.extend(glue.segmentsUtils.segmentlist_range(seg[0], seg[1], self.duration))
self.__frame_segments__.extend(segmentsUtils.segmentlist_range(seg[0], seg[1], self.duration))
return self.__frame_segments__
......
......@@ -37,7 +37,7 @@ from optparse import OptionParser
from ligo import segments
from glue import lal
from glue import gpstime
from glue import segmentsUtils
from ligo.segments import utils as segmentsUtils
from glue import pidfile
from glue.ligolw import ligolw
......
......@@ -33,7 +33,7 @@ import re
from optparse import OptionParser
import ligo.segments
from glue.segmentsUtils import segmentlist_range
from ligo.segments.utils import segmentlist_range
from glue import git_version
PROGRAM_NAME = sys.argv[0].replace('./','')
......
......@@ -33,7 +33,7 @@ Depends: ${shlibs:Depends},
python-kerberos,
python-openssl,
python-six,
python-glue-segments
python-ligo-segments
Recommends: python-numpy (>= 1.0),
python-xml,
libsqlite3-0 (>= 3.3),
......@@ -44,25 +44,6 @@ Description: Grid LSC User Environment
Glue (Grid LSC User Environment) is a suite of python modules and programs to
allow users to run LSC codes on the grid.
Package: python-glue-segments
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
${python:Depends},
python-cjson,
python-openssl,
python-six,
python-ligo-segments,
python-glue-common
Recommends: python-numpy (>= 1.0),
python-xml,
libsqlite3-0 (>= 3.3),
pyrxp | python-pyrxp
Description: Grid LSC User Environment
Glue (Grid LSC User Environment) is a suite of python modules and programs to
allow users to run LSC codes on the grid.
Segments handling part.
Package: python-glue-common
Architecture: all
Depends: ${shlibs:Depends},
......@@ -88,7 +69,7 @@ Depends: ${shlibs:Depends},
python3-kerberos,
python3-openssl,
python3-six,
python3-glue-segments
python3-ligo-segments
Recommends: python3-numpy (>= 1.0),
python3-xml,
libsqlite3-0 (>= 3.3),
......@@ -99,23 +80,6 @@ Description: Grid LSC User Environment
Glue (Grid LSC User Environment) is a suite of python3 modules and programs to
allow users to run LSC codes on the grid.
Package: python3-glue-segments
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
${python3:Depends},
python3-six,
python3-ligo-segments,
python3-glue-common
Recommends: python3-numpy (>= 1.0),
python3-xml,
libsqlite3-0 (>= 3.3),
pyrxp | python3-pyrxp
Description: Grid LSC User Environment
Glue (Grid LSC User Environment) is a suite of python3 modules and programs to
allow users to run LSC codes on the grid.
Segments handling part.
Package: python3-glue-common
Architecture: all
Depends: ${shlibs:Depends},
......
usr/lib/python2*/*/glue/segments.py*
#usr/lib/python2*/*/src/segments*
#usr/lib/python2*/*/test*
......@@ -40,7 +40,6 @@ usr/lib/python2*/*/glue/markup.py*
usr/lib/python2*/*/glue/offsetvector.py*
usr/lib/python2*/*/glue/pidfile.py*
usr/lib/python2*/*/glue/pipeline.py*
usr/lib/python2*/*/glue/segmentsUtils.py*
usr/lib/python2*/*/glue/text_progress_bar.py*
usr/lib/python2*/*/glue/utils.py*
usr/lib/python2*/*/glue/workflow.py
......
usr/lib/python3*/*/glue/segments.py*
#usr/lib/python3*/*/src/segments*
#usr/lib/python3*/*/test*
......@@ -40,7 +40,6 @@ usr/lib/python3*/*/glue/markup.py*
usr/lib/python3*/*/glue/offsetvector.py*
usr/lib/python3*/*/glue/pidfile.py*
usr/lib/python3*/*/glue/pipeline.py*
usr/lib/python3*/*/glue/segmentsUtils.py*
usr/lib/python3*/*/glue/text_progress_bar.py*
usr/lib/python3*/*/glue/utils.py*
usr/lib/python3*/*/glue/workflow.py
......
......@@ -19,7 +19,6 @@ export PYBUILD_AFTER_TEST := env \
-o ligolw_test01 \
-o test_ligolw_lsctables \
-o test_ligolw_table \
-o segmentsUtils_verify \
-o test_ligolw_utils_segments
# Redirect Python 3 packages to a directory that we are going to ignore.
......
......@@ -7,7 +7,7 @@ Group: Development/Libraries
Source: lscsoft-%{name}-%{version}.tar.gz
Url: http://www.lsc-group.phys.uwm.edu/daswg/projects/glue.html
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Requires: python-cjson pyOpenSSL numpy python-six glue-common glue-segments python >= 2.7
Requires: python-cjson pyOpenSSL numpy python-six glue-common python >= 2.7
BuildRequires: python-rpm-macros
BuildRequires: python3-rpm-macros
BuildRequires: python-devel
......@@ -34,7 +34,6 @@ Requires: python%{python3_pkgversion}
Requires: python%{python3_pkgversion}-numpy
Requires: python%{python3_pkgversion}-six
Requires: python%{python3_pkgversion}-glue-common
Requires: python%{python3_pkgversion}-glue-segments
%{?python_provide:%python_provide python%{python3_pkgversion}-glue}
%description -n python%{python3_pkgversion}-glue
Glue (Grid LSC User Environment) is a suite of python modules and programs to
......@@ -58,24 +57,6 @@ Requires: python%{python3_pkgversion}-six
This is for the files that are common across the glue subpackages, namely
git_version, iterutils and __init__.py
%package segments
Summary: The segments subpackage
Group: Development/Libraries
Requires: python numpy python-six python2-ligo-segments glue-common
%description segments
This is for the segments subpackage, written by Kipp.
%package -n python%{python3_pkgversion}-glue-segments
Summary: The segments subpackage
Group: Development/Libraries
Requires: python%{python3_pkgversion}
Requires: python%{python3_pkgversion}-numpy
Requires: python%{python3_pkgversion}-six
Requires: python%{python3_pkgversion}-glue-common
Requires: python%{python3_pkgversion}-ligo-segments
%description -n python%{python3_pkgversion}-glue-segments
This is for the segments subpackage, written by Kipp.
%prep
%setup -n lscsoft-%{name}-%{version}
......@@ -96,7 +77,6 @@ make -C test \
-o ligolw_test01 \
-o test_ligolw_lsctables \
-o test_ligolw_table \
-o segmentsUtils_verify \
-o test_ligolw_utils_segments
PYTHONPATH="${RPM_BUILD_ROOT}%{python3_sitearch}" \
PYTHON=%{__python3} \
......@@ -106,7 +86,6 @@ make -C test \
-o ligolw_test01 \
-o test_ligolw_lsctables \
-o test_ligolw_table \
-o segmentsUtils_verify \
-o test_ligolw_utils_segments
%clean
......@@ -121,12 +100,8 @@ rm -rf $RPM_BUILD_ROOT
%exclude %{_exec_prefix}/etc/
%exclude %{_exec_prefix}/var/
%exclude %{python2_sitearch}/glue/__init__.py*
%exclude %{python2_sitearch}/glue/segments.py*
%exclude %{python2_sitearch}/glue/iterutils.py*
%exclude %{python2_sitearch}/glue/git_version.py*
#%exclude %{_exec_prefix}/src/segments/
#%exclude %{_exec_prefix}/test/segment_verify.py
#%exclude %{_exec_prefix}/test/segmentsUtils_verify.py
#%exclude %{_exec_prefix}/test/verifyutils.py
%files -n python%{python3_pkgversion}-glue
......@@ -139,27 +114,13 @@ rm -rf $RPM_BUILD_ROOT
%exclude %{_exec_prefix}/var/
%exclude %{python3_sitearch}/glue/__init__.py
%exclude %{python3_sitearch}/glue/__pycache__/__init__.cpython-%{python3_version_nodots}.py?
%exclude %{python3_sitearch}/glue/segments.py
%exclude %{python3_sitearch}/glue/__pycache__/segments.cpython-%{python3_version_nodots}.py?
%exclude %{python3_sitearch}/glue/iterutils.py
%exclude %{python3_sitearch}/glue/__pycache__/iterutils.cpython-%{python3_version_nodots}.py?
%exclude %{python3_sitearch}/glue/git_version.py
%exclude %{python3_sitearch}/glue/__pycache__/git_version.cpython-%{python3_version_nodots}.py?
#%exclude %{_exec_prefix}/src/segments/
#%exclude %{_exec_prefix}/test/segment_verify.py
#%exclude %{_exec_prefix}/test/segmentsUtils_verify.py
#%exclude %{_exec_prefix}/test/verifyutils.py
%files segments
%license LICENSE
%{python2_sitearch}/glue/segments.py
%{python2_sitearch}/glue/segments.pyc
%files -n python%{python3_pkgversion}-glue-segments
%license LICENSE
%{python3_sitearch}/glue/segments.py
%{python3_sitearch}/glue/__pycache__/segments.cpython-%{python3_version_nodots}.pyc
%files common
%license LICENSE
%{python2_sitearch}/glue/__init__.py
......
......@@ -1276,20 +1276,20 @@ class SnglBurstTable(table.Table):
def get_period(self):
"""@returns: the period segment of each row in the table
@returntype: glue.segments.segmentlist
@returntype: ligo.segments.segmentlist
"""
return segments.segmentlist([row.get_period() for row in self])
def get_ms_period(self):
"""@returns: the period segment for the most significant tile
of each row in the table
@returntype: glue.segments.segmentlist
@returntype: ligo.segments.segmentlist
"""
return segments.segmentlist([row.get_ms_period() for row in self])
def get_band(self):
"""@returns: the frequency band of each row in the table
@returntype: glue.segments.segmentlist
@returntype: ligo.segments.segmentlist
"""
return segments.segmentlist([row.get_band() for row in self])
......@@ -3581,7 +3581,7 @@ class Segment(table.Table.RowType):
>>> Segment(20, 30).segment
segment(LIGOTimeGPS(20, 0), LIGOTimeGPS(30, 0))
>>> # use as a segment object in segmentlist operations
>>> from glue import segments
>>> from ligo import segments
>>> x = segments.segmentlist([Segment(0, 10), Segment(20, 30)])
>>> abs(x)
LIGOTimeGPS(20, 0)
......@@ -3647,7 +3647,7 @@ class Segment(table.Table.RowType):
"""
self.segment = segment
# emulate a glue.segments.segment object
# emulate a ligo.segments.segment object
def __abs__(self):
return abs(self.segment)
......
......@@ -35,7 +35,7 @@ from ligo import segments
from glue import git_version
from glue import iterutils
from glue import segmentsUtils
from ligo.segments import utils as segmentsUtils
from .. import ligolw
from .. import lsctables
......@@ -324,7 +324,7 @@ class LigolwSegmentList(object):
class LigolwSegments(set):
"""
An interface shim between code that makes use of segments in
glue.segments form, and LIGO Light-Weight XML I/O code.
ligo.segments form, and LIGO Light-Weight XML I/O code.
This class is "attached" to an XML document object, at which time
it parses and extracts the segment lists from the document, and
......
# Copyright (C) 2006 Kipp Cannon
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import warnings
from ligo.segments import *
warnings.warn('glue.segments has been renamed ligo.segments',
DeprecationWarning)
import warnings
warnings.warn("This module is obsolete. Use ligo.segments.utils instead.", DeprecationWarning)
from ligo.segments.utils import *
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment