simpeg / geoana

Interactive geoscience (mostly) analytic functions.
MIT License
22 stars 9 forks source link

Check xyz #46

Closed jcapriot closed 2 years ago

jcapriot commented 2 years ago

Add a utility to check xyz input dimensionality and ensure it's a numpy array in the process. Will also stack arrays along the last dimension for a tuple input. This allows us to call functions as:

xyz = np.random.rand(20, 20, 3)
func(xyz)

or

x, y, z = np.mgrid[-10:10:11j, -10:10:15j, -2:20:21j]
func((x, y, z))

which will stack the input and throw errors if x, y, and z are not all the same shape input.

codecov[bot] commented 2 years ago

Codecov Report

Merging #46 (1d45fcf) into main (9d61e27) will increase coverage by 0.14%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #46      +/-   ##
==========================================
+ Coverage   76.68%   76.82%   +0.14%     
==========================================
  Files          26       26              
  Lines        2432     2395      -37     
==========================================
- Hits         1865     1840      -25     
+ Misses        567      555      -12     
Impacted Files Coverage Δ
geoana/em/static/sphere.py 97.37% <100.00%> (+3.35%) :arrow_up:
geoana/gravity.py 100.00% <100.00%> (ø)
geoana/utils.py 78.57% <100.00%> (+4.28%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9d61e27...1d45fcf. Read the comment docs.