Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise error for zero depth value in equivalent sources #524

Merged
merged 4 commits into from
Aug 12, 2024

Conversation

Souza-junior
Copy link
Member

Raise error message for zero depth values in EquivalentSources and EquivalentSourcesGB classes.
Add associated tests.

Fix #523

@santisoler santisoler added this to the v0.7.0 milestone Aug 12, 2024
Copy link
Member

@mdtanker mdtanker left a comment

Choose a reason for hiding this comment

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

This looks great, thanks for doing this @Souza-junior!

@@ -178,6 +178,11 @@ def __init__(
f"Found invalid 'depth' value equal to '{depth}'. "
"It should be 'default' or a numeric value."
)
if depth == 0:

Choose a reason for hiding this comment

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

Perhaps check if depth <= 0.

Because depth cannot be smaller than zero

Copy link
Member Author

Choose a reason for hiding this comment

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

Hey @VascoSch92,

From the perspective of the equivalent source, you can have sources above the observation point. The only problem arises when you have them in the same position as the observation points.

Cheers

@santisoler
Copy link
Member

Thanks @Souza-junior for this! It's looking great, I'm merging it! 🚀

Also, thanks @VascoSch92 for the comment, and @mdtanker for reporting the bug. We'll have this bugfix in the next release.

@santisoler santisoler changed the title Raise error for zero depth value Raise error for zero depth value in equivalent sources Aug 12, 2024
@santisoler santisoler merged commit 99c5c01 into fatiando:main Aug 12, 2024
19 checks passed
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.

Error with source depths of 0
4 participants