This repository has been archived.
This repository contains notes and code to explore the use of pangeo-forge.
After further thought and discussion with pangeo-forge contributors we concluded that the pangeo-forge approach was not well-aligned with our use-case. Notes from our discussion with pangeo-forge maintainers can be found here: https://qgreenland-net.github.io/notes/2024-04-04_pangeo-forge.html
Custom writers are currently a challenge being worked on in Pangeo Forge. While it looks
straightforward to create a custom writer, there is special logic that injects the
output directory (target_root) to writers based on a hard-coded data structure of
classes to receive injection. We reached out for support and were recommended to pursue
the following workaround (thank you, Greg!):
- Fork
pangeo-forge-recipes, add custom writerPTransformto e.g.transforms.py. - Ensure the new transform has a special argument based on this example custom writer class.
- In the fork, update
injections.pyto add our newPTransformto the static data structure. - In recipe repository, update
requirements.txtto point to the forkedpangeo-forge-runnerinstead of the official followinggit+https://github.com/...notation.
Some examples:
- Example w/o pangeo-forge-runner: https://github.com/pangeo-forge/staged-recipes/blob/gpm_pyramid/recipes/gpm/feedstock/recipe.py#L174-L212
- Similar example in pangeo-forge-recipe tests: https://github.com/pangeo-forge/pangeo-forge-recipes/blob/main/tests/test_end_to_end.py#L218-L231
This approach is ruled out because the injection happens prior to runtime.
The dependency injection approach is currently being revisited. _TODO: Link to GitHub issues/discussions where this is happening!*