Repository: gwastro/pycbc

Issue:
TransformationCatalog error when running pycbc_make_coinc_search_workflow
hello, we are using the command line (attached in a .txt file)  and correspondingly we are getting the following error (bold text):

**2022-02-24 07:20:21,635:INFO : o3_sbbh2.dax added SubWorkflow(_id=o3_sbbh2-finalization, file=o3_sbbh2-finalization.dax, is_planned=False)
Traceback (most recent call last):
  File "/home/praveen.kumar/.conda/envs/vconda/bin/pycbc_make_coinc_search_workflow", line 763, in <module>
    container.save()
  File "/home/praveen.kumar/.conda/envs/vconda/lib/python3.8/site-packages/pycbc/workflow/core.py", line 814, in save
    super(Workflow, self).save(filename=filename,
  File "/home/praveen.kumar/.conda/envs/vconda/lib/python3.8/site-packages/pycbc/workflow/pegasus_workflow.py", line 596, in save
    sub.save(root=False)
  File "/home/praveen.kumar/.conda/envs/vconda/lib/python3.8/site-packages/pycbc/workflow/core.py", line 814, in save
    super(Workflow, self).save(filename=filename,
  File "/home/praveen.kumar/.conda/envs/vconda/lib/python3.8/site-packages/pycbc/workflow/pegasus_workflow.py", line 607, in save
    fil.insert_into_dax(self._rc, self._tc)
  File "/home/praveen.kumar/.conda/envs/vconda/lib/python3.8/site-packages/pycbc/workflow/pegasus_workflow.py", line 853, in insert_into_dax
    for curr_site in site_cat.sites:
AttributeError: 'TransformationCatalog' object has no attribute 'sites'**

[run.txt](https://github.com/gwastro/pycbc/files/8140255/run.txt)



Discussion:

Resolving patch:
diff --git a/pycbc/workflow/pegasus_workflow.py b/pycbc/workflow/pegasus_workflow.py
--- a/pycbc/workflow/pegasus_workflow.py
+++ b/pycbc/workflow/pegasus_workflow.py
@@ -596,15 +596,15 @@ def save(self, filename=None, submit_now=False, plan_now=False,
             sub.save(root=False)
             # FIXME: If I'm now putting output_map here, all output_map stuff
             #        should move here.
-            sub.output_map_file.insert_into_dax(self._rc, self._tc)
+            sub.output_map_file.insert_into_dax(self._rc, self.sites)
             sub_workflow_file = File(sub.filename)
             pfn = os.path.join(os.getcwd(), sub.filename)
             sub_workflow_file.add_pfn(pfn, site='local')
-            sub_workflow_file.insert_into_dax(self._rc, self._tc)
+            sub_workflow_file.insert_into_dax(self._rc, self.sites)
 
         # add workflow input files pfns for local site to dax
         for fil in self._inputs:
-            fil.insert_into_dax(self._rc, self._tc)
+            fil.insert_into_dax(self._rc, self.sites)
 
         self._adag.add_replica_catalog(self._rc)
 
@@ -847,10 +847,10 @@ def has_pfn(self, url, site='local'):
         return (((url, site) in self.input_pfns)
                 or ((url, 'all') in self.input_pfns))
 
-    def insert_into_dax(self, rep_cat, site_cat):
+    def insert_into_dax(self, rep_cat, sites):
         for (url, site) in self.input_pfns:
             if site == 'all':
-                for curr_site in site_cat.sites:
+                for curr_site in sites:
                     rep_cat.add_replica(curr_site, self, url)
             else:
                 rep_cat.add_replica(site, self, url)


Test patch: