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

Add linearity tests for forward models #293

Open
santisoler opened this issue Dec 3, 2021 · 0 comments
Open

Add linearity tests for forward models #293

santisoler opened this issue Dec 3, 2021 · 0 comments
Labels
enhancement Idea or request for a new feature good first issue Good for newcomers (doesn’t require deep knowledge of the project)

Comments

@santisoler
Copy link
Member

Description of the desired feature:

Our forward models for the different geometries (points, prisms, tesseroids) allow to take multiple bodies as inputs, returning a single array as the resulting field generated by every one of these bodies on the computation points.
One of the properties of these forward models is their linearity: the resulting field for all the bodies should be equal to the sum of the individual fields.
Although this property is easily readable from the code, it might be wise to add functions that actually test them.
We could add test_linearity functions for each geometry that compares the resulting field of passing a set of bodies to the resulting field of computing the fields of each one separately and then sum them up.

Through pytests.mark.parametrize we could write a single function per geometry, adding the field as a parameter.
For example:

@pytest.mark.parametrize("field", ("potential", "g_z", ...))
def test_linearity(field):
    """
    Test linearity of the forward model
    """
    ...

Are you willing to help implement and maintain this feature? Yes, but I would love to help anyone motivated to tackle it. 💪🏼

@santisoler santisoler added enhancement Idea or request for a new feature good first issue Good for newcomers (doesn’t require deep knowledge of the project) labels Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Idea or request for a new feature good first issue Good for newcomers (doesn’t require deep knowledge of the project)
Projects
None yet
Development

No branches or pull requests

1 participant