NASA-PDS / deep-archive

PDS Open Archival Information System (OAIS) utilities, including Submission Information Package (SIP) and Archive Information Package (AIP) generators
https://nasa-pds.github.io/deep-archive/
Other
7 stars 4 forks source link

Support empty collections and bundles #139

Closed nutjob4life closed 1 year ago

nutjob4life commented 1 year ago

πŸ—’οΈ Summary

Merge this to resolve #137 by handling the caseβ€”and why didn't this come up before?β€”when there are zero products in a collection. As an added bonus, we also handle the case of zero collections in a bundle.

βš™οΈ Test Data and/or Report

kelly@mirasol deep-archive % .venv/bin/pds-deep-registry-archive --url https://pds.nasa.gov/api/search/1.0 --debug --site PDS_ATM urn:nasa:pds:mer1_rmc::1.0

INFO πŸ‘Ÿ PDS Deep Registry-based Archive, version 1.1.2
DEBUG πŸ’’ command line args = Namespace(loglevel=10, include_latest_collection_only=False, url='https://pds.nasa.gov/api/search/1.0', site='PDS_ATM', bundle='urn:nasa:pds:mer1_rmc::1.0')
DEBUG πŸ€” Comprehending the registry at https://pds.nasa.gov/api/search/1.0 for urn:nasa:pds:mer1_rmc::1.0
DEBUG βš™οΈ Asking ``bundle_by_lidvid`` for urn:nasa:pds:mer1_rmc::1.0
DEBUG βš™οΈ Asking ``collections_of_a_bundle`` for urn:nasa:pds:mer1_rmc::1.0 at 0 limit 50
DEBUG βš™οΈ Asking ``products_of_a_collection`` for urn:nasa:pds:mer1_rmc:document::1.0 at 0 limit 50
DEBUG βš™οΈ Asking ``products_of_a_collection`` for urn:nasa:pds:mer1_rmc:data::1.0 at 0 limit 50
DEBUG βš™οΈ Asking ``products_of_a_collection`` for urn:nasa:pds:mer1_rmc:data::1.0 at 50 limit 50
DEBUG βš™οΈ Asking ``products_of_a_collection`` for urn:nasa:pds:mer1_rmc:miscellaneous::1.0 at 0 limit 50
DEBUG βš™οΈ Asking ``products_of_a_collection`` for urn:nasa:pds:mer1_rmc:miscellaneous::1.0 at 1 limit 50
DEBUG βš™οΈ Asking ``collections_of_a_bundle`` for urn:nasa:pds:mer1_rmc::1.0 at 3 limit 50
DEBUG βš™οΈ Creating AIP for urn:nasa:pds:mer1_rmc::1.0
DEBUG ⏲ Wrote 100 entries into the checksum manifest mer1_rmc_v1.0_20230118_checksum_manifest_v1.0.tab
INFO πŸ“„ Wrote AIP checksum manifest mer1_rmc_v1.0_20230118_checksum_manifest_v1.0.tab with 110 entries
DEBUG βš™οΈ Writing AIP transfer manifest to mer1_rmc_v1.0_20230118_transfer_manifest_v1.0.tab
DEBUG ⏲ Wrote 100 entries into the transfer manifest mer1_rmc_v1.0_20230118_transfer_manifest_v1.0.tab
INFO πŸ“„ Wrote AIP transfer manifest mer1_rmc_v1.0_20230118_transfer_manifest_v1.0.tab with 110 entries
DEBUG 🏷  Writing AIP label to mer1_rmc_v1.0_20230118_aip_v1.0.xml
INFO πŸ“„ Wrote label for them both: mer1_rmc_v1.0_20230118_aip_v1.0.xml
DEBUG βš™οΈ Creating SIP for urn:nasa:pds:mer1_rmc::1.0 (title MER1 Rover Motion Counter Data Bundle) for site PDS_ATM
DEBUG ⏲ Wrote 100 entries into the submission info file mer1_rmc_v1.0_20230118_sip_v1.0.tab
INFO πŸ“„ Wrote SIP mer1_rmc_v1.0_20230118_sip_v1.0.tab with 110 entries
INFO πŸ“„ Wrote label for SIP: mer1_rmc_v1.0_20230118_sip_v1.0.xml
DEBUG 🏷  Writing SIP label to <_io.BufferedWriter name='mer1_rmc_v1.0_20230118_sip_v1.0.xml'>
INFO πŸ‘‹ Thanks for using this program! Bye!
kelly@mirasol deep-archive % echo 😎
😎
kelly@mirasol deep-archive % 

Saving session...
...saving history...truncating history files...
...completed.

♻️ Related Issues

nutjob4life commented 1 year ago

@jimmie 🀣🀣🀣

jordanpadams commented 1 year ago

@nutjob4life as an FYI, it looks like this collection has no primary products, but does have secondary: https://pds-geosciences.wustl.edu/mer/mer1-m-eng-6-rmc-ops-v1/mer1rm_0xxx/document/collection_document_inventory.csv

these "secondary collections" (collection with only secondary products) tend to be rare, but could become more prevalent in the future. I don't know of any "secondary bundles" (bundles with only secondary collections), but good idea just building it in now.

πŸŽ‰