Skip to content

Commit

Permalink
Fix import broken by change in lscsoft-glue (gwastro#4662)
Browse files Browse the repository at this point in the history
* Drop lscsoft-glue dependency

* Glue still needed, do not drop it!
  • Loading branch information
titodalcanton authored and maxtrevor committed Apr 17, 2024
1 parent e5bea47 commit d7c55e7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 21 deletions.
2 changes: 0 additions & 2 deletions pycbc/results/render.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python

# Copyright (C) 2015 Christopher M. Biwer
#
# This program is free software; you can redistribute it and/or modify it
Expand Down
20 changes: 3 additions & 17 deletions pycbc/results/versioning.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python

# Copyright (C) 2015 Ian Harry
#
# This program is free software; you can redistribute it and/or modify it
Expand All @@ -22,8 +20,9 @@
import urllib.parse
from pycbc.results import save_fig_with_metadata, html_escape

import lal, lalframe
import pycbc.version, glue.git_version
import lal
import lalframe
import pycbc.version

def get_library_version_info():
"""This will return a list of dictionaries containing versioning
Expand Down Expand Up @@ -90,19 +89,6 @@ def add_info_new_version(info_dct, curr_module, extra_str):
pass
library_list.append(lalsimulationinfo)

glueinfo = {}
glueinfo['Name'] = 'LSCSoft-Glue'
glueinfo['ID'] = glue.git_version.id
glueinfo['Status'] = glue.git_version.status
glueinfo['Version'] = glue.git_version.version
glueinfo['Tag'] = glue.git_version.tag
glueinfo['Author'] = glue.git_version.author
glueinfo['Builder'] = glue.git_version.builder
glueinfo['Branch'] = glue.git_version.branch
glueinfo['Committer'] = glue.git_version.committer
glueinfo['Date'] = glue.git_version.date
library_list.append(glueinfo)

pycbcinfo = {}
pycbcinfo['Name'] = 'PyCBC'
pycbcinfo['ID'] = pycbc.version.version
Expand Down
3 changes: 2 additions & 1 deletion pycbc/workflow/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import lal
import lal.utils
import Pegasus.api # Try and move this into pegasus_workflow
from glue import lal as gluelal
from ligo import segments
from ligo.lw import lsctables, ligolw
from ligo.lw import utils as ligolw_utils
Expand Down Expand Up @@ -1523,6 +1522,8 @@ def convert_to_lal_cache(self):
"""
Return all files in this object as a glue.lal.Cache object
"""
from glue import lal as gluelal

lal_cache = gluelal.Cache([])
for entry in self:
try:
Expand Down
8 changes: 7 additions & 1 deletion pycbc/workflow/datafind.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import logging
from ligo import segments
from ligo.lw import utils, table
from glue import lal
from gwdatafind import find_urls as find_frame_urls
from pycbc.workflow.core import SegFile, File, FileList, make_analysis_dir
from pycbc.frame import datafind_connection
from pycbc.io.ligolw import LIGOLWContentHandler
Expand Down Expand Up @@ -686,6 +686,8 @@ def setup_datafind_from_pregenerated_lcf_files(cp, ifos, outputDir, tags=None):
datafindOuts : pycbc.workflow.core.FileList
List of all the datafind output files for use later in the pipeline.
"""
from glue import lal

if tags is None:
tags = []

Expand Down Expand Up @@ -820,6 +822,8 @@ def get_missing_segs_from_frame_file_cache(datafindcaches):
missingFrames: Dict. of ifo keyed lal.Cache instances
The list of missing frames
"""
from glue import lal

missingFrameSegs = {}
missingFrames = {}
for cache in datafindcaches:
Expand Down Expand Up @@ -974,6 +978,8 @@ def run_datafind_instance(cp, outputDir, connection, observatory, frameType,
Cache file listing all of the datafind output files for use later in the pipeline.
"""
from glue import lal

if tags is None:
tags = []

Expand Down

0 comments on commit d7c55e7

Please sign in to comment.