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

Allow prism_layer to take xarray objects as arguments #243

Merged
merged 4 commits into from
Sep 13, 2021

Conversation

santisoler
Copy link
Member

@santisoler santisoler commented Sep 3, 2021

Extend the support of prism_layer to accept surface, reference, and
properties as xarray.DataArray. Improve the test functions by creating
a pytest fixture that parametrizes the data types of the output arrays:
either Numpy arrays or xarray.DataArrays. Generate a new pytest fixture
that returns a layer of prisms with some holes (missing prisms), ready to be
used as the expected results of some test functions. Parametrize the field on
each test function that computes gravitational fields of prism layers. Simplify
the prism_layer_topo example so the surface and the density of the layer are
passed as xarray objects.

Reminders:

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst and the base __init__.py file for the package.
  • Write detailed docstrings for all functions/classes/methods. It often helps to design better code if you write the docstrings first.
  • If adding new functionality, add an example to the docstring, gallery, and/or tutorials.
  • Add your full name, affiliation, and ORCID (optional) to the AUTHORS.md file (if you haven't already) in case you'd like to be listed as an author on the Zenodo archive of the next release.

Create fixtures for reused arrays, with parametrization of their type:
numpy arrays or xarray arrays. Parametrize the field on each test
function that computes gravitational fields.
@santisoler santisoler changed the title Allow prism layer to take xarray objects as arguments Allow prism_layer to take xarray objects as arguments Sep 3, 2021
Copy link
Member

@leouieda leouieda left a comment

Choose a reason for hiding this comment

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

Looks awesome @santisoler! Love the new fixtures 👍🏽

@santisoler santisoler merged commit aed37e3 into master Sep 13, 2021
@santisoler santisoler deleted the prism-layer-xarray branch September 13, 2021 12:18
@santisoler santisoler added the enhancement Idea or request for a new feature label Oct 20, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants