Skip to content

Conversation

@Rafnuss
Copy link
Owner

@Rafnuss Rafnuss commented Jul 27, 2025

Memory Optimization on Graph Creation

  • Replaced the use of geosphere functions with custom memory-efficient implementations for distance and bearing calculations.
  • Improved graph creation by introducing distance filtering before distance calculation and adding progress messages for better user feedback. [1] [2] [3]
  • Added cleanup steps (rm and gc) in the edge_add_wind function to free memory by removing unused variables and closing netCDF files. [1] [2] [3] [4] [5]

Simplification and Cleanup

  • Removed redundant retry logic in httr2 requests across multiple functions (geopressure_map_mismatch, geopressure_timeseries) to simplify the code. [1] [2] [3] [4]
  • Refactored graph_add_wind to use ellipsis (...) for parameter passing, simplifying the function signature and improving flexibility. [1] [2] [3]

Rafnuss added 12 commits July 23, 2025 19:57
Added an assertion to ensure all flight durations are positive. Enhanced progress messages for node creation and trimming, and improved node presence checks with detailed output of remaining nodes per step.
Eliminated the use of httr2::req_retry in geopressure_map_mismatch, geopressure_timeseries, and path2elevation functions to simplify request handling and avoid automatic retries.
The function geopressureviz now calls tag2path with interp = 1 when path is NULL, ensuring consistent interpolation behavior.
Replaces ggplot2::ggtitle with plotly::layout for setting plot titles in documentation examples, ensuring consistency with plotly-based visualizations.
Refactored graph_create to use memory-efficient chunked distance and bearing calculations via new graph_create_distance.R. Deprecated geosphere_dist, geosphere_bearing, and workers arguments, updating documentation and warnings. Enhanced progress reporting and memory cleanup in edge_add_wind. Updated graph_add_wind to use ... for edge_add_wind parameters. These changes address memory issues with large graphs and improve overall performance and maintainability.
Marked several arguments as deprecated in documentation and updated their usage to use lifecycle::deprecated(). Improved documentation for memory management in graph_create_distance.R and clarified default values. Updated example plots in twilight_label_read.Rd to use plotly instead of ggplot2. Changed default ERA5 dataset in pressurepath_create.Rd from 'both' to 'land'.
Update CITATION.cff and DESCRIPTION files to reflect new package version 3.4.3.
Copilot AI review requested due to automatic review settings July 27, 2025 12:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the GeoPressureR package to version 3.4.3, implementing significant memory optimization improvements and API modernization.

  • Replaced external geosphere package dependencies with custom memory-efficient Haversine distance and bearing calculations
  • Deprecated parallel processing functionality and removed multisession workers to prevent memory issues
  • Updated documentation examples to use plotly instead of ggplot2 for interactive visualizations

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
DESCRIPTION Version bump to 3.4.3
CITATION.cff Updated version reference to 3.4.3
man/*.Rd Updated documentation to reflect deprecated parameters and new plotting examples
R/graph_create_distance.R New file implementing custom memory-efficient coordinate calculations with automatic chunking
R/graph_create.R Major refactor replacing geosphere functions with custom implementations and removing parallel processing
R/graph_add_wind.R Simplified API using inheritDotParams and improved memory management
R/edge_add_wind.R Enhanced memory management with explicit cleanup and garbage collection
R/pressurepath_create.R Changed default ERA5 dataset and removed retry logic
R/geopressureviz.R Updated path interpolation parameter
R/*.R Various deprecation updates and memory cleanup improvements

Rafnuss added 6 commits July 27, 2025 15:15
Improves the accuracy of groundspeed computation by adjusting the logic for minimum distance and resolution handling. Removes unnecessary variables and updates cleanup steps to optimize memory usage.
Eliminated memory monitoring debug code from graph_create.R for cleaner output. Updated usage of deprecated() to lifecycle::deprecated() in tag_download_wind.R and its documentation for consistency with lifecycle package.
@Rafnuss Rafnuss merged commit 80af287 into master Aug 5, 2025
6 checks passed
@Rafnuss Rafnuss deleted the dev branch August 5, 2025 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants