Skip to content

Commit

Permalink
revert change to workflow.core
Browse files Browse the repository at this point in the history
  • Loading branch information
GarethCabournDavies committed Jan 16, 2025
1 parent f23706f commit fb5bbc3
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions pycbc/workflow/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1122,13 +1122,12 @@ def __init__(self, ifos, exe_name, segs, file_url=None,
exe_name: string
A short description of the executable description, tagging
only the program that ran this job.
segs : igwn_segments.segment or igwn_segments.segmentlist or None
segs : igwn_segments.segment or igwn_segments.segmentlist
The time span that the OutFile is valid for. Note that this is
*not* the same as the data that the job that made the file reads in.
Lalapps_inspiral jobs do not analyse the first an last 72s of the
data that is read, and are therefore not valid at those times. If
the time is not continuous a segmentlist can be supplied.
If None is given, the time is not used in the output filename
file_url : url (optional, default=None)
If this is *not* supplied, extension and directory must be given.
If specified this explicitly points to the url of the file, or the
Expand Down Expand Up @@ -1286,19 +1285,13 @@ def _filename(self, ifo, description, extension, segment):

# Follow the frame convention of using integer filenames,
# but stretching to cover partially covered seconds.
# The if statement allows us to use a filename which doesn't
# have a time associated to it
start = int(segment[0])
end = int(math.ceil(segment[1]))
if (end-start) > 0 and segment[0] > 0:
duration = end - start
time_str = f"-{start}-{duration}"
else:
# This comes about when we haven't defined a time range for
# the file, so don't add any information
time_str = ""
duration = str(end-start)
start = str(start)

return "%s-%s%s.%s" % (ifo, description.upper(), time_str, extension)
return "%s-%s-%s-%s.%s" % (ifo, description.upper(), start,
duration, extension)

@classmethod
def from_path(cls, path, attrs=None, **kwargs):
Expand Down

0 comments on commit fb5bbc3

Please sign in to comment.