This block of code:
https://github.com/JGCRI/stitches/blob/main/stitches/fx_match.py#L314-L352
designed to print a statement if there are target windows more than 0.25degC away from Nearest Neighbor in T-dT space so user knows further validation likely warranted.
Problem:
When match_neighborhood gets called within make_recipe, this print statement causes the same row to repeat several times in the recipe dataframe. gmat_stitching (
) handles it fine because it's operating on basic dataframes and calls drop duplicates.
gridded_stitching does not because it tries to write into the same block of an xarray-structure because there is no drop_duplicates call to the recipe there.
Fix:
-
have make_recipe (https://github.com/JGCRI/stitches/blob/cb8d6ca10c66292a3824435e12a4335e070946cf/stitches/fx_recipe.py#L1023C5-L1023C17) do a final call to drop duplicates before returning the recipe
-
revise match_neighborhood block to use a package-messaging specific function rather than print, and streamline so that it is just a single message of words if any target window is further away than 0.25 from its nearest neighbor, rather than printing the data frame every time.
This block of code:
https://github.com/JGCRI/stitches/blob/main/stitches/fx_match.py#L314-L352
designed to print a statement if there are target windows more than 0.25degC away from Nearest Neighbor in T-dT space so user knows further validation likely warranted.
Problem:
When
match_neighborhoodgets called withinmake_recipe, this print statement causes the same row to repeat several times in the recipe dataframe.gmat_stitching(stitches/stitches/fx_stitch.py
Line 411 in cb8d6ca
gridded_stitchingdoes not because it tries to write into the same block of an xarray-structure because there is no drop_duplicates call to the recipe there.Fix:
have
make_recipe(https://github.com/JGCRI/stitches/blob/cb8d6ca10c66292a3824435e12a4335e070946cf/stitches/fx_recipe.py#L1023C5-L1023C17) do a final call to drop duplicates before returning the reciperevise
match_neighborhoodblock to use a package-messaging specific function rather than print, and streamline so that it is just a single message of words if any target window is further away than 0.25 from its nearest neighbor, rather than printing the data frame every time.