Skip to content

Commit ed8e016

Browse files
authored
Docs/polish (#112)
* instructions for building the docs locally * remove nested layer in docs * resolve docstring format err * allow tox to run on python3.13
1 parent 03eda51 commit ed8e016

File tree

6 files changed

+50
-26
lines changed

6 files changed

+50
-26
lines changed

docs/source/api.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,12 @@ SigMF API
77
:template: custom-module-template.rst
88
:recursive:
99

10-
sigmf
10+
sigmf.apps.convert_wav
11+
sigmf.archive
12+
sigmf.archivereader
13+
sigmf.error
14+
sigmf.schema
15+
sigmf.sigmf_hash
16+
sigmf.sigmffile
17+
sigmf.utils
18+
sigmf.validate

docs/source/developers.rst

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,22 @@ To autoformat the entire project according to our coding standard:
5151
$ black sigmf tests # autoformat entire project
5252
$ isort sigmf tests # format imports for entire project
5353
54-
------
55-
Issues
56-
------
54+
----
55+
Docs
56+
----
57+
58+
To build the docs and host locally:
59+
60+
.. code-block:: console
61+
62+
$ cd docs
63+
$ make html
64+
$ cd build/html/
65+
$ python3 -m http.server
66+
67+
--------------
68+
Find an Issue?
69+
--------------
5770

5871
Issues can be addressed by opening an `issue
5972
<https://github.com/sigmf/sigmf-python/issues>`_ or by forking the project and

docs/source/index.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,39 @@
22
Welcome to SigMF!
33
=================
44

5-
**sigmf** is a Python library for working with radio recordings captured in
6-
``.sigmf`` format according to the `SigMF standard <https://sigmf.org/>`_. It
7-
offers a *simple* and *intuitive* API for python developers.
5+
**SigMF** is a Python library for working with radio recordings in
6+
``.sigmf`` format according to the `SigMF standard <https://sigmf.org/>`_.
7+
It offers a *simple* and *intuitive* API for Python developers.
88

99
..
10-
Note below toolversion & specversion are replaced dynamically during build.
10+
Note: The toolversion & specversion below are replaced dynamically during build.
1111
12-
This version |toolversion| of the library coincides with version |specversion|
13-
of the specification.
12+
This documentation is for version |toolversion| of the library, which is
13+
compatible with version |specversion| of the SigMF specification.
1414

15-
Check out the :doc:`quickstart` section for further information, including
16-
how to :ref:`install` the project.
15+
To get started, see the :doc:`quickstart` section or learn how to :ref:`install` the library.
1716

17+
-----
1818

1919
.. toctree::
2020
:maxdepth: 1
21+
:caption: Getting Started
2122
:hidden:
22-
:caption: SigMF
2323

2424
quickstart
2525
advanced
2626
developers
2727

2828
.. toctree::
2929
:maxdepth: 1
30-
:hidden:
3130
:caption: Community
31+
:hidden:
3232

3333
faq
3434

3535
.. toctree::
3636
:maxdepth: 1
37-
:hidden:
3837
:caption: API Reference
38+
:hidden:
3939

40-
api
40+
api

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ profile = "black"
102102
legacy_tox_ini = '''
103103
[tox]
104104
skip_missing_interpreters = True
105-
envlist = py{37,38,39,310,311,312}
105+
envlist = py{37,38,39,310,311,312,313}
106106
107107
[testenv]
108108
usedevelop = True

sigmf/sigmffile.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,12 +1000,16 @@ def dtype_info(datatype):
10001000

10011001
def get_dataset_filename_from_metadata(meta_fn, metadata=None):
10021002
"""
1003-
Parse provided metadata and return the expected data filename. In the case of
1004-
a metadata only distribution, or if the file does not exist, this will return
1005-
'None'. The priority for conflicting:
1006-
1. The file named <stem>.SIGMF_DATASET_EXT if it exists
1007-
2. The file in the DATASET_KEY field (Non-Compliant Dataset) if it exists
1008-
3. None (may be a metadata only distribution)
1003+
Parse provided metadata and return the expected data filename.
1004+
1005+
In the case of a metadata-only distribution, or if the file does not exist,
1006+
this will return ``None``.
1007+
1008+
Priority for conflicting datasets:
1009+
1010+
1. Use the file named ``<stem>.SIGMF_DATASET_EXT`` if it exists.
1011+
2. Use the file in the ``DATASET_KEY`` field (non-compliant dataset) if it exists.
1012+
3. Return ``None`` (may be a metadata-only distribution).
10091013
"""
10101014
compliant_filename = get_sigmf_filenames(meta_fn)["data_fn"]
10111015
noncompliant_filename = metadata["global"].get(SigMFFile.DATASET_KEY, None)

tests/test_validation.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919

2020

2121
def test_valid_data():
22-
"""assure the supplied metadata is OK"""
23-
invalid_metadata = dict(TEST_METADATA)
22+
"""ensure the default metadata is OK"""
2423
SigMFFile(TEST_METADATA).validate()
2524

2625

@@ -73,7 +72,7 @@ def test_version(self):
7372

7473

7574
class FailingCases(unittest.TestCase):
76-
"""Cases where the validator should throw an exception."""
75+
"""Cases where the validator should raise an exception."""
7776

7877
def setUp(self):
7978
self.metadata = dict(TEST_METADATA)

0 commit comments

Comments
 (0)