diff --git a/docs/.readthedocs.yaml b/docs/.readthedocs.yaml new file mode 100644 index 0000000..97759af --- /dev/null +++ b/docs/.readthedocs.yaml @@ -0,0 +1,29 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py + +# We recommend specifying your dependencies to enable reproducible builds: +# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +# python: +# install: +# - requirements: docs/requirements.txt + +python: + install: + - requirements: docs/requirements.txt + # Install our python package before building the docs + - method: pip + path: . \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d0c3cbf --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..0559e01 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,39 @@ +import os +import sys +sys.path.insert(0, os.path.abspath('../../src')) + +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = 'LabToolkit' +copyright = '2023, David Lutton' +author = 'David Lutton' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +# extensions = ["myst_parser"] +# extensions = [] +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.coverage', + 'sphinx.ext.napoleon' +] + + +templates_path = ['_templates'] +exclude_patterns = [] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'alabaster' +html_static_path = ['_static'] + diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..c6b4f50 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,5 @@ +# TBC + +pandas +numpy + diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..21763a4 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,16 @@ +Welcome to LabToolkit's documentation! +====================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + .. automodule:: labtoolkit + :members: + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/src/labtoolkit/__init__.py b/src/labtoolkit/__init__.py index 280e8db..bcfd1ad 100644 --- a/src/labtoolkit/__init__.py +++ b/src/labtoolkit/__init__.py @@ -465,3 +465,11 @@ def drivers_sorted(self): ).reset_index()[[ 'Type', 'Manufacturer', 'Model', 'Driver' ]] + + def driver_load_all(self): + + for index, value in self.drivers_sorted().iterrows(): + + # print(f"labtoolkit.{value.Type}.{value.Driver}") + + module = importlib.import_module(f'.{value.Type}.{value.Driver}', package='labtoolkit') \ No newline at end of file