Skip to content

Update and refactor code and docs for tesseroids#617

Merged
mdtanker merged 21 commits intofatiando:mainfrom
mdtanker:tesseroids
Mar 27, 2026
Merged

Update and refactor code and docs for tesseroids#617
mdtanker merged 21 commits intofatiando:mainfrom
mdtanker:tesseroids

Conversation

@mdtanker
Copy link
Copy Markdown
Member

@mdtanker mdtanker commented Dec 11, 2025

This PR fixes and clarifies the documentation about how to use tesseroids and tesseroid layers. It also tries to align the functionality of prisms and tesseroids, by adding a _discard_thin_tesseroids() function.

@mdtanker mdtanker marked this pull request as draft December 11, 2025 13:04
@santisoler
Copy link
Copy Markdown
Member

Thanks @mdtanker for revisiting the tesseroid code! Since it involves several files, maybe we could reorganize them similarly to how I organized the ellipsoids code. Since the harmonica._forward module is private, we can reorganize files as we please. We just need to remember to import the public functions in harmonica/__init__.py.

@mdtanker
Copy link
Copy Markdown
Member Author

Okay that sounds good, I'll try and follow the ellipsoids code. For now, I was just ensuring the tesseroids code matches the prisms code as best as possible.

@santisoler
Copy link
Copy Markdown
Member

Hi @mdtanker! I think there are many good things in this PR. I can leave the reorganization of the tesseroid source files for a different one, don't worry about that. Is there anything you want to work on in this PR?

I also noticed that you pushed a test.ipynb to this branch. Is that intended or should we remove it?

@mdtanker
Copy link
Copy Markdown
Member Author

I think there were a few other things I may have not push yet but probably won't be able to get around to it for a week or 2.

@santisoler
Copy link
Copy Markdown
Member

Sounds good, and no rush on my end. Let me know if you need another set of eyes here.

@mdtanker
Copy link
Copy Markdown
Member Author

mdtanker commented Mar 27, 2026

I git reset --hard to before you merged in main, then git reset --soft HEAD~1 to remove my WIP commit so I could separate it into individual commits, and then git push --force-with-lease the changes here. How should I merge main back in now, just git checkout tesseroids, git merge main?

I did that, and it seemed to work fine!

@mdtanker mdtanker marked this pull request as ready for review March 27, 2026 10:43
@mdtanker
Copy link
Copy Markdown
Member Author

Ok @santisoler I think this is ready for review, but no rush. I had to update the outputs of one of the doctests (fb47337) but I'm not sure why any of my code changes would have affected this doctest, maybe it was already failing before?

Copy link
Copy Markdown
Member

@santisoler santisoler 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 to me, @mdtanker! I just left a few minor comments below. Feel free to commit them and merge the PR!

When merging, we use Squash and Merge, and keep the PR comment as commit description. In this case, you might want to edit it to describe what has been done here. We usually remove the Relevant issues/PRs section, since it's not very informative outside of GitHub.

Comment thread harmonica/_forward/tesseroid_layer.py Outdated
Comment thread doc/user_guide/forward_modelling/tesseroid.rst Outdated
Comment thread doc/user_guide/forward_modelling/tesseroid.rst Outdated
Comment thread harmonica/_forward/tesseroid_layer.py Outdated
Comment thread harmonica/_forward/tesseroid_layer.py Outdated
Co-authored-by: Santiago Soler <santisoler@fastmail.com>
mdtanker and others added 5 commits March 27, 2026 17:52
Co-authored-by: Santiago Soler <santisoler@fastmail.com>
Co-authored-by: Santiago Soler <santisoler@fastmail.com>
Co-authored-by: Santiago Soler <santisoler@fastmail.com>
Co-authored-by: Santiago Soler <santisoler@fastmail.com>
@mdtanker mdtanker changed the title Tesseroids Update and refactor code and docs for tesseroids Mar 27, 2026
@mdtanker mdtanker merged commit 4d46562 into fatiando:main Mar 27, 2026
20 checks passed
@mdtanker mdtanker deleted the tesseroids branch March 27, 2026 17:32
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.

2 participants