Skip to content

Improve portability w/ hdw file download#438

Merged
carleyjmartin merged 5 commits into
SuperDARN:developfrom
Wtristen:hdw-refactor
May 1, 2026
Merged

Improve portability w/ hdw file download#438
carleyjmartin merged 5 commits into
SuperDARN:developfrom
Wtristen:hdw-refactor

Conversation

@Wtristen
Copy link
Copy Markdown
Contributor

@Wtristen Wtristen commented Mar 5, 2026

Scope

Modified pydarn.utils.superdar_radars.py 'get_hdw_files' to improve code portability between OS platforms.
This does not change hdw files themselves or affect any other part of pydarn. The solution replaces external command-line dependencies curl and unzip in get_hdw_files with native python modules urllib.request and zipfile.

issue:
Resolves issue #402 and anticipated portability bugs with use of curl and string path (replaced with os.path)

Approval

Number of approvals: number of approvals before one can merge the code

Test

matplotlib version:
Note testers: please indicate what version of matplotlib you are using

provide a list or code to test

Code to test was uploaded under test/test_hdw.py. To reproduce the issue, use a platform that does not include unzip or curl or one that does not support '/' paths (like old windows I believe); and ensure your hdw directory is empty.

*Reminder, please check your code is:

  • copyrighted (if applicable)
  • Appropriate disclaimer added
  • Modification line filled in (if applicable)*

@Wtristen
Copy link
Copy Markdown
Contributor Author

Wtristen commented Mar 5, 2026

Sorry if I've goofed something up! This is the first pull-request I've ever attempted and I'm generally new to version control.

Copy link
Copy Markdown
Collaborator

@carleyjmartin carleyjmartin left a comment

Choose a reason for hiding this comment

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

Installed and imported no issue, installed hdw files on installation no issue.
Removed hdw files and used get_hdw_files() with no issues also.

For now I would remove the test_hdw file, or you can look into pytest and redo it to look similar to the other test files so it works with pytest. It can also be added as a test within test_utils too if that's easier?

Comments and suggestions are just keeping style consistent and tidying. I use flake8 to check pep8 styling if, which you can install with pip and run like flake8 file.py and it will give you places to check.

Great PR!

Comment thread pydarn/utils/superdarn_radars.py Outdated
Comment thread pydarn/utils/superdarn_radars.py Outdated
Wtristen and others added 3 commits April 8, 2026 10:19
Co-authored-by: Carley <60905856+carleyjmartin@users.noreply.github.com>
Co-authored-by: Carley <60905856+carleyjmartin@users.noreply.github.com>
removed test_hdw.py added by this pull request
@Wtristen
Copy link
Copy Markdown
Contributor Author

Wtristen commented Apr 8, 2026

I believe I've implemented the changes recommended by @carleyjmartin on notation and I've removed the test_hdw.py file that I had previously added in this branch.

Copy link
Copy Markdown
Collaborator

@carleyjmartin carleyjmartin left a comment

Choose a reason for hiding this comment

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

Same tests as before, all good.

I should probably find a windows PC to test this on...

@carleyjmartin carleyjmartin merged commit 48bb6b0 into SuperDARN:develop May 1, 2026
1 check passed
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