Skip to content

Commit

Permalink
Merge pull request #16 from decarlof/master
Browse files Browse the repository at this point in the history
Improved and cleaned up docs
  • Loading branch information
decarlof committed Mar 29, 2024
2 parents b3f0463 + dfe4073 commit 68ce442
Show file tree
Hide file tree
Showing 21 changed files with 69 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yml
Expand Up @@ -3,7 +3,7 @@
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2
sphinx:
configuration: doc/conf.py
configuration: docs/conf.py
# Set the version of Python and other tools you might need
python:
install:
Expand Down
2 changes: 1 addition & 1 deletion dmagic/__init__.py
Expand Up @@ -48,4 +48,4 @@

from dmagic.scheduling import *
from dmagic.pv import *
from dmagic.util import *
from dmagic.utils import *
21 changes: 21 additions & 0 deletions dmagic/pv.py
Expand Up @@ -60,9 +60,23 @@
__author__ = "Francesco De Carlo"
__copyright__ = "Copyright (c) 2015-2016, UChicago Argonne, LLC."
__docformat__ = 'restructuredtext en'
__all__ = ['init_PVs',
'update']


def init_PVs(args):
"""
Initialize the EPICS PVs that will hold user and experiment information
Parameters
----------
args.tomoscan_prefix : EPICS IOC prefix, e.g. 2bma:TomoScan:
Returns
-------
user_pvs : dict
A dictionary of EPICS PVs
"""

user_pvs = {}
tomoscan_prefix = args.tomoscan_prefix
Expand All @@ -79,6 +93,13 @@ def init_PVs(args):


def update(args, date=None):
"""
Update the EPICS PVs with user and experiment information associated with the current experiment
Parameters
----------
args : parametars passed at the CLI
"""

auth = scheduling.authorize()
run = scheduling.current_run(auth, args)
Expand Down
13 changes: 13 additions & 0 deletions dmagic/utils.py
Expand Up @@ -50,9 +50,22 @@
Module containing utils routines to access the APS scheduling system.
"""

__all__ = ['fix_iso']

def fix_iso(s):
"""
This is a temporary fix until timezone is returned as -05:00 instead of -0500
Parameters
----------
s : string
Like "2022-07-31T01:51:05-0400"
Returns
-------
s : string
Like "2022-07-31T01:51:05-04:00"
"""
pos = len("2022-07-31T01:51:05-0400") - 2 # take off end "00"
if len(s) == pos: # missing minutes completely
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions doc/conf.py → docs/conf.py
Expand Up @@ -139,6 +139,9 @@
'logo_only': True,
}

html_logo = 'source/img/dmagic-logo.png'
html_favicon = 'source/img/dmagic-logo.png'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion doc/source/api.rst → docs/source/api.rst
Expand Up @@ -8,7 +8,9 @@ for `DMagic <https://github.com/decarlof/DMagic>`_.

.. toctree::

dmagic.scheduling
api/dmagic.pv
api/dmagic.scheduling
api/dmagic.utils


.. automodule:: dmagic
Expand Down
14 changes: 14 additions & 0 deletions docs/source/api/dmagic.pv.rst
@@ -0,0 +1,14 @@
:mod:`dmagic.pv`
================

.. automodule:: dmagic.pv
:members:
:show-inheritance:
:undoc-members:

.. rubric:: **Functions:**

.. autosummary::

init_PVs
update
File renamed without changes.
13 changes: 13 additions & 0 deletions docs/source/api/dmagic.utils.rst
@@ -0,0 +1,13 @@
:mod:`dmagic.utils`
===================

.. automodule:: dmagic.utils
:members:
:show-inheritance:
:undoc-members:

.. rubric:: **Functions:**

.. autosummary::

fix_iso
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.

0 comments on commit 68ce442

Please sign in to comment.