Remove NaN-only variables when loading online IBTrACS data#154
Remove NaN-only variables when loading online IBTrACS data#154stella-bourdin with Copilot wants to merge 8 commits into
Conversation
Co-authored-by: stella-bourdin <25610379+stella-bourdin@users.noreply.github.com>
|
@copilot
|
Co-authored-by: stella-bourdin <25610379+stella-bourdin@users.noreply.github.com>
Co-authored-by: stella-bourdin <25610379+stella-bourdin@users.noreply.github.com>
Both improvements addressed in commit cdc0a6f:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
print('Testing with the real IBTrACS file provided...') Test loading the file directly with our online functiontracks = ibtracs.online('ACTIVE', filename='/tmp/ibtracs.ACTIVE.list.v04r01.csv') print(f'Total variables after loading: {len(tracks.data_vars)}') Check for remaining NaN-only variablesnan_only_vars = [var for var in tracks.data_vars if tracks[var].isnull().all()] print(f'Number of storms: {len(tracks.groupby(sid))}')
|
|
@copilot can you check the failed checks and fix it? |
Co-authored-by: stella-bourdin <25610379+stella-bourdin@users.noreply.github.com>
Co-authored-by: stella-bourdin <25610379+stella-bourdin@users.noreply.github.com>
Fixed in commit fcb21c2. The failing checks were due to ruff formatting issues:
All CI checks now pass: |
Updated test for loading IBTrACS data to include NaN removal checks and assertions.
|
@copilot fix ruff |
Co-authored-by: stella-bourdin <25610379+stella-bourdin@users.noreply.github.com>
Fixed in commit 679cfd0. Removed trailing whitespace from the test file that was introduced in the refactoring commit. All ruff checks now pass: Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
ibtracs.online()function to remove variables with all NaN valuestest_load_ibtracs_online_removes_nan_variablesImplementation Details
The solution adds automatic filtering in the
ibtracs.online()function that:Testing Results
Successfully tested with the provided
ibtracs.ACTIVE.list.v04r01.csvfile:The filtering logic correctly identifies and removes variables from different meteorological agencies that contain no data for the specific region/time period while preserving all useful variables.
CI Checks
All checks now pass:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.