-
Notifications
You must be signed in to change notification settings - Fork 361
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
Address error when no gating veto argument was given #3513
Conversation
I am not sure if this is the correct fix, was this an error in the coinc findtrigs code if the option is not given? If so what value is passed to the ReadByTemplate class? Can this not be fixed to be None? |
No, this was an error in the hdf code because when the argument is not given the |
I.e. it would be good to 1) determine what exactly is currently passed from MultiDetOptionAction if there is no value set on the command line, and 2) determine if the option can be fixed to return None if nothing is given on command line. |
OK, so the default is empty dict which is taken to be False (ie |
Or we have the default initialization of |
Would it be clearer adding
to the coinc findtrigs code? |
OK, I changed my mind since it seems easier to consider |
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 @veronica-villa for addressing it in such a short time.
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.
recommendation : change the default __init__
method to set the variable to {}
(empty dictionary) and change the switch to if self.ifo in gating_veto_windows
.
hmm, I'm not sure if we should do anything about the codeclimate warning. Probably not since we are initializing exactly once and we don't use the gating_veto_windows kwarg value for anything else in the rest of the class. |
* Address error when no gating veto argument was given * Fix error when no gating veto argument is given * add comment on default empty dict assignment * shorten too long line Co-authored-by: Thomas Dent <thomas.dent@usc.es>
* Address error when no gating veto argument was given * Fix error when no gating veto argument is given * add comment on default empty dict assignment * shorten too long line Co-authored-by: Thomas Dent <thomas.dent@usc.es>
When no --gating-veto-windows argument was given the following error arised:
Traceback (most recent call last): File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/pycbc/x86_64_rhel_7/virtualenv/pycbc-v1.16.11/bin/pycbc_multiifo_coinc_findtrigs", line 113, in <module> args.gating_veto_windows) File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/pycbc/x86_64_rhel_7/virtualenv/pycbc-v1.16.11/lib/python2.7/site-packages/pycbc/io/hdf.py", line 1012, in __init__ gating_veto = gating_veto_windows[self.ifo].split(',') AttributeError: 'NoneType' object has no attribute 'split'
This change should address the error