Commit 730ffc51 authored by Ryan Fisher's avatar Ryan Fisher

Merge branch 'removestubs' into 'master'

Removestubs

See merge request !59
parents 86336761 6ca4cbaf
Pipeline #48928 passed with stages
in 6 minutes and 53 seconds
#!/usr/bin/python
#
# Copyright (C) 2011 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.
#
# =============================================================================
#
# Preamble
#
# =============================================================================
#
from __future__ import print_function
from optparse import OptionParser
import sys
from glue import git_version
from glue import dagfile
__author__ = "Kipp Cannon <kipp.cannon@ligo.org>"
__version__ = "git id %s" % git_version.id
__date__ = git_version.date
#
# =============================================================================
#
# Command Line
#
# =============================================================================
#
def parse_command_line():
parser = OptionParser(
version = "Name: %%prog\n%s" % git_version.verbose_msg,
usage = "%prog [options] node1 [node2 ...] <old_dag >new_dag",
description = "%prog constructs a DAG to re-run all parents of the DAG nodes named on the command line."
)
parser.add_option("--themselves", "-t", action = "store_true", help = "Rerun the named nodes.")
parser.add_option("--ancestors-of", "-a", action = "store_true", help = "Rerun the ancestors of the named nodes.")
parser.add_option("--descendants-of", "-d", action = "store_true", help = "Rerun the descendents of the named nodes.")
parser.add_option("--verbose", "-v", action = "store_true", help = "Be verbose.")
options, nodenames = parser.parse_args()
#
# check that there's something to do
#
if not (options.themselves or options.ancestors_of or options.descendants_of):
raise ValueError("nothing to do!")
if options.ancestors_of and options.descendants_of and not options.themselves:
raise ValueError("cowardly refusing to rerun both the parents and children of the named nodes without also rerunning the named nodes themselves. must include --themselves when both --ancestors-of and --descendants-of have been selected.")
#
# uniqueify the node names
#
nodenames = set(nodenames)
#
# done
#
return options, nodenames
#
# =============================================================================
#
# Process DAG
#
# =============================================================================
#
#
# command line
#
options, nodenames = parse_command_line()
#
# read original dag from stdin
#
if options.verbose:
def progress(f, n, done):
print("reading original dag from stdin ... %d lines\r" % n, end=' ', file=sys.stderr)
if done:
print(file=sys.stderr)
else:
progress = None
dag = dagfile.DAG.parse(sys.stdin, progress = progress)
if not nodenames.issubset(set(dag.nodes)):
raise ValueError("node(s) %s not found in dag" % ", ".join(sorted(nodenames - set(dag.nodes))))
#
# extract graph
#
if options.verbose:
print("extracting graph ...", file=sys.stderr)
names_to_rerun = set()
if options.ancestors_of:
names_to_rerun |= dag.get_all_parent_names(nodenames)
if options.descendants_of:
names_to_rerun |= dag.get_all_child_names(nodenames)
if options.themselves:
names_to_rerun |= nodenames
assert names_to_rerun # must not be empty
dag = dagfile.DAG.select_nodes_by_name(dag, names_to_rerun)
#
# set nodes matching the requested patterns to done, everything else to not
# done
#
if options.verbose:
print("setting jobs to done/not-done ...", file=sys.stderr)
for nodename, node in dag.nodes.items():
# FIXME: feature not implemented; all nodes marked "not done"
node.done = False
#
# write new dag to stdout
#
if options.verbose:
def progress(f, n, done):
print("writing new dag to stdout ... %d lines\r" % n, end=' ', file=sys.stderr)
if done:
print(file=sys.stderr)
else:
progress = None
dag.write(sys.stdout, progress = progress)
......@@ -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*
......@@ -30,17 +30,14 @@ usr/lib/python2*/*/lscsoft_glue-*.egg-info/requires.txt
usr/lib/python2*/*/lscsoft_glue-*.egg-info/top_level.txt
usr/lib/python2*/*/glue/cis.py
usr/lib/python2*/*/glue/cbcwebpage.py*
usr/lib/python2*/*/glue/dagfile.py*
usr/lib/python2*/*/glue/datafind.py*
usr/lib/python2*/*/glue/gpstime.py*
usr/lib/python2*/*/glue/gsiserverutils.py*
usr/lib/python2*/*/glue/lal.py*
usr/lib/python2*/*/glue/ldbd.py*
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*
......@@ -30,17 +30,14 @@ usr/lib/python3*/*/lscsoft_glue-*.egg-info/requires.txt
usr/lib/python3*/*/lscsoft_glue-*.egg-info/top_level.txt
usr/lib/python3*/*/glue/cis.py
usr/lib/python3*/*/glue/cbcwebpage.py*
usr/lib/python3*/*/glue/dagfile.py*
usr/lib/python3*/*/glue/datafind.py*
usr/lib/python3*/*/glue/gpstime.py*
usr/lib/python3*/*/glue/gsiserverutils.py*
usr/lib/python3*/*/glue/lal.py*
usr/lib/python3*/*/glue/ldbd.py*
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
......
import warnings
warnings.warn("This module is obsolete. Use gstlal.dagfile instead.", DeprecationWarning)
from gstlal.dagfile import *
......@@ -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
......
import warnings
warnings.warn("This module is obsolete. Use lalburst.offsetvector instead.", DeprecationWarning)
from lalburst.offsetvector import *
# 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