Skip to content

Commit

Permalink
Fixed an issue with the MP Pipeline (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
benknoll-umn committed Apr 17, 2023
1 parent 4132717 commit 18d0170
Show file tree
Hide file tree
Showing 73 changed files with 3,518 additions and 3,229 deletions.
4 changes: 2 additions & 2 deletions python/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
import sys
import re

sys.path.insert(0, os.path.abspath('../'))

import mtap

sys.path.insert(0, os.path.abspath('../'))

# -- Project information -----------------------------------------------------

project = 'MTAP'
Expand Down
9 changes: 6 additions & 3 deletions python/docs/deployment.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
***************
mtap.deployment
===============
Deployment
----------
***************

Deploying Processors
====================

.. automodule:: mtap.deployment
.. autoclass:: Deployment
:members:
Expand Down
3 changes: 3 additions & 0 deletions python/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ Welcome to MTAP's documentation!
:caption: Contents:

mtap
processing
deployment
pipeline
serialization
metrics

Overview
========
Expand Down
9 changes: 9 additions & 0 deletions python/docs/metrics.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
************
mtap.metrics
************

Computing Metrics using processing
----------------------------------

.. automodule:: mtap.metrics
:members:
129 changes: 16 additions & 113 deletions python/docs/mtap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ mtap

.. contents::

Command-Line Utility
--------------------

Running Events Service
^^^^^^^^^^^^^^^^^^^^^^
======================

usage:

Expand All @@ -30,136 +27,42 @@ usage:
--config CONFIG, -c CONFIG
path to config file
API Documentation
=================
Events service client, documents
--------------------------------
.. autoclass:: EventsClient
================================
.. autofunction:: events_client
.. autoclass:: mtap.types.EventsClient
:show-inheritance:
:members:
.. autoclass:: Event
:members:
.. autoclass:: Document
:members:
.. autoclass:: mtap.data.Labeler
:members:
.. autoclass:: mtap.data.LabelIndexInfo
:members:
.. autoclass:: mtap.data.LabelIndexType
.. autoclass:: mtap.types.Labeler
:members:

Labels
------
.. autoclass:: mtap.data.Label
======
.. autoclass:: mtap.types.Label
:members:
.. autoclass:: mtap.data.Location
.. autoclass:: Location
:members:
.. autofunction:: label
.. autoclass:: GenericLabel
:members:
:show-inheritance:

Label Indices
-------------
.. autofunction:: label_index
.. autoclass:: mtap.data.LabelIndex
:members:

Custom Label Types
------------------
.. autoclass:: mtap.data.ProtoLabelAdapter
:members:

Creating Processors
-------------------
.. autoclass:: mtap.processing.Processor
:members:
.. autoclass:: EventProcessor
:members:
:show-inheritance:
.. autoclass:: DocumentProcessor
:members:
:show-inheritance:
.. autoclass:: mtap.processing.Stopwatch
:members:

Processor Description Decorators
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autofunction:: processor
.. automodule:: mtap.processing.descriptions
:members:
:no-inherited-members:
:exclude-members: processor

Running Services
----------------
.. module:: mtap
:noindex:
.. autofunction:: processor_parser
.. autofunction:: run_processor

Running a pipeline
------------------
.. autoclass:: Pipeline
:members:
:show-inheritance:
.. autoclass:: mtap.processing.MpConfig
:members:
.. autoclass:: mtap.processing.ComponentDescriptor
.. autoclass:: RemoteProcessor
:show-inheritance:
.. autoclass:: LocalProcessor
:show-inheritance:

Pipeline Document Sources
^^^^^^^^^^^^^^^^^^^^^^^^^
.. module:: mtap.processing
:noindex:
.. autoclass:: ProcessingSource
:members:
.. autoclass:: FilesInDirectoryProcessingSource
:members:
:show-inheritance:
=============
Label indices are normally retrieved via the :attr:`~mtap.Document.labels` property, but
they can be created independently of documents as well.

Pipeline Results
^^^^^^^^^^^^^^^^
.. autoclass:: BatchPipelineResult
.. autoclass:: PipelineResult
.. autoclass:: ComponentResult
.. autoclass:: TimerStats
.. autoclass:: AggregateTimingInfo
:members:

Pipeline Error Handling
^^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: mtap.processing._error_handling
:no-members:
.. module:: mtap.processing
.. autoclass:: ProcessingErrorHandler
.. autoclass:: ErrorInfo
.. autoclass:: ErrorOrigin
:members:
.. autoclass:: StopProcessing
.. autoclass:: SuppressError
.. autoclass:: ErrorHandlerRegistry
:members:
.. autoclass:: SimpleErrorHandler
:members:
:show-inheritance:
.. autoclass:: TerminationErrorHandler
:members:
:show-inheritance:
.. autoclass:: LoggingErrorHandler
:members:
:show-inheritance:
.. autoclass:: ErrorsDirectoryErrorHandler
:members:
:show-inheritance:
.. autoclass:: SuppressAllErrorsHandler
.. autofunction:: label_index
.. autoclass:: mtap.types.LabelIndex
:members:
:show-inheritance:

Configuration
-------------
=============
.. module:: mtap
:noindex:
.. autoclass:: Config
71 changes: 71 additions & 0 deletions python/docs/pipeline.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
*************
mtap.pipeline
*************
.. module:: mtap.pipeline


Running a pipeline
==================
.. autoclass:: Pipeline
:members:
:show-inheritance:
.. autoclass:: MpConfig
:members:
.. autoclass:: ComponentDescriptor
.. autoclass:: RemoteProcessor
:show-inheritance:
.. autoclass:: LocalProcessor
:show-inheritance:

Pipeline Document Sources
=========================
.. autoclass:: ProcessingSource
:members:
.. autoclass:: FilesInDirectoryProcessingSource
:members:
:show-inheritance:

Pipeline Results
================
.. autoclass:: BatchPipelineResult
:members:
.. autoclass:: PipelineResult
:members:
.. autoclass:: mtap.processing.results.ComponentResult
:members:
.. autoclass:: mtap.processing.results.TimerStats
:members:
.. autoclass:: mtap.processing.results.AggregateTimingInfo
:members:

Pipeline Error Handling
=======================
.. automodule:: mtap.pipeline._error_handling
:no-members:
.. module:: mtap.pipeline
:noindex:
.. autoclass:: ProcessingErrorHandler
:members:
.. autoclass:: mtap.processing.ErrorInfo
:members:
.. autoclass:: mtap.processing.ErrorOrigin
:members:
.. autoclass:: StopProcessing
.. autoclass:: SuppressError
.. autoclass:: ErrorHandlerRegistry
:members:
.. autoclass:: SimpleErrorHandler
:members:
:show-inheritance:
.. autoclass:: TerminationErrorHandler
:members:
:show-inheritance:
.. autoclass:: LoggingErrorHandler
:members:
:show-inheritance:
.. autoclass:: ErrorsDirectoryErrorHandler
:members:
:show-inheritance:
.. autoclass:: SuppressAllErrorsHandler
:members:
:show-inheritance:
44 changes: 44 additions & 0 deletions python/docs/processing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
***************
mtap.processing
***************

.. module:: mtap.processing

Processor Abstract Classes
==========================

.. autoclass:: Processor
:members:
.. autoclass:: mtap.EventProcessor
:members:
:show-inheritance:
.. autoclass:: mtap.DocumentProcessor
:members:
:show-inheritance:

Processor Utilities
===================

.. autoclass:: Stopwatch
:members:

Processor Description Decorators
================================
.. automodule:: mtap.descriptors
.. autofunction:: processor
.. autofunction:: parameter
.. autofunction:: labels
.. autofunction:: label_property
.. autoclass:: ProcessorDescriptor
:members:
.. autoclass:: ParameterDescriptor
:members:
.. autoclass:: LabelIndexDescriptor
:members:
.. autoclass:: LabelPropertyDescriptor
:members:

Running Services
================
.. autofunction:: mtap.processor_parser
.. autofunction:: mtap.run_processor
5 changes: 2 additions & 3 deletions python/docs/serialization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@ Serialization
:members:

Built-In Serializers
^^^^^^^^^^^^^^^^^^^^
--------------------
.. autodata:: JsonSerializer
:no-value:
.. autodata:: YamlSerializer
:no-value:
.. autodata:: PickleSerializer
:no-value:
.. autofunction:: get_serializer

Helpers
^^^^^^^
-------
.. autofunction:: event_to_dict
.. autofunction:: dict_to_event
.. autofunction:: document_to_dict
Expand Down
33 changes: 17 additions & 16 deletions python/mtap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,29 @@
"""Public API and access points for the MTAP Framework."""

from mtap._config import Config
from mtap._events_service import EventsServer
from mtap.data import (
Document,
Event,
EventsClient,
GenericLabel,
label,
label_index,
Location,
)
from mtap._document import Document
from mtap._event import Event
from mtap._events_client import events_client
from mtap._labels import GenericLabel, label, Location
from mtap._label_indices import label_index

from mtap.processing import (
DocumentProcessor,
EventProcessor,
Pipeline,
ProcessorServer,
descriptions,
processor,
processor_parser,
run_processor,
RemoteProcessor,
run_processor
)

from mtap.descriptors import (
processor
)

from mtap.pipeline import (
Pipeline,
LocalProcessor,
RemoteProcessor,
)

from mtap.version import (
__version__,
__version_tuple__,
Expand Down

0 comments on commit 18d0170

Please sign in to comment.