Skip to content

Make dobs a required argument for Data - #1614

Draft
santisoler wants to merge 14 commits into
mainfrom
no-nans-in-data
Draft

santisoler wants to merge 14 commits into
mainfrom
no-nans-in-data

Conversation

@santisoler

@santisoler santisoler commented Feb 26, 2025 •

Copy link
Copy Markdown
Member

Summary

Make dobs a required argument for Data objects. Also, raise errors when trying to set Data properties dobs, noise_floor, relative_error, and standard_deviation with arrays that contain nans or infs. Add a new raise_if_nans utility function. Add tests to check if errors are raised in Data.

PR Checklist

  • If this is a work in progress PR, set as a Draft PR
  • Linted my code according to the style guides.
  • Added tests to verify changes to the code.
  • Added necessary documentation to any new functions/classes following the
    expect style.
  • Marked as ready for review (if this is was a draft PR), and converted
    to a Pull Request
  • Tagged @simpeg/simpeg-developers when ready for review.

Reference issue

What does this implement/fix?

Additional information

Raise errors when trying to set `Data` properties `dobs`,
`noise_floor`, `relative_error`, and `standard_deviation` with arrays
that contain `nan`s. Add a new `raise_if_nans` utility function. Add
tests to check if errors are raised in `Data`.
@codecov

codecov Bot commented Feb 26, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.87%. Comparing base (d84a050) to head (a242f27).
⚠️ Report is 94 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1614      +/-   ##
==========================================
- Coverage   86.58%   84.87%   -1.71%     
==========================================
  Files         409      409              
  Lines       52924    52991      +67     
  Branches     5003     5007       +4     
==========================================
- Hits        45822    44976     -846     
- Misses       5685     6597     +912     
- Partials     1417     1418       +1     

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

@santisoler

santisoler commented Feb 28, 2025 •

Copy link
Copy Markdown
Member Author

During yesterday's meeting we decided that would be better to make dobs a required argument that only takes an array (without nans or infs). To make that happen, we would need to move the indexing properties of the Data to the Survey, so users can build dobs arrays by parts before having to define the Data class itself.

I'm turning this PR into a Draft PR, since it'll need some changes to be made first.

@santisoler
santisoler marked this pull request as draft February 28, 2025 00:42
@santisoler santisoler added this to the 0.24.0 milestone Mar 10, 2025
@santisoler santisoler changed the title Raise errors when arrays of Data contain nans Make dobs a required argument for Data Mar 20, 2025
@santisoler santisoler modified the milestones: 0.24.0, 0.25.0 Apr 24, 2025
@santisoler santisoler modified the milestones: 0.25.0, 0.26.0 Oct 8, 2025
@santisoler santisoler modified the milestones: 0.26.0, 0.27.0 Sep 16, 2026
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.

1 participant