Skip to content

Commit 43ccf10

Browse files
Update Docs and Reorganize (#4)
* update sphinx build directory * update datasource.py docs * update datasource.py docs for remaining classes * update datasource.py to add type hints for return values that were missing * change copyright in docs * reorganize, add linting test * documentation fix after reorg * fix linting errors * update readme
1 parent 2122122 commit 43ccf10

30 files changed

Lines changed: 1112 additions & 784 deletions

.github/workflows/docs_pages.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
2323
- name: Sphinx build
2424
run: |
25-
poetry run sphinx-build -M html docs/source docs/build/
25+
poetry run sphinx-build -b html docs/source docs/build/html
2626
2727
- name: Deploy documentation
28-
uses: peaceiris/actions-gh-pages@v3
29-
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
28+
uses: peaceiris/actions-gh-pages@v4
29+
if: github.event_name == 'push' && github.ref == 'refs/heads/docs'
3030
with:
3131
publish_branch: gh-pages
3232
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/linting.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Flake8 Linting
2+
on: [ push, pull_request ]
3+
jobs:
4+
lint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/setup-python@v5
9+
with:
10+
python-version: '3.12'
11+
12+
- name: Install Poetry
13+
uses: snok/install-poetry@v1
14+
15+
- name: Install dependencies
16+
run: |
17+
poetry install --with dev
18+
- name: Lint
19+
run: |
20+
poetry run flake8

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
Library for communicating with Opensensorhub that provides options for saving configurations, getting visualization
44
recommendations for data, retrieving data in real time, archival streams, and batch modes, and more.
55

6+
API Documentation available [here](hhttps://botts-innovative-research.github.io/OSHConnect-Python/)
7+
68
Links:
79
* [Architecture Doc](https://docs.google.com/document/d/1pIaeQw0ocU6ApNgqTVRZuSwjJAbhCcmweMq6RiVYEic/edit?usp=sharing)
810
* [UML Diagram](https://drive.google.com/file/d/1FVrnYiuAR8ykqfOUa1NuoMyZ1abXzMPw/view?usp=drive_link)

docs/source/api.rst

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
API Reference
2+
=============
3+
4+
OSHConnect
5+
----------
6+
7+
8+
OSHConnect Utilities and Helpers
9+
--------------------------------
10+
.. automodule:: oshconnect.oshconnectapi
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
OSH Connect Data Models
16+
-----------------------
17+
These are the second highest level pieces in the hierarchy of the library and the utilities needed to help almost
18+
everything else in the app function.
19+
20+
.. automodule:: oshconnect.osh_connect_datamodels
21+
:members:
22+
:undoc-members:
23+
:show-inheritance:
24+
25+
26+
DataSources and Messaging
27+
-------------------------
28+
Due to their extreme importance in the library, the data sources are listed separately along with the classes that help
29+
manage them and their data.
30+
31+
.. automodule:: oshconnect.datasource
32+
:members:
33+
:undoc-members:
34+
:show-inheritance:
35+
36+
Time Management
37+
---------------
38+
Currently **WIP** but this module will contain the classes and functions that help manage the current time and other
39+
playback features of groups of datasources/datafeeds
40+
41+
.. automodule:: oshconnect.timemanagement
42+
:members:
43+
:undoc-members:
44+
:show-inheritance:
45+
46+
Styling
47+
-------
48+
**WIP** This module contains the classes and functions that help manage the styling and visualization recommendations that
49+
the library provides.
50+
51+
Datastore
52+
---------
53+
**WIP** This module is for managing the state of the app. The configurations files are intended to be interchgangale
54+
among all language versions of the OSHConnect ecosystem.
55+
56+
Core Data Models
57+
----------------
58+
Theses data models are not often intended to be used directly by the user, but are used by the library to help manage
59+
validation of data that flows to and from the API.
60+
61+
.. automodule:: oshconnect.core_datamodels
62+
:members:
63+
:undoc-members:
64+
:show-inheritance:
65+
66+
67+
68+
Helpers
69+
~~~~~~~

docs/source/conf.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,23 @@
66
# -- Project information -----------------------------------------------------
77
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
88

9+
import os
10+
import sys
11+
import traceback
12+
13+
sys.path.insert(0, os.path.abspath("../.."))
14+
15+
16+
def process_exception(app, what, name, obj, options, lines):
17+
traceback.print_exc()
18+
19+
20+
def setup(app):
21+
app.connect('autodoc-process-docstring', process_exception)
22+
23+
924
project = 'OSHConnect-Python'
10-
copyright = '2024, Ian Patterson'
25+
copyright = '2024, Botts Innovative Research, Inc.'
1126
author = 'Ian Patterson'
1227
release = '0.1'
1328

@@ -27,5 +42,10 @@
2742
# -- Options for HTML output -------------------------------------------------
2843
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
2944

30-
html_theme = 'alabaster'
45+
html_theme = 'sphinx_rtd_theme'
3146
html_static_path = ['_static']
47+
html_theme_options = {
48+
'sticky_navigation': True,
49+
'display_version': True,
50+
'prev_next_buttons_location': 'both',
51+
}

docs/source/datasources.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DataSources
2+
==============

docs/source/external.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
External Models
2+
===============

docs/source/index.rst

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
.. OSHConnect-Python documentation master file, created by
2-
sphinx-quickstart on Tue Jun 25 11:43:33 2024.
3-
You can adapt this file completely to your liking, but it should at least
4-
contain the root `toctree` directive.
5-
61
Welcome to OSHConnect-Python's documentation!
72
=============================================
83

4+
OSHConnect-Python
5+
=================
6+
OSHConnect-Python is the Python version of the OSHConnect family of application libraries inteded to provide a simple
7+
and straightforward way to interact with OpenSensorHub (or another CSAPI server) by way of OGC API - Connected Systems.
8+
It supports or will support at the time of a 1.0 release Part 1 and Part 2 of the Connected Systems api, as well as
9+
certain streaming features made possible by OpenSensorHub.
10+
911
.. toctree::
1012
:maxdepth: 2
11-
:caption: Contents:
13+
:caption: Contents
14+
15+
api
16+
datasources
17+
external
18+
1219

1320

1421

@@ -20,17 +27,3 @@ Indices and tables
2027
* :ref:`search`
2128

2229

23-
OSHConnect-Python
24-
=================
25-
OSHConnect-Python is the Python version of the OSHConnect family of application libraries inteded to provide a simple
26-
and straightforward way to interact with OpenSensorHub (or another CSAPI server) by way of OGC API - Connected Systems.
27-
It supports or will support at the time of a 1.0 release Part 1 and Part 2 of the Connected Systems api, as well as
28-
certain streaming features made possible by OpenSensorHub.
29-
30-
OSHConnect
31-
==========
32-
33-
.. automodule:: oshconnect
34-
:members:
35-
:undoc-members:
36-
:show-inheritance:

external_models/__init__.py

Lines changed: 0 additions & 131 deletions
This file was deleted.

oshconnect/__init__.py

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,5 @@
55
# Contact Email: ian@botts-inc.com
66
# ==============================================================================
77

8-
import base64
9-
from dataclasses import dataclass
10-
from enum import Enum
11-
12-
13-
@dataclass(kw_only=True)
14-
class Endpoints:
15-
root: str = "sensorhub"
16-
sos: str = f"{root}/sos"
17-
connected_systems: str = f"{root}/api"
18-
19-
20-
class TemporalModes(Enum):
21-
REAL_TIME = "realtime"
22-
ARCHIVE = "archive"
23-
BATCH = "batch"
24-
RT_SYNC = "realtimesync"
25-
ARCHIVE_SYNC = "archivesync"
26-
27-
28-
class Utilities:
29-
30-
@staticmethod
31-
def convert_auth_to_base64(username: str, password: str) -> str:
32-
return base64.b64encode(f"{username}:{password}".encode()).decode()
8+
class Example:
9+
pass

0 commit comments

Comments
 (0)