Skip to content

Commit

Permalink
add bound methods added test
Browse files Browse the repository at this point in the history
  • Loading branch information
jkingslake committed Sep 3, 2024
1 parent 235181c commit 0b9a80f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 4 deletions.
45 changes: 41 additions & 4 deletions notebooks/test_notes/tests_for_github.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 39,
"id": "076ae5d4-5471-4945-b2e5-d1932d46b870",
"metadata": {},
"outputs": [],
Expand All @@ -191,12 +191,12 @@
" remote_load = True,\n",
" file_names_to_process = fs1.dat_filenames_to_process)\n",
"\n",
" assert fs1.data.identical(fs2.data)"
" assert fs1.data.equals(fs2.data)"
]
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 40,
"id": "ced97345-a02e-4bbb-a428-1bcb9eb74d84",
"metadata": {},
"outputs": [],
Expand All @@ -219,7 +219,7 @@
"metadata": {},
"outputs": [],
"source": [
"## test polarmetric local loading by loading the same waypoint twice as if it is two different ones and chaeking \n",
"## test polarmetric local loading by loading the same waypoint twice as if it is two different ones and checking \n",
"# that you get the same thing twice.\n",
"\n",
"# tests the attended option and the polarmetric option from locally stored dat files (as opposed to cloud stored dat files)\n",
Expand Down Expand Up @@ -314,6 +314,43 @@
"source": [
"out = test_displacement_calculation()"
]
},
{
"cell_type": "code",
"execution_count": 42,
"id": "5c91b524",
"metadata": {},
"outputs": [],
"source": [
"import xarray as xr\n",
"def test_bound_methods_are_added_correctly():\n",
" assert xr.DataArray.dB\n",
" assert xr.DataArray.sonify\n",
" assert xr.DataArray.displacement_timeseries\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 53,
"id": "7de01d8e",
"metadata": {},
"outputs": [],
"source": [
"a = xr.DataArray([1, 2, 3], dims=\"X\")\n",
"\n",
"assert xr.DataArray.dB\n",
"assert xr.DataArray.sonify\n",
"assert xr.DataArray.displacement_timeseries"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3cef6a5b",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
7 changes: 7 additions & 0 deletions tests/test_bound_methds_added.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import pytest
import xapres
import xarray as xr
def test_bound_methods_are_added_correctly():
assert xr.DataArray.dB
assert xr.DataArray.sonify
assert xr.DataArray.displacement_timeseries

0 comments on commit 0b9a80f

Please sign in to comment.