Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for HPSS #22

Merged
merged 33 commits into from
Apr 9, 2024
Merged

Conversation

DavidHuber-NOAA
Copy link
Collaborator

Description
Adds classes to interface with the hsi and htar commands with several helper methods for easier use. Resolves #2.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • pynorms
  • pytests
  • New pytests were added

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes need updates to the documentation. I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • New and existing tests pass with my changes

Copy link

codecov bot commented Apr 4, 2024

Codecov Report

Attention: Patch coverage is 23.21429% with 129 lines in your changes are missing coverage. Please review.

Project coverage is 47.99%. Comparing base (81bfec0) to head (7d7c83d).

Files Patch % Lines
src/wxflow/hsi.py 16.82% 89 Missing ⚠️
src/wxflow/htar.py 30.43% 32 Missing ⚠️
src/wxflow/fsutils.py 33.33% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #22      +/-   ##
===========================================
- Coverage    50.88%   47.99%   -2.90%     
===========================================
  Files           16       18       +2     
  Lines         1476     1642     +166     
  Branches       313      330      +17     
===========================================
+ Hits           751      788      +37     
- Misses         669      798     +129     
  Partials        56       56              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@aerorahul aerorahul left a comment

Choose a reason for hiding this comment

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

Looks good.

A few suggestions for follow-up PR:

  • in the HSI and HTAR tests, the test for put and get should be separated out, and the same with cvf, xvf and tell. They should be unit tests for the methods they call.
  • Some of the arguments that are passed to the HSI and HTAR classes could be improved for user experience. For e.g. if a user wants a verbose mode, the __init__ class should have a verbose = True|False rather than the user to know the appropriate HSI argument -e to echo every command.
  • Use None in place of empty strings "".

@DavidHuber-NOAA
Copy link
Collaborator Author

I just found a bug in Htar that I am fixing now. I will let you know when it's ready to go again. Should be soon.

@DavidHuber-NOAA
Copy link
Collaborator Author

@aerorahul Alright, it's good to go. My tests were only testing the case of sending one file to an HPSS tar archive. Expanding that to test multiple files found that each file being sent to an archive needs its own argument. The test has been updated to check for this and it passes on Hera.

Comment on lines +147 to +148
target = str(target)
source = str(source)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this necessary since the type is str as defined in the method signature?
If this could be a Path, then it makes sense.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The pytests define these inputs as Paths. The signature is a suggestion -- Python will accept whatever type you throw at it.

src/wxflow/hsi.py Outdated Show resolved Hide resolved
Copy link
Contributor

@aerorahul aerorahul left a comment

Choose a reason for hiding this comment

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

looks good.

@aerorahul aerorahul merged commit 63db259 into NOAA-EMC:develop Apr 9, 2024
7 of 9 checks passed
@DavidHuber-NOAA DavidHuber-NOAA deleted the feature/hsi branch May 3, 2024 12:24
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.

Add HPSS support
2 participants