Skip to content

Commit

Permalink
fixed one xfail (#449)
Browse files Browse the repository at this point in the history
fixed xfail for ckrot
  • Loading branch information
AndrewAnnex committed Jul 1, 2022
1 parent c82a872 commit c2fecee
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
13 changes: 10 additions & 3 deletions src/spiceypy/spiceypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2487,7 +2487,9 @@ def dasadc(
_bpos = ctypes.c_int(bpos)
_epos = ctypes.c_int(epos)
_datlen = ctypes.c_int(datlen)
_data = stypes.list_to_char_array_ptr(data)
sublen = epos - bpos + 1
r = int((n + sublen - 1) // sublen)
_data = stypes.list_to_char_array_ptr(data, x_len=epos + 1, y_len=r)
libspice.dasadc_c(_handle, _n, _bpos, _epos, _datlen, _data)


Expand Down Expand Up @@ -2780,7 +2782,9 @@ def dasrdc(
_bpos = ctypes.c_int(bpos)
_epos = ctypes.c_int(epos)
_datlen = ctypes.c_int(datlen)
_data = stypes.empty_char_array(x_len=epos + 1, y_len=last + 1)
sublen = epos - bpos + 1
r = int((last - first + sublen) // sublen)
_data = stypes.empty_char_array(x_len=epos + 1, y_len=r)
libspice.dasrdc_c(
_handle, _first, _last, _bpos, _epos, _datlen, ctypes.byref(_data)
)
Expand Down Expand Up @@ -2890,6 +2894,7 @@ def dasudc(

:param handle: DAS file handle.
:param last: Range of DAS character logical addresses.
:param bpos: Begin and end positions of substrings.
:param epos: Begin and end positions of substrings.
:param datlen: Common length of the character arrays in data.
:param data: Data having addresses first through last.
Expand All @@ -2900,7 +2905,9 @@ def dasudc(
_bpos = ctypes.c_int(bpos)
_epos = ctypes.c_int(epos)
_datlen = ctypes.c_int(datlen)
_data = stypes.list_to_char_array_ptr(data)
sublen = epos - bpos + 1
r = int((last - first + sublen) // sublen)
_data = stypes.list_to_char_array_ptr(data, x_len=epos + 1, y_len=r)
libspice.dasudc_c(_handle, _first, _last, _bpos, _epos, _datlen, _data)


Expand Down
11 changes: 5 additions & 6 deletions src/spiceypy/tests/test_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@ def test_ckcov():
] == expected_intervals


@pytest.mark.xfail
def test_ckfrot():
spice.furnsh(CoreKernels.testMetaKernel)
spice.furnsh(CassiniKernels.cassSclk)
Expand All @@ -566,9 +565,9 @@ def test_ckfrot():
rotation, ref = spice.ckfrot(ckid, et)
expected = np.array(
[
[-0.64399206, 0.48057295, 0.5952511],
[-0.34110294, -0.87682328, 0.33886533],
[0.68477954, 0.01518468, 0.72859208],
[-0.64399206, -0.34110294, 0.68477954],
[0.48057295, -0.87682328, 0.01518468],
[0.5952511, 0.33886533, 0.72859208],
]
)
npt.assert_array_almost_equal(rotation, expected)
Expand Down Expand Up @@ -1984,11 +1983,11 @@ def test_dasudc_dasrdc():
cleanup_kernel(daspath)
handle = spice.dasonw(daspath, "TEST", "ex_dasudc", 140)
idata = ["oooo", "xxxx"]
spice.dasadc(handle, 10, 0, 3, 4, idata) # write initial contents
spice.dasadc(handle, 8, 0, 3, 4, idata) # write initial contents
spice.dascls(handle)
# read the file
handle = spice.dasopr(daspath)
rdata = spice.dasrdc(handle, 1, 2, 0, 3, 4)
rdata = spice.dasrdc(handle, 1, 8, 0, 3, 4)
assert rdata == idata
spice.dascls(handle)
# update the file
Expand Down

0 comments on commit c2fecee

Please sign in to comment.