Skip to content

Adds flatten argument to to_numpy methods#685

Merged
sandorkertesz merged 4 commits into
developfrom
feature/684-xarray-flatten
Apr 30, 2025
Merged

Adds flatten argument to to_numpy methods#685
sandorkertesz merged 4 commits into
developfrom
feature/684-xarray-flatten

Conversation

@JamesVarndell

Copy link
Copy Markdown
Collaborator

Adds the flatten argument to xarray DataArray and Dataset wrapper classes:

  • If flatten=True, reshape the resulting NumPy array to be 1-dimensional after converting with to_numpy().
  • If flatten=False (default), maintain the current behavior and return the regular array.

See #684 for more information.

@codecov-commenter

codecov-commenter commented Apr 28, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.86%. Comparing base (006632f) to head (f5a80db).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #685   +/-   ##
========================================
  Coverage    90.85%   90.86%           
========================================
  Files          160      160           
  Lines        12136    12145    +9     
  Branches       593      593           
========================================
+ Hits         11026    11035    +9     
  Misses         930      930           
  Partials       180      180           

☔ 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.

@sandorkertesz

Copy link
Copy Markdown
Collaborator

@JamesVarndell, thank you very much for this development. Please can I ask you to add a test to tests/wrappers/test_xarray.py?

@sandorkertesz sandorkertesz merged commit 31caead into develop Apr 30, 2025
121 of 122 checks passed
@sandorkertesz sandorkertesz deleted the feature/684-xarray-flatten branch May 15, 2026 08:59
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.

3 participants