NOAA_GPCC_StandardardizedPrecipitation_fix#2099
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the preprocessing script for GPCC SPI by passing 'raw=True' to the pandas 'apply' function to improve performance. The reviewer suggested a further optimization to fully vectorize the coordinate transformation logic, which would avoid the sequential row processing of 'apply' and significantly speed up execution on large datasets.
|
@gemini-code-assist review |
There was a problem hiding this comment.
Code Review
This pull request replaces the slow .apply() row-wise operation with a vectorized pandas implementation to format latitude and longitude coordinates into a 1-degree grid, removing the obsolete to_one_degree_grid_place helper function. The feedback suggests adding back explanatory comments about the coordinate transformation logic that were lost during the refactoring to ensure the code remains maintainable.
|
@gemini-code-assist review |
There was a problem hiding this comment.
Code Review
This pull request refactors the coordinate-to-grid conversion in preprocess_gpcc_spi.py by removing the helper function to_one_degree_grid_place and vectorizing the operation directly on the DataFrame using pandas operations, which improves performance. A review comment suggests wrapping the long string concatenation expression in parentheses to avoid breaking the .astype(str) call across lines, aligning with PEP 8 guidelines for better readability.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…ps://github.com/balit-raibot/data into NOAA_GPCC_StandardardizedPrecipitationIndex_fix
|
@gemini-code-assist review |
There was a problem hiding this comment.
Code Review
This pull request introduces validation configuration and golden summary reports for the GPCC SPI pipeline, updates the manifest with resource limits, and optimizes the coordinate-to-grid mapping in preprocess_gpcc_spi.py using vectorized pandas operations. Feedback on the validation configuration highlights a mismatch in the check_goldens_output_csv_gpcc_spi_aggregation rule, where the input_files parameter incorrectly references the drought events output file instead of the aggregated SPI output file.
|
@gemini-code-assist review |
There was a problem hiding this comment.
Code Review
This pull request introduces validation configurations and golden summary reports for NOAA GPCC SPI data, and optimizes the preprocessing script by vectorizing the grid coordinate calculation instead of using a row-wise .apply() function. Feedback suggests reducing the resource limits in manifest.json as the requested CPU, memory, and disk limits are excessively high for a standard import job.
Changes in this PR:
NOTE:
test env execution: https://pantheon.corp.google.com/batch/jobsDetail/regions/us-central1/jobs/noaa-gpcc-standardardizedprecipitationindex-balit-20260720-1/details?project=datcom-infosys-dev