Skip to content

GEOPY-2701: Export best match models as Maxwell plates#342

Open
domfournier wants to merge 20 commits intodevelopfrom
GEOPY-2701
Open

GEOPY-2701: Export best match models as Maxwell plates#342
domfournier wants to merge 20 commits intodevelopfrom
GEOPY-2701

Conversation

@domfournier
Copy link
Collaborator

@domfournier domfournier commented Feb 6, 2026

GEOPY-2701 - Export best match models as Maxwell plates

@github-actions github-actions bot changed the title GEOPY-2701 GEOPY-2701: Export best match models as Maxwell plates Feb 6, 2026
Copy link
Contributor

@MatthieuCMira MatthieuCMira left a comment

Choose a reason for hiding this comment

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

Some docstrings to have.

Moreover, I have the feeling the function "unique responsibility" rule is not quite respected ;-)

and a bunch of questions for my understanding

)
local_polar[local_polar[:, 1] >= 180, 0] *= -1 # Wrap azimuths

# Flip the line segment if the azimuth angle suggests the opposite direction
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we want to flip?
There are some edge cases there.
How are they affected?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good question - We want an interpolation operator that goes from simulated -> "real survey line".
The library of simulations is all done on lines going West to East (with some extra angles to accommodate deviation).
If the real survey happens to be flown in the opposite direction (E->W) then the ordering of the points has to be flipped such that the order of data is in the same direction.

Copy link
Contributor

Choose a reason for hiding this comment

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

And if the lines are S-N?

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 azimuth of the segment is always forced to be at the strike angle (or 0). So it's really just a matter of ordering. S-N would stay the same, but N-S would get flipped

Copy link
Contributor

@MatthieuCMira MatthieuCMira Feb 9, 2026

Choose a reason for hiding this comment

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

general comment:
We spoke about function single responsibility.
I have the feeling functions here are doing a lot of different logic at the same time that could be break into smaller function for readability.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I hear you. I did try to parse out some functionality to standalone methods.
Highlight specific ones if you can.

def normalized_data(data: np.ndarray, threshold=5) -> np.ndarray:
"""
Return data from a property group with symlog scaling and zero mean.
Return data from a property group with symlog, zero mean and unit max normalization.
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess you data have no high extreme values?
If they have, it's recommended to use std, isn't it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not too worried about extremes since values are first logged. The idea was to remove any large constant, which the std wouldn't pick up right? Like if the data is [10.1, 10.2, 10.5], the standard dev would be too small to bring the data down.
But point taken, maybe the median would be safer.

Copy link
Contributor

@MatthieuCMira MatthieuCMira left a comment

Choose a reason for hiding this comment

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

Seems good for me.
Few docstrings comments

)
local_polar[local_polar[:, 1] >= 180, 0] *= -1 # Wrap azimuths

# Flip the line segment if the azimuth angle suggests the opposite direction
Copy link
Contributor

Choose a reason for hiding this comment

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

And if the lines are S-N?

benk-mira
benk-mira previously approved these changes Feb 10, 2026
Copy link
Contributor

@benk-mira benk-mira left a comment

Choose a reason for hiding this comment

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

I have nothing to add. Looks good!

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

❌ Patch coverage is 92.77108% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.28%. Comparing base (210eb33) to head (2c5dfc5).

Files with missing lines Patch % Lines
simpeg_drivers/plate_simulation/match/driver.py 92.77% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #342      +/-   ##
===========================================
+ Coverage    91.26%   91.28%   +0.01%     
===========================================
  Files          120      120              
  Lines         6505     6551      +46     
  Branches       785      787       +2     
===========================================
+ Hits          5937     5980      +43     
- Misses         379      380       +1     
- Partials       189      191       +2     
Files with missing lines Coverage Δ
simpeg_drivers/plate_simulation/match/driver.py 80.66% <92.77%> (+3.55%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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