diff --git a/.github/workflows/Docs4NIST.yml b/.github/workflows/Docs4NIST.yml new file mode 100644 index 00000000..0c2f2667 --- /dev/null +++ b/.github/workflows/Docs4NIST.yml @@ -0,0 +1,16 @@ +name: "Build Documentation" + +on: [push, pull_request, delete] + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: usnistgov/Docs4NIST@0.6 + with: + docs-folder: docs/ + formats: |- + epub + pdf + pre-build-command: 'pip install -e .' + pip-requirements: 'requirements-all.txt' diff --git a/AFL/automation/instrument/CDSAXSLabview.py b/AFL/automation/instrument/CDSAXSLabview.py index 26189dc6..786f1960 100644 --- a/AFL/automation/instrument/CDSAXSLabview.py +++ b/AFL/automation/instrument/CDSAXSLabview.py @@ -113,7 +113,8 @@ def measureTransmission(self,exp=5,fn='trans',set_empty_transmission=False,retur - '''with (LabviewConnection() if lv is None else lv) as lv: + ''' + with (LabviewConnection() if lv is None else lv) as lv: self.status_txt = 'Moving beamstop out for transmission...' self.moveAxis(self.config['nmc_beamstop_out'],block=True,lv=lv) self.moveAxis(self.config['nmc_sample_out'],block=True,lv=lv) diff --git a/AFL/automation/instrument/PySpecClient.py b/AFL/automation/instrument/PySpecClient.py index 289074e9..042295ee 100644 --- a/AFL/automation/instrument/PySpecClient.py +++ b/AFL/automation/instrument/PySpecClient.py @@ -1,4 +1,4 @@ -import numpy as np +import numpy as np from pyspec.client.SpecConnection import SpecConnection from pyspec.client.SpecCounter import SpecCounter from pyspec.client.SpecConnectionsManager import SpecConnectionsManager diff --git a/AFL/automation/instrument/deprecated/CHESSFMBInstrument.py b/AFL/automation/instrument/deprecated/CHESSFMBInstrument.py deleted file mode 100644 index f619343c..00000000 --- a/AFL/automation/instrument/deprecated/CHESSFMBInstrument.py +++ /dev/null @@ -1,7 +0,0 @@ -import pyepics -import pyfai - - - -class CHESSFMBInstrument(EPICSDevice,RSpecSocketDevice,ScatteringInstrument): - diff --git a/AFL/automation/instrument/deprecated/EPICSDevice.py b/AFL/automation/instrument/deprecated/EPICSDevice.py deleted file mode 100644 index 4cfdf77d..00000000 --- a/AFL/automation/instrument/deprecated/EPICSDevice.py +++ /dev/null @@ -1,8 +0,0 @@ -import pyepics - - - -class EPICSDevice(): - - - diff --git a/AFL/automation/instrument/deprecated/RSpecSocketDevice.py b/AFL/automation/instrument/deprecated/RSpecSocketDevice.py deleted file mode 100644 index 261dac7f..00000000 --- a/AFL/automation/instrument/deprecated/RSpecSocketDevice.py +++ /dev/null @@ -1,9 +0,0 @@ -# note: https://github.com/mxcube/specclient -# this library is rather full featured, maybe just use it rather than reinventing the wheel? - -class RSpecSocketDevice(): - - - - - diff --git a/dev b/dev index 6c296088..51659cd6 160000 --- a/dev +++ b/dev @@ -1 +1 @@ -Subproject commit 6c296088422778de82323e59eff2f0f3cd934316 +Subproject commit 51659cd61a01e4a397330a365d1284fb0ce24c97 diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..d0c3cbf1 --- /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/make.bat b/docs/make.bat new file mode 100644 index 00000000..dc1312ab --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/source/api.rst b/docs/source/api.rst new file mode 100644 index 00000000..863b0a8e --- /dev/null +++ b/docs/source/api.rst @@ -0,0 +1,6 @@ +API +=== + +.. autosummary:: + :toctree: generated + :recursive: diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 00000000..14fb71d3 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,39 @@ +# 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 + +import os +import sys +sys.path.insert(0, os.path.abspath('../..')) # Source code dir relative to this file + + +project = 'AFL-automation' +copyright = 'Contribution of the US Government. Not subject to copyright in the United States.' +author = 'NIST AFL Team' + + + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + 'sphinx.ext.duration', + 'sphinx.ext.doctest', + 'sphinx.ext.autodoc', + 'sphinx.ext.autosummary', + ] + +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/source/index.rst b/docs/source/index.rst new file mode 100644 index 00000000..095e79c6 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,31 @@ +.. AFL-automation documentation master file, created by + sphinx-quickstart on Tue May 28 13:58:39 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to AFL-automation's documentation! +========================================== + +AFL-automation is a framework for instrument control. It powers the NIST AFL, but is more useful than that. It enables the easy conversion of Python classes - drivers - into robust HTTP microservices with authentication, task queueing, UI generation, data management, and more. + + + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +.. autosummary:: + :toctree: _autosummary + :template: custom-module-template.rst + :recursive: + + AFL.automation + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/requirements-all.txt b/requirements-all.txt new file mode 100644 index 00000000..17486539 --- /dev/null +++ b/requirements-all.txt @@ -0,0 +1,42 @@ +alphashape==1.3.1 +bokeh==3.5.1 +fabio==2024.4.0 +Flask==2.2.5 +Flask_Cors==4.0.1 +Flask_JWT_Extended==4.6.0 +gpflow==2.9.2 +h5py==3.11.0 +ipython==8.26.0 +ipywidgets==8.1.3 +matplotlib==3.9.1.post1 +nice==1.1 +numpy<2 +opentrons==7.5.0 +pandas==2.2.2 +paramiko==3.4.0 +periodictable==1.7.1 +Pillow==10.4.0 +Pint==0.24.3 +plotly==5.23.0 +pyFAI==2024.5.0 +pyparsing==3.1.2 +pyserial==3.5 +certif-pyspec<1.4 +pytest +Requests==2.32.3 +sans==1.2.3 +sasdata +sasmodels +scikit_learn==1.5.1 +scipy==1.14.0 +seabreeze==2.9.2 +setuptools==72.1.0 +Shapely==2.0.5 +six==1.16.0 +scikit-image +tensorflow==2.17.0 +tiled==0.1.0b6 +tqdm==4.66.5 +Werkzeug==3.0.3 +xarray==2024.7.0 +zeroconf==0.132.2