-
Notifications
You must be signed in to change notification settings - Fork 9
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
I393 data ingestion commands: add option -F for continue mini file from #426
Conversation
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.
This looks reasonable with few small adjustments.
ph5/utilities/segd2ph5.py
Outdated
help=("The index to continue miniPH5_xxxxx.ph5 file " | ||
"from. Do not associate with option -M. " | ||
"Ex: -F 25"), | ||
metavar="from_mini", type='int', default=None) |
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.
metavar isn't necessary for named arguments if setting to the same as the arg name
ph5/utilities/segd2ph5.py
Outdated
# from_mini and num_mini must not coexist | ||
if (NUM_MINI is not None) and (FROM_MINI is not None): | ||
raise Exception('Option -M and option -F must not be ' | ||
'used at the same time.') | ||
|
||
if ONE_PER_MINI and (FROM_MINI is None): | ||
raise Exception('Option -O must be associated with option -F.') |
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.
Mutual exclusion can be handled by argparse
https://docs.python.org/3/library/argparse.html#mutual-exclusion
ph5/utilities/segd2ph5.py
Outdated
LOGGER.error("FROM_MINI must be greater than %s, " | ||
"the highest mini file in ph5." % highestMini) | ||
EX.ph5close() | ||
return 1 |
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.
what does return 1 mean?
…to handle new errors in get_args, use sys.exit() instead of return in main()
List of checks need to be done:
You can add any more checks that you feel need too. |
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.
It looks like the -F option permits adding same DAS to new minis, making it easier to add service runs to an existing archive without having to resubmit the entire archive. Please see Working/Holly_append_test/PR426/test1. I have not validated that test archive since that is out of scope.
Overall the help is more informative and makes more sense. One small suggestion for -M flag, I think it would be good if help said also 'Recommend using when creating a new PH5' since I think that is the intended use of -M.
…test_base.create_file_list, add help to -M
To clarify, I have only tested segdtoph5 as that was the original scope of this PR and I had a set of comparison test archives. I recommend additional reviewers for the other ingestion commands. |
@hrotman-pic is going to test mstoph5 and 125atoph5 |
@hrotman-pic Thanks for your review. I already put your recommended help message to -M. I already added -M to other ingestion commands too.
All data ingestion commands can be tested in this PR (checkout branch: i393_segdtoph5_optionS) except for mstoph5 is in PR #429 (checkout branch: i393-mstoph5_optionS) |
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.
Based on the meeting, this review is requesting:
Removal of -F option for all ingestion commands changed under this PR, so that users cannot recreate the problem of data from one DAS in two or more mini files.
The changes to the help for other options, such as 'Ex: -M 38' are still useful in my view.
I am not sure about keeping 'Recommend using when creating a new PH5' for the -M option help (for all ingestion commands in this PR). If we keep it, I think it will help if the help for the -M option also says that adding new data to an existing PH5 may not create new mini files.
Going slightly out of the scope of the discussion: I think it would help standalone users to have an example of an ingestion command listed in the help, such as:
segdtoph5 -n master.ph5 -c 6 -U 18N -M 20
And to state that -S defaults to 1 if not specified in the help for -S option.
replaced with PR#434 |
What does this PR do?
Issue #393 states that segdtoph5 doesn't continue mini file (miniPH5_xxxxx.ph5) index from option
-S first_mini
. However, that option is to state the first mini file index of all. In segdtoph5 there is no option to continue mini file index from.This PR adds option
-F from_mini
to continue index for mini file from, in which the mini files created will not be greater than 100GB. This option will not be associated with option-M num_mini
.The help in segdtoph5 is modified and added example as following to avoid misleading:
This option are added to mstoph5, 130toph5, 125toph5, seg2toph5 too.
Checklist
CHANGELOG.txt
.CONTRIBUTORS.txt
.