From cf1d3ad5116c22b8d054fab9c11f5fe71f7a55d9 Mon Sep 17 00:00:00 2001 From: Teque5 Date: Sat, 17 May 2025 23:01:32 -0700 Subject: [PATCH 1/5] instructions for building the docs locally --- docs/source/developers.rst | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/source/developers.rst b/docs/source/developers.rst index 2d10cf5..fd323ed 100644 --- a/docs/source/developers.rst +++ b/docs/source/developers.rst @@ -51,9 +51,22 @@ To autoformat the entire project according to our coding standard: $ black sigmf tests # autoformat entire project $ isort sigmf tests # format imports for entire project ------- -Issues ------- +---- +Docs +---- + +To build the docs and host locally: + +.. code-block:: console + + $ cd docs + $ make html + $ cd build/html/ + $ python3 -m http.server + +-------------- +Find an Issue? +-------------- Issues can be addressed by opening an `issue `_ or by forking the project and From b3d01c4d988d56ab39adb386db4eacf2ecbdc85c Mon Sep 17 00:00:00 2001 From: Teque5 Date: Sat, 17 May 2025 23:18:43 -0700 Subject: [PATCH 2/5] remove nested layer in docs; resolve docstring format err --- docs/source/api.rst | 10 +++++++++- sigmf/sigmffile.py | 16 ++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/docs/source/api.rst b/docs/source/api.rst index 295a2dc..2c3bddb 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -7,4 +7,12 @@ SigMF API :template: custom-module-template.rst :recursive: - sigmf + sigmf.apps.convert_wav + sigmf.archive + sigmf.archivereader + sigmf.error + sigmf.schema + sigmf.sigmf_hash + sigmf.sigmffile + sigmf.utils + sigmf.validate diff --git a/sigmf/sigmffile.py b/sigmf/sigmffile.py index ad75c97..37e6fe0 100644 --- a/sigmf/sigmffile.py +++ b/sigmf/sigmffile.py @@ -1000,12 +1000,16 @@ def dtype_info(datatype): def get_dataset_filename_from_metadata(meta_fn, metadata=None): """ - Parse provided metadata and return the expected data filename. In the case of - a metadata only distribution, or if the file does not exist, this will return - 'None'. The priority for conflicting: - 1. The file named .SIGMF_DATASET_EXT if it exists - 2. The file in the DATASET_KEY field (Non-Compliant Dataset) if it exists - 3. None (may be a metadata only distribution) + Parse provided metadata and return the expected data filename. + + In the case of a metadata-only distribution, or if the file does not exist, + this will return ``None``. + + Priority for conflicting datasets: + + 1. Use the file named ``.SIGMF_DATASET_EXT`` if it exists. + 2. Use the file in the ``DATASET_KEY`` field (non-compliant dataset) if it exists. + 3. Return ``None`` (may be a metadata-only distribution). """ compliant_filename = get_sigmf_filenames(meta_fn)["data_fn"] noncompliant_filename = metadata["global"].get(SigMFFile.DATASET_KEY, None) From f928217d0c1d5f5480f39d88ea9ae699d2104f35 Mon Sep 17 00:00:00 2001 From: Teque5 Date: Sat, 17 May 2025 23:28:20 -0700 Subject: [PATCH 3/5] polish index a bit --- docs/source/index.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index a2ca1af..f845252 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -2,24 +2,24 @@ Welcome to SigMF! ================= -**sigmf** is a Python library for working with radio recordings captured in -``.sigmf`` format according to the `SigMF standard `_. It -offers a *simple* and *intuitive* API for python developers. +**SigMF** is a Python library for working with radio recordings in +``.sigmf`` format according to the `SigMF standard `_. +It offers a *simple* and *intuitive* API for Python developers. .. - Note below toolversion & specversion are replaced dynamically during build. + Note: The toolversion & specversion below are replaced dynamically during build. -This version |toolversion| of the library coincides with version |specversion| -of the specification. +This documentation is for version |toolversion| of the library, which is +compatible with version |specversion| of the SigMF specification. -Check out the :doc:`quickstart` section for further information, including -how to :ref:`install` the project. +To get started, see the :doc:`quickstart` section or learn how to :ref:`install` the library. +----- .. toctree:: :maxdepth: 1 + :caption: Getting Started :hidden: - :caption: SigMF quickstart advanced @@ -27,14 +27,14 @@ how to :ref:`install` the project. .. toctree:: :maxdepth: 1 - :hidden: :caption: Community + :hidden: faq .. toctree:: :maxdepth: 1 - :hidden: :caption: API Reference + :hidden: - api \ No newline at end of file + api From 3d7d07fa25be0ba823e7a785a0d55a4b73d4d921 Mon Sep 17 00:00:00 2001 From: Teque5 Date: Sat, 17 May 2025 23:41:08 -0700 Subject: [PATCH 4/5] remove errant line --- tests/test_validation.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_validation.py b/tests/test_validation.py index 8f961d8..05720b9 100644 --- a/tests/test_validation.py +++ b/tests/test_validation.py @@ -19,8 +19,7 @@ def test_valid_data(): - """assure the supplied metadata is OK""" - invalid_metadata = dict(TEST_METADATA) + """ensure the default metadata is OK""" SigMFFile(TEST_METADATA).validate() @@ -73,7 +72,7 @@ def test_version(self): class FailingCases(unittest.TestCase): - """Cases where the validator should throw an exception.""" + """Cases where the validator should raise an exception.""" def setUp(self): self.metadata = dict(TEST_METADATA) From 2a7bf9101de72c5b5269664e9af3ff184f55858c Mon Sep 17 00:00:00 2001 From: Teque5 Date: Sat, 17 May 2025 23:43:08 -0700 Subject: [PATCH 5/5] allow tox to run on python3.13 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 56bb7d1..cac61a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,7 +102,7 @@ profile = "black" legacy_tox_ini = ''' [tox] skip_missing_interpreters = True - envlist = py{37,38,39,310,311,312} + envlist = py{37,38,39,310,311,312,313} [testenv] usedevelop = True