Skip to content

Handy attribute/numpy-like statistics and mark real (S3, https) tests to slow#253

Merged
valeriupredoi merged 22 commits intomainfrom
numpy_like_stats
Apr 11, 2025
Merged

Handy attribute/numpy-like statistics and mark real (S3, https) tests to slow#253
valeriupredoi merged 22 commits intomainfrom
numpy_like_stats

Conversation

@valeriupredoi
Copy link
Collaborator

@valeriupredoi valeriupredoi commented Mar 25, 2025

Description

Contributes towards #231

A more convenient way to handle stats:

File

    active = Active(ncfile, "cl")
    result2 = active.mean[4:5, 1:2]

Dataset

    ds = pyfive.File(uri)[ncvar]
    av = Active(ds)
    av_slice_min = av.mean[3:5]

Note the components attr is all under the hood now.

The components attr is back again at the user's discretion, thanks to @davidhassell pointing out that's actually needed to be variable.

Also, I made the real S3 and https tests slow, and the GHA is now skipping them only for a PR (it runs them when we merge, and nightly). It's incredible how much variability there is in terms of running a set of such simple tests, with times ranging from a couple minutes to even 20-30min; network load is bloody big!

Skipping the https tests via slow decreases our measured coverage by 6% (from almost 92% to 86%), but that's fine, we actually run them, codecov measures coverage off the tests run in the PR.

Before you get started

Checklist

  • This pull request has a descriptive title and labels
  • This pull request has a minimal description (most was discussed in the issue, but a two-liner description is still desirable)
  • Unit tests have been added (if codecov test fails)
  • Any changed dependencies have been added or removed correctly (if need be)
  • All tests pass

@valeriupredoi valeriupredoi added the enhancement New feature or request label Mar 25, 2025
@codecov-commenter
Copy link

codecov-commenter commented Mar 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.07%. Comparing base (aa746b4) to head (683fb7c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #253      +/-   ##
==========================================
- Coverage   91.18%   85.07%   -6.11%     
==========================================
  Files           7        7              
  Lines         635      650      +15     
==========================================
- Hits          579      553      -26     
- Misses         56       97      +41     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@valeriupredoi
Copy link
Collaborator Author

@davidhassell cheers for the (verbal) review, I think I've plopped all in here for an actual review, please 🍻

@valeriupredoi valeriupredoi changed the title Handy attribute/numpy-like statistics Handy attribute/numpy-like statistics and mark real (S3, https) tests to slow Mar 26, 2025
Copy link
Collaborator

@davidhassell davidhassell left a comment

Choose a reason for hiding this comment

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

All good!

@valeriupredoi
Copy link
Collaborator Author

great many thanks @davidhassell 🍺

@valeriupredoi valeriupredoi merged commit d34d0b4 into main Apr 11, 2025
2 checks passed
@valeriupredoi valeriupredoi deleted the numpy_like_stats branch April 11, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants