SETI / rms-pds4indextools

PDS4 index tools Python module
Apache License 2.0
0 stars 0 forks source link

Bug Fixes for Several Issues #20

Closed esimpsons3ti closed 1 month ago

esimpsons3ti commented 1 month ago
  1. There was a bug that did not check the given value for --generate-label. Now there is a check, and if that value is not either Product_Ancillary or Product_Metadata_Supplemental, it will print a statement and exit:
(.venv) emiliesimpson@Emilies-MBP rms-pds4indextools % python pds4indextools/pds4_create_xml_index.py test_files/labels 'tester_label_1.xml' --output-headers-file headers.txt --output-index-file index.csv --generate-label Product_Anci

Index file generated at index.csv
XPath headers file generated at headers.txt.
"Product_Anci" is not an accepted value. Must be "Product_Ancillary" or "Product_Metadata_Supplemental".
  1. It was not clear that when a user chooses --output-headers-file and does not include --output-index-file, the program will not generate an index file. A new statement will print if --output-index-file is not used with --output-headers-file.
(.venv) emiliesimpson@Emilies-MBP rms-pds4indextools % python pds4indextools/pds4_create_xml_index.py test_files/labels 'tester_label_1.xml' --output-headers-file headers.txt 
XPath headers file generated at headers.txt.
No index file generated because --output-headers-file was provided without --output-index-file
  1. If a user chooses --output-headers-file, and then attempts to create a label file using --generate-label, there will now be a printed statement clarifying that you must include --output-index-file in the query for label generation to work:
(.venv) emiliesimpson@Emilies-MBP rms-pds4indextools % python pds4indextools/pds4_create_xml_index.py test_files/labels 'tester_label_1.xml' --output-headers-file headers.txt --generate-label Product_Ancillary 
XPath headers file generated at headers.txt.
No index file generated because --output-headers-file was provided without --output-index-file.
Label not generated. The "--output-index-file" argument is required to generate the label file.
codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 22.22222% with 14 lines in your changes missing coverage. Please review.

Project coverage is 72.04%. Comparing base (fc88c40) to head (afcc8ec).

Files Patch % Lines
pds4indextools/pds4_create_xml_index.py 22.22% 12 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #20 +/- ## ========================================== - Coverage 73.22% 72.04% -1.18% ========================================== Files 1 1 Lines 564 576 +12 Branches 128 131 +3 ========================================== + Hits 413 415 +2 - Misses 130 138 +8 - Partials 21 23 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.