Add VNP46A2-h11v07 recipe#217
Conversation
|
/run vnp46a2-h11v07 |
|
The test failed, but I'm sure we can find out why! Pangeo Forge maintainers are working diligently to provide public logs for contributors. |
| ''' | ||
| For each date, return the URL from the collected dictionary. | ||
| ''' | ||
| return vnp_date_dict[date]['href'] |
There was a problem hiding this comment.
@jzavala-gonzalez, the latest test run failed due to a NameError. This isn't necessary a Python problem but one of the quirks of apache-beam: accessing variables defined in the global scope from a function scope seems to be a problem for apache-beam. one solution is to find a way to move vnp_date_dict from the global scope into make_full_path function scope by
- defining
vnp_date_dictinsidemake_full_pathor - passing
vpn_date_dictas an argument tomake_full_path
File "/usr/local/lib/python3.9/dist-packages/pangeo_forge_recipes/executors/beam.py", line 40, in exec_stage
File "/srv/conda/envs/notebook/lib/python3.9/site-packages/pangeo_forge_recipes/recipes/xarray_zarr.py", line 155, in cache_input
fname = config.file_pattern[input_key]
File "/srv/conda/envs/notebook/lib/python3.9/site-packages/pangeo_forge_recipes/patterns.py", line 219, in __getitem__
fname = self.format_function(**format_function_kwargs)
File "/tmp/tmpxgkkg7a3/recipes/vnp46a2-h11v07/recipe.py", line 77, in make_full_path
NameError: name 'vnp_date_dict' is not defined [while running 'Start|cache_input|Reshuffle_000|prepare_target|Reshuffle_001|store_chunk|Reshuffle_002|finalize_target|Reshuffle_003/cache_input/Execute-ptransform-56']There was a problem hiding this comment.
if you decide to go with option 2), i'm curious as to whether the following would work
import functools
....
print('Earliest date:', min(vnp_dates).strftime('%Y-%m-%d'))
print('Latest date: ', max(vnp_dates).strftime('%Y-%m-%d'))
def make_full_path(date: datetime.date, vnp_date_dict=None) -> str:
return vnp_date_dict[date]['href']
...
make_full_path = functoos.partial(make_full_path, vnp_date_dict=vnp_date_dict)
....
There was a problem hiding this comment.
Option 2 looks to be working for the pattern function as you wrote. I suspected the same would happen for the process_input function, add_date_dimension, but during the init of the XarrayZarrRecipe it's attempting unsuccesfully to JSON serialize that partial function (TypeError: object of type partial not serializable). In that second function it's much easier to adjust to not call global so I applied option 1 for that instead.
Hi everyone. Thanks for developing pangeo-forge-recipes! It's been really helpful for simplifying the download of this dataset. And especially thanks to @briannapagan and @yuvipanda since this recipe is heavily based off their implementation for the GPM IMERG (#190 ) dataset and usage of CMR's GranuleQuery.
Here are some notes and questions to keep in mind with this recipe:
Thank you for your time!!