Skip to content

Commit

Permalink
SpiceyPy 5.1.0
Browse files Browse the repository at this point in the history
* adds wrappers for the majority of new function in n67
  • Loading branch information
AndrewAnnex committed Jul 9, 2022
1 parent 7e920dd commit 2ebcd09
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 100 deletions.
61 changes: 57 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,72 @@ All notable changes to SpiceyPy will be documented here
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project tries to adhere to [Semantic Versioning](http://semver.org/).

## [5.1.0] - 2022-07-09
adds wrappers for the majority of new function in n67
### Added
- azlcpo
- azlrec
- chbigr
- chbint
- chbval
- ckfrot
- ckfxfm
- ckgr02
- ckgr03
- ckmeta
- cknr02
- cknr03
- dafhsf
- dasadc
- dasadd
- dasadi
- dashfs
- daslla
- dasllc
- dasonw
- dasops
- dasrdd
- dasrdi
- dasudd
- dasudi
- daswbr
- dazldr
- dlabns
- dlaens
- dlaopn
- dnearp
- drdazl
- ednmpt
- edpnt
- evsgp4
- getfvn
- hrmesp
- invstm
- lgresp
- lgrint
- qderiv
- recazl
- stlabx
- tagnpt
- tkfram
- tparch
- trgsep
- twovxf
- vprojg

### Fixed
- fixed docstring for frinfo
- fixed freebsd support in getspice

## [5.0.1] - 2022-03-23
minor update to make ld_library_path update safer

### Fixed
- override of ld_library_path is now temporary

### Changed
- updated copyrights for 2022

## [5.0.0] - 2022-02-17

### Changed
- switched to N67 CSPICE, no new wrapper functions yet
- removed deprecated named args mentioned in 4.0.1 release notes
Expand All @@ -25,7 +80,6 @@ minor update to make ld_library_path update safer
- ndim param for: unormg, vaddg, vdistg, vdotg, vequg, vhatg, vminug, vnromg, vrelg, vsclg, vsepg, vsubg, vzerog

## [4.0.3] - 2021-11-14

### Added
- changelog now rendered in docs
- runtime override of cspice via env var or ld_library_path
Expand All @@ -42,7 +96,6 @@ minor update to make ld_library_path update safer
- updated install commands in docs to use pip instead of setup.py

## [4.0.2] - 2021-08-13

### Fixed
- getfat variables size #420
- safer cleanups in tests
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
# built documents.
#
# The short X.Y version.
version = "5.0.1"
version = "5.1.0"
# The full version, including alpha/beta/rc tags.
release = "5.0.1"
release = "5.1.0"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion src/spiceypy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
SOFTWARE.
"""
__author__ = "AndrewAnnex"
__version__ = "5.0.1"
__version__ = "5.1.0"

from .spiceypy import *
from .utils import support_types
Expand Down
67 changes: 0 additions & 67 deletions src/spiceypy/spiceypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2759,38 +2759,6 @@ def dasopw(fname: str) -> int:
return handle.value


@spice_error_check
def dasrdc(
handle: int, first: int, last: int, bpos: int, epos: int, datlen: int
) -> list:
"""
Read character data from a range of DAS logical addresses.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasrdc_c.html

:param handle: DAS file handle.
:param first: start range of DAS character logical addresses.
:param last: end range of DAS character logical addresses.
:param bpos: end positions of substrings.
:param epos: begin positions of substrings.
:param datlen: Common length of the character arrays in data.
:return: Data having addresses first through last.
"""
_handle = ctypes.c_int(handle)
_first = ctypes.c_int(first)
_last = ctypes.c_int(last)
_bpos = ctypes.c_int(bpos)
_epos = ctypes.c_int(epos)
_datlen = ctypes.c_int(datlen)
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)
)
return stypes.c_vector_to_python(_data)


@spice_error_check
def dasrdd(handle: int, first: int, last: int) -> ndarray:
"""
Expand Down Expand Up @@ -2876,41 +2844,6 @@ def dasrfr(
)


@spice_error_check
def dasudc(
handle: int,
first: int,
last: int,
bpos: int,
epos: int,
datlen: int,
data: Sequence[str],
) -> None:
"""
Update character data in a specified range of DAS logical
addresses with substrings of a character array.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasudc_c.html

: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.
"""
_handle = ctypes.c_int(handle)
_first = ctypes.c_int(first)
_last = ctypes.c_int(last)
_bpos = ctypes.c_int(bpos)
_epos = ctypes.c_int(epos)
_datlen = ctypes.c_int(datlen)
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)


@spice_error_check
def dasudd(handle: int, first: int, last: int, data: ndarray) -> None:
"""
Expand Down
26 changes: 0 additions & 26 deletions src/spiceypy/tests/test_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1974,32 +1974,6 @@ def test_dpr():
assert spice.dpr() == 180.0 / np.arccos(-1.0)


@pytest.mark.xfail
def test_dasudc_dasrdc():
daspath = os.path.join(cwd, "ex_dasudc.das")
cleanup_kernel(daspath)
handle = spice.dasonw(daspath, "TEST", "ex_dasudc", 140)
idata = ["oooo", "xxxx"]
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, 8, 0, 3, 4)
assert rdata == idata
spice.dascls(handle)
# update the file
handle = spice.dasopw(daspath)
fdata = ["yyyy", "xxaa"]
spice.dasudc(handle, 1, 4, 0, 3, 4, fdata) # update contents
spice.dascls(handle)
# load and ensure data was written
handle = spice.dasopr(daspath)
rdata = spice.dasrdc(handle, 1, 4, 0, 3, 4)
assert rdata == fdata
spice.dascls(handle)
cleanup_kernel(daspath)


def test_dasudi_dasrdi():
daspath = os.path.join(cwd, "ex_dasudi.das")
cleanup_kernel(daspath)
Expand Down

0 comments on commit 2ebcd09

Please sign in to comment.