NASA-AMMOS / NASA-AMMOS/AIT-Core

Ground Script API Intro out of date

Open
#516 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
56
Forks
35
Avg merge
1d 20h
Merged PRs (30d)
3

Description

First issue here so let me know if I'm missing anything...

AIT Core Version: 2.5.1

The documentation for the Ground Script API Introduction might be out of date and/or have a few bugs:

https://ait-core.readthedocs.io/en/master/api_intro.html

One such issue is an attribute name starting with a number:

[foo@b5cb4209b90d ~]$ workon ait
(ait) [foo@b5cb4209b90d ~]$ python
Python 3.7.9 (default, Mar  5 2024, 17:13:40) 
[GCC 8.5.0 20210514 (Red Hat 8.5.0-20)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ait.core.api import Instrument, wait
>>> inst = Instrument()
>>> inst.tlm.1553_HS_Packet
  File "<stdin>", line 1
    inst.tlm.1553_HS_Packet
                 ^
SyntaxError: invalid token

A packet definition that doesn't start with a number works fine but throws an exception when following along with the documentation:

>>> telem = inst.tlm.Ethernet_HS_Packet
>>> telem.CmdsRcvd
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ttc/.virtualenvs/ait/lib/python3.7/site-packages/ait/core/api.py", line 509, in __getattr__
    return self._packets[0].__getattr__(name)
  File "/home/ttc/.virtualenvs/ait/lib/python3.7/site-packages/ait/core/api.py", line 365, in __getitem__
    return self._deque.__getitem__(index)
IndexError: deque index out of range

Additionally, the "Putting it all Together" section seems to suggest that the "wait" function is non-blocking and waits forever. But, when following along with the documentation, the wait call blocks and eventually times out:

>>> wait(lambda: len(inst.tlm.Ethernet_HS_Packet) > 2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ttc/.virtualenvs/ait/lib/python3.7/site-packages/ait/core/api.py", line 731, in wait
    raise APITimeoutError(_timeout, msg)
ait.core.api.APITimeoutError: APITimeoutError: Timeout (10 seconds) exceeded

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Ground Script API Introduction at api_intro.html and compare its examples with the behavior shown in ait/core/api.py, especially attribute access and wait. Reproduce the documented commands, then update the relevant examples and explanations so valid packet access and timeout behavior are clear and verifiable.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.