Skip to content

Commit

Permalink
Update Tests
Browse files Browse the repository at this point in the history
Fix multiple tests
  • Loading branch information
Deech08 committed Mar 22, 2023
1 parent 078de0b commit 587fd46
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
pip install lmfit
pip install statsmodels
conda install -c conda-forge cartopy
pip install cartopy
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
Expand Down
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ Python Package to Interact with, Visualize, and Analyze the Wisconsin H-Alpha Ma
:target: http://www.astropy.org
:alt: Powered by Astropy Badge

.. image:: https://travis-ci.com/Deech08/whampy.svg?branch=master
:target: https://travis-ci.com/Deech08/whampy
[![Tests](https://github.com/Deech08/whampy/actions/workflows/python-app.yml/badge.svg)](https://github.com/Deech08/whampy/actions/workflows/python-app.yml)

.. image:: https://coveralls.io/repos/github/Deech08/whampy/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/Deech08/whampy?branch=master&service=github
Expand Down
4 changes: 2 additions & 2 deletions whampy/scaleHeight.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def fit_scale_heights(data, masks, min_lat = None, max_lat = None,
ax2.plot(np.degrees(np.arctan(xlim)),
np.log([0.1,0.1]), ls = ":", lw = 1,
color = "k", label = "0.1 R")
ax2.fill_between([-min_lat, min_lat]*u.deg, [ylim[0], ylim[0]], [ylim[1], ylim[1]],
ax2.fill_between([-min_lat.value, min_lat.value], [ylim[0], ylim[0]], [ylim[1], ylim[1]],
color = pal[1],
alpha = 0.1,
label = r"$|b| < 5\degree$")
Expand Down Expand Up @@ -576,7 +576,7 @@ def slope_int_estimator_neg(inds,
ax2.plot(np.degrees(np.arctan(xlim)),
np.log([0.1,0.1]), ls = ":", lw = 1,
color = "k", label = "0.1 R")
ax2.fill_between([-min_lat, min_lat]*u.deg, [ylim[0], ylim[0]], [ylim[1], ylim[1]],
ax2.fill_between([-min_lat.value, min_lat.value], [ylim[0], ylim[0]], [ylim[1], ylim[1]],
color = pal[1],
alpha = 0.1,
label = r"$|b| < 5\degree$")
Expand Down
2 changes: 1 addition & 1 deletion whampy/skySurvey.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def __init__(self, filename = None, mode = 'local', idl_var = None,
if mode == 'local':
filename = os.path.join(directory, "data/wham-ss-DR1-v161116-170912.fits")
elif mode == 'remote':
filename = "http://www.astro.wisc.edu/wham/ss/wham-ss-DR1-v161116-170912.fits"
filename = "https://uwmadison.box.com/shared/static/4kccrw2bgad7muss3z2po7rezklenxxz.fits"

if filename[-4:] == ".sav":
# IDL Save File
Expand Down
4 changes: 2 additions & 2 deletions whampy/spectralStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ def stack_spectra_bootstrap(survey,
stacked[0]["VELOCITY"] = velocity
stacked[0]["DATA"] = estimator(stack_samples_data,
axis = 0) * survey["DATA"].unit
stacked[0]["VARIANCE"] = np.var(stack_samples_data,
stacked[0]["VARIANCE"] = np.ma.var(stack_samples_data.data,
axis = 0) * survey["VARIANCE"].unit
stacked[0]["CI"] = np.nanpercentile(stack_samples_data,
stacked[0]["CI"] = np.nanpercentile(stack_samples_data.data,
(100-ci, ci),
axis = 0) * survey["DATA"].unit

Expand Down
2 changes: 1 addition & 1 deletion whampy/tests/test_fit_scale_height.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ def test_basic():
max_lat = 35,
deredden = True)

assert np.allclose(results["slopes_pos"], results_2["slopes_pos"], equal_nan = True)
assert np.allclose(results["slopes_pos"], results_2["slopes_pos"], equal_nan = True, atol = 1e-2)
Binary file added whampy/tests/test_fits_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added whampy/tests/test_fits_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added whampy/tests/test_fits_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion whampy/whampyTableMixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def moment(self, order = None, vmin = None, vmax = None,
x = vel_masked,
axis = 1) * self["DATA"].unit * self["VELOCITY"].unit**3 / moment_0

err_2_subover_mom2 = np.trapz(data_masked * (vel_masked - moment_1.value[:,None])**2 * np.sqrt(var_masked /
err_2_subover_mom2 = np.trapz(data_masked * (vel_masked - moment_1.value[:,None])**2 * np.sqrt(var_masked.value /
data_masked**2 + 2*(err_1[:,None] / moment_1[:,None])**2),
x = vel_masked,
axis = 1) * self["DATA"].unit * self["VELOCITY"].unit**3 / (moment_2 * moment_0)
Expand Down

0 comments on commit 587fd46

Please sign in to comment.