-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run conversion on all hdf injection files, allowing LVK injection format hdf files to be used #4455
Conversation
Would be good to get a check from Tom or the Rates team in terms of what to expect here .... and to check nothing else has changed! |
I'm also hitting an error in https://github.com/gwastro/pycbc/blame/master/pycbc/inject/inject.py#L372 - where it uses |
[:] would be wrong as these should be scalars.
…On Thu, Aug 10, 2023 at 11:46 AM Gareth S Cabourn Davies < ***@***.***> wrote:
I'm also hitting an error in
https://github.com/gwastro/pycbc/blame/master/pycbc/inject/inject.py#L372
- where it uses [()], it seems like it should be [:] - in fact that's
what it used to be?
—
Reply to this email directly, view it on GitHub
<#4455 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ2WRQB27QQFMBKTHX4YMDXUT665ANCNFSM6AAAAAA3IPS54E>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Okay, I think I was missing |
Okay it is this line, which just returns the file without converting if it is a hdf file which we want to change as well |
I don't know if the file specification changed, or if someone changed from py2 to py3 without thinking, but this attribute is bytes in some of the examples we have been given
f207edc
to
0f8c215
Compare
This now passes injections as appropriate to the inspiral jobs |
I asked the rates team about this, they suggested to allow both bytes or string if we can |
pycbc/workflow/injection.py
Outdated
@@ -147,12 +147,9 @@ def cut_distant_injections(workflow, inj_file, out_dir, tags=None): | |||
return node.output_files[0] | |||
|
|||
def inj_to_hdf(workflow, inj_file, out_dir, tags=None): | |||
""" Convert injection file to hdf format if not already one | |||
""" Convert injection file to hdf format, if it is already one, | |||
this just makes a copy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstring naming convention says that line 1 should be a single sentence.
So this should really be:
""" Convert injection file to hdf format.
If the file is already PyCBC HDF format, this will just make a copy.
"""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, merge when ready.
This PR also runs conversion on all HDF files, allowing us to actually use LVK injection files, which is more than just a metadata naming correction patch as the title now suggests.
Good point - I have updated the title of the PR to reflect this |
…mat hdf files to be used (gwastro#4455) * Allow bytes in LVK injection format hdf I don't know if the file specification changed, or if someone changed from py2 to py3 without thinking, but this attribute is bytes in some of the examples we have been given * Dont assume a hdf is pycbc-style injections * Update pycbc/workflow/injection.py
…mat hdf files to be used (gwastro#4455) * Allow bytes in LVK injection format hdf I don't know if the file specification changed, or if someone changed from py2 to py3 without thinking, but this attribute is bytes in some of the examples we have been given * Dont assume a hdf is pycbc-style injections * Update pycbc/workflow/injection.py
…mat hdf files to be used (gwastro#4455) * Allow bytes in LVK injection format hdf I don't know if the file specification changed, or if someone changed from py2 to py3 without thinking, but this attribute is bytes in some of the examples we have been given * Dont assume a hdf is pycbc-style injections * Update pycbc/workflow/injection.py
I don't know if the file specification changed, or if someone changed from py2 to py3 without thinking, but this attribute is bytes in some of the examples we have been given