Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • duncanmmacleod/dqsegdb-client
  • computing/dqsegdb/client
2 results
Show changes
Commits on Source (5)
......@@ -56,8 +56,9 @@ You must have pyRXP installed and in your PYTHONPATH to run %s.
%s
""" %(sys.argv[0], e), file=sys.stderr)
from gpstime import gpsnow
try:
from glue import gpstime
from glue import ldbd
from ligo import segments
from glue.ligolw import lsctables
......@@ -289,7 +290,7 @@ for line in fh.readlines():
print("\nERROR: invalid format in your --summary-file row number: %d " % line_no)
print("Invalid interval is %s" % str(sum_line))
sys.exit(1)
current_time = str(gpstime.GpsSecondsFromPyUTC(time.time()))
current_time = str(int(gpsnow()))
# make sure gps time is 9 digits
#if (len(sum_line[0])!=9 or len(sum_line[1])!=9):
......@@ -590,7 +591,7 @@ if options.insert or options.append:
insert_history_dict['insertion_metadata'] = {}
insert_history_dict['insertion_metadata']['insert_data_start'] = min(min(intervals))
insert_history_dict['insertion_metadata']['insert_data_stop'] = max(max(intervals))
insert_history_dict['insertion_metadata']['timestamp'] = current_time #_UTCToGPS(time.gmtime())
insert_history_dict['insertion_metadata']['timestamp'] = current_time
insert_history_dict['insertion_metadata']['auth_user']= USER_NAME #process.get_username()
insert_history_dict['insertion_metadata']['comment'] = '/dq/'+'/'.join([str(options.ifos),str(options.name),str(options.version)])
flag_version.insert_history.append(insert_history_dict)
......
......@@ -49,9 +49,6 @@ from functools import reduce
from ligo import segments
import time
from glue import gpstime
from glue.ligolw import ligolw
from glue.ligolw import utils
from glue.ligolw.utils import ligolw_sqlite
......@@ -62,6 +59,8 @@ from glue.segmentdb import segmentdb_utils
from glue.ligolw.utils import process
from gpstime import gpsnow
from dqsegdb import apicalls
from dqsegdb import clientutils
......@@ -271,7 +270,7 @@ if __name__ == '__main__':
allow_non_int=True
else:
allow_non_int=False
now = gpstime.GpsSecondsFromPyUTC(time.time())
now = int(gpsnow())
# 1. Load the veto file into sqlite
handle, temp_db = tempfile.mkstemp(suffix='.sqlite')
......
......@@ -6,11 +6,6 @@ Build-Depends:
debhelper (>= 9),
dh-python,
python3-all,
python3-gwdatafind,
python3-ligo-segments,
python3-lscsoft-glue (>= 3.0.1),
python3-pyrxp,
python3-pytest,
python3-setuptools,
Standards-Version: 3.9.1
X-Python-Version: >= 3.6
......@@ -20,6 +15,7 @@ Architecture: any
Depends:
${misc:Depends},
${python3:Depends},
python3-gpstime,
python3-gwdatafind,
python3-lal,
python3-ligo-segments,
......
#!/usr/bin/make -f
export PYBUILD_TEST_PYTEST = 1
export PYBUILD_DISABLE = test
%:
dh $@ --with python3 --buildsystem=pybuild
......@@ -30,12 +30,7 @@ from glue import ldbd
from ligo import segments
from glue.ligolw.utils import process
try:
from lal import UTCToGPS as _UTCToGPS
except ImportError:
# lal is optional
from glue import gpstime
_UTCToGPS = lambda utc: int(gpstime.GpsSecondsFromPyUTC(time.mktime(utc)))
from gpstime import gpsnow
from dqsegdb import urifunctions
from dqsegdb import clientutils
......@@ -620,7 +615,7 @@ def dqsegdbCascadedQuery(protocol, server, ifo, name, include_list_string, start
## Note: Using ligolw/utils/process.py method of determining time:
#meta['query_time']=query_start
#meta['query_start']=query_start
#meta['query_end']=_UTCToGPS(time.gmtime())
#meta['query_end']=int(gpsnow())
### Now that we have the meta and the flags, which include the result, we need to build up the larger JSON
#json_result={}
......@@ -1008,7 +1003,7 @@ def InsertMultipleDQXMLFileThreaded(filenames,logger,server='http://slwebtest.vi
else:
insert_history_dict['insertion_metadata']['uri'] = '/dq/'+'/'.join([str(ifo),str(name),str(version)]) # FIX make dq a constant string in case we ever change it
#print(ifo,name,version)
insert_history_dict['insertion_metadata']['timestamp'] = _UTCToGPS(time.gmtime())
insert_history_dict['insertion_metadata']['timestamp'] = int(gpsnow())
insert_history_dict['insertion_metadata']['auth_user']=process.get_username()
#if hackDec11:
# # note that this only uses one insert_history...despite
......
......@@ -21,10 +21,6 @@ BuildRequires: python%{python3_pkgversion}-pip
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-wheel
# test requirements
BuildRequires: python%{python3_pkgversion}-pyOpenSSL >= 0.14
BuildRequires: python%{python3_pkgversion}-pytest
# -- src.rpm
%description
......@@ -48,6 +44,7 @@ DQSEGDB server instances.
%package -n python%{python3_pkgversion}-%{srcname}
Summary: Python %{python3_version} client library for the DQSEGDB service
Requires: python%{python3_pkgversion}-gpstime
Requires: python%{python3_pkgversion}-gwdatafind
Requires: python%{python3_pkgversion}-lal
Requires: python%{python3_pkgversion}-ligo-segments
......@@ -75,10 +72,9 @@ sed -i '/lalsuite/d' setup.py
%py3_install_wheel %{srcname}-%{version}-*.whl
%check
cd %{_builddir} # move out of the source tree
export PYTHONPATH="%{buildroot}%{python3_sitelib}"
export PATH="%{buildroot}%{_bindir}:${PATH}"
%{__python3} -m pytest -ra -v --pyargs dqsegdb
# print the metadata
PATH="%{buildroot}%{_bindir}:${PATH}" \
%{__python3} -m pip show dqsegdb
%clean
rm -rf $RPM_BUILD_ROOT
......@@ -96,7 +92,6 @@ rm -rf $RPM_BUILD_ROOT
%license LICENSE
%doc README.md
%{python3_sitelib}/*
%exclude %{python3_sitelib}/dqsegdb/tests/__pycache__/*-PYTEST.pyc
# -- changelog
......
......@@ -38,6 +38,7 @@ setup(name=PACKAGENAME,
scripts=scripts,
setup_requires=['setuptools'],
install_requires=[
'gpstime',
'gwdatafind',
'lalsuite',
'ligo-segments',
......