fraymio / modis-tools

Tools for working with the MODIS API and MODIS data.
Apache License 2.0
23 stars 12 forks source link

Ds 6157 url issue with modisa l3b chl #41

Closed iamchrisearle closed 11 months ago

iamchrisearle commented 11 months ago

Description

Adds in an unpacking loop to replace spaces in URLs. This happens in two places so this solution could be converted to a function. I'm looking for some input on cleaning up this solution as well, as this works but is not very clean. The dictionary unpacking lookup wasn't updating the source dictionary after looping through, so a copy is made and the indices that need to be changes are saved as a list of tuples to iterate through. The solution uses string replace which could be prone to error. I tried using something like quote() but found it was breaking other parts of the URL.

To recreate and isolate the broken URL, you can add a break point to the resources.py file where CollectionFeed is called and use step into until you reach the requests' models.py where it returns content. Content will be a json that contains the broken link as an href.

image

I have also created a draft pull request to start investigating how we could eventually update to pydantic V2. It contains jsons from this product and for another MODIS product that works as expected without this change for comparison.

Closes #38

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Checklist:

Next Steps

On behalf of the Modis Tools Dev Team, thank you for your hard work! ✨