use index for position
MODIFY
pangeo_forge/recipe.py
pangeo_forge/recipe.py
@@ -522,7 +522,7 @@ class NetCDFtoZarrMultiVarSequentialRecipe(NetCDFtoZarrRecipe):
self._init_chunks = [chunk_key for chunk_key in self._chunks_inputs if chunk_key[1] == 0]
def input_position(self, input_key):
- return input_key[1]
+ return self.input_pattern.keys[self._other_key].index(input_key[1])
def chunk_position(self, chunk_key):
return chunk_key[1]

MODIFY
tests/test_recipe.py
tests/test_recipe.py
@@ -187,7 +187,6 @@ def test_NetCDFtoZarrMultiVarSequentialRecipe(
metadata_cache = tmp_cache
target_chunks = {"time": 1}
time_index = list(range(len(paths) // 2))
- print("time_index", time_index)
pattern = VariableSequencePattern(
path_format, keys={"variable": ["foo", "bar"], "n": time_index}
)

use index for position