Skip to content

Commit

Permalink
Merge pull request #81 from mdsol/develop
Browse files Browse the repository at this point in the history
Merge Develop to Master
  • Loading branch information
iansparks committed Dec 7, 2017
2 parents 5f75314 + 3f12ad7 commit 6cad840
Show file tree
Hide file tree
Showing 25 changed files with 5,705 additions and 3,826 deletions.
16 changes: 14 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,20 @@ python:
- "3.4"
- "3.5"
- "3.6"
- "pypy"

# command to install dependencies
install: "python setup.py install"
# command to run tests
script: "python setup.py test"
script: "python setup.py test"

# Automated Deployment to PyPI on tag
deploy:
provider: pypi
user: glow-mdsol
password:
secure: aQgdQqAFPXcV/N11Id151C27754T2YZ8SFzfv3cng7mDDvaEceGfPhyrADT6F+KGhezZEsrcb4iRfHUNk1QXlh8t/LKmmDg0q33tQsJXJKDuNiZ76KWwdfmYhX6eb51COCUHom8O7W01IaoBVyb/nBC8W4dfwCRF7BEVZ9Xyt5k5/l4vLL8Shp8AyREruEo+hMhjtt7m/c1jvSwjcLri0TpfR+bjK4LIYH2W+Dv8Gtuy4IlsZ6tUpPRq5L29HcuRzOopX/WD5emR9LP0pYpt5tWVyWxaC03CW3SZ5RQmwhwFFTqZFj8NprcAGNrlp2b+Ak1bRZs8qGfmDgcHe6pdtZYOTc+szZx6bVGUQrWy1jAtBS8JvSzHnS9VYRP9ryk1CkZffqQnPlHhKlwQOqtmkMS5Yed2cTQJCPkcoEbSy5a1nKKfxHnCJlI7a3GA4SLzgcH6lsV1WVMxyk6hVBl3DNkEycOTmSmzR63hVZBib9W3LBhivkMPHbHMRVJEFNugLLFmkS3xX/mph7sXqpGGs4LugEphxq413nT6aTp/2Q3a0IX9TQteqnyQO6JYa06/RKGkRnPm+F4A2Cx6JshpzattjgrBTKvZER+cGPB3D9ndBw54wE9reera7HvSKhP6lZTG3ZwJUdcnZhcHjKfNcEXnz6WipqVVBe9X5JHGVSQ=
on:
tags: true
python: "3.6"
distributions: "sdist bdist_wheel"

42 changes: 42 additions & 0 deletions docs/source/classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,54 @@ Note: Any Class with the Prefix **Mdsol** represents a Medidata Rave specific ex
:members:
:undoc-members:

.. autoclass:: ActionType
.. autoclass:: Address
.. autoclass:: AdminData
.. autoclass:: Alias
.. autoclass:: Annotation
.. autoclass:: Annotations
.. autoclass:: AuditRecord
.. autoclass:: BasicDefinitions
.. autoclass:: CheckValue
.. autoclass:: City
.. autoclass:: ClinicalData
.. autoclass:: CodeList
.. autoclass:: CodeListItem
.. autoclass:: CodeListRef
.. autoclass:: Comment
.. autoclass:: ControlType
.. autoclass:: Country
.. autoclass:: DataType
.. autoclass:: DateTimeStamp
.. autoclass:: Decode
.. autoclass:: DisplayName
.. autoclass:: Email
.. autoclass:: FirstName
.. autoclass:: Flag
.. autoclass:: FlagType
.. autoclass:: FlagValue
.. autoclass:: FormData
.. autoclass:: FormDef
.. autoclass:: FormRef
.. autoclass:: FullName
.. autoclass:: GlobalVariables
.. autoclass:: GranularityType
.. autoclass:: ItemData
.. autoclass:: ItemDef
.. autoclass:: ItemGroupData
.. autoclass:: ItemGroupDef
.. autoclass:: ItemGroupRef
.. autoclass:: ItemRef
.. autoclass:: LastName
.. autoclass:: LastUpdateMixin
.. autoclass:: Location
.. autoclass:: LocationRef
.. autoclass:: LocationType
.. autoclass:: LogicalRecordPositionType
.. autoclass:: LoginName
.. autoclass:: MODMAttribute
.. autoclass:: MODMExtensionRegistry
.. autoclass:: MODMMixin
.. autoclass:: MdsolAttribute
.. autoclass:: MdsolCheckAction
.. autoclass:: MdsolCheckStep
Expand All @@ -55,20 +78,37 @@ Note: Any Class with the Prefix **Mdsol** represents a Medidata Rave specific ex
.. autoclass:: MdsolHelpText
.. autoclass:: MdsolLabelDef
.. autoclass:: MdsolLabelRef
.. autoclass:: MdsolProtocolDeviation
.. autoclass:: MdsolQuery
.. autoclass:: MdsolReviewGroup
.. autoclass:: MdsolViewRestriction
.. autoclass:: MeasurementUnit
.. autoclass:: MeasurementUnitRef
.. autoclass:: MetaDataVersion
.. autoclass:: MetaDataVersionRef
.. autoclass:: MilestoneMixin
.. autoclass:: ODM
.. autoclass:: ODMElement
.. autoclass:: Organization
.. autoclass:: OtherText
.. autoclass:: Phone
.. autoclass:: PostalCode
.. autoclass:: Protocol
.. autoclass:: ProtocolDeviationStatus
.. autoclass:: QueryStatusType
.. autoclass:: Question
.. autoclass:: RangeCheck
.. autoclass:: RangeCheckComparatorType
.. autoclass:: RangeCheckType
.. autoclass:: ReasonForChange
.. autoclass:: Signature
.. autoclass:: SignatureRef
.. autoclass:: SimpleChildElement
.. autoclass:: SiteRef
.. autoclass:: SourceID
.. autoclass:: StateProv
.. autoclass:: StepType
.. autoclass:: StreetName
.. autoclass:: Study
.. autoclass:: StudyEventData
.. autoclass:: StudyEventDef
Expand All @@ -77,7 +117,9 @@ Note: Any Class with the Prefix **Mdsol** represents a Medidata Rave specific ex
.. autoclass:: Symbol
.. autoclass:: TransactionalElement
.. autoclass:: TranslatedText
.. autoclass:: User
.. autoclass:: UserRef
.. autoclass:: UserType

rwslib.rws_requests
===================
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

parentdir = os.path.split(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))[0]
sys.path.insert(0,str(parentdir))
import rwslib

from rwslib import __version__, __copyright__

# -- General configuration -----------------------------------------------------
Expand Down
13 changes: 11 additions & 2 deletions rwslib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__title__ = 'rwslib'
__author__ = 'Ian Sparks (isparks@mdsol.com)'
__version__ = '1.1.8'
__version__ = '1.2.0'
__license__ = 'MIT'
__copyright__ = 'Copyright 2017 Medidata Solutions Inc'

Expand Down Expand Up @@ -74,6 +74,7 @@ def send_request(self, request_object, timeout=None, retries=1, **kwargs):
full_url = make_url(self.base_url, request_object.url_path())
if request_object.requires_authorization:
kwargs['auth'] = self.auth
# TODO: Look at different connect and read timeouts?
kwargs['timeout'] = timeout
kwargs.update(request_object.args())

Expand All @@ -93,7 +94,15 @@ def send_request(self, request_object, timeout=None, retries=1, **kwargs):
"POST": session.post}[request_object.method]

start_time = time.time()
r = action(full_url, **kwargs)

try:
r = action(full_url, **kwargs)
except (requests.exceptions.ConnectTimeout, requests.exceptions.ReadTimeout) as exc:
if isinstance(exc, (requests.exceptions.ConnectTimeout,)):
raise RWSException("Server Connection Timeout", "Connection timeout for {}".format(full_url))
elif isinstance(exc, (requests.exceptions.ReadTimeout,)):
raise RWSException("Server Read Timeout", "Read timeout for {}".format(full_url))

self.request_time = time.time() - start_time
self.last_result = r #see also r.elapsed for timedelta object.

Expand Down
13 changes: 13 additions & 0 deletions rwslib/builders/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# builders

This package assists in the building of CDISC ODM (with Medidata Extensions where applicable)

## Organisation
The package is broken down by the logical arrangement of the ODM document itself.

* [common.py](common.py) - common elements, functions that are reused across the module
* [core.py](core.py) - the ODM parent element
* [metadata.py](metadata.py) - metadata elements, starting with the Study Element
* [clinicaldata.py](clinicaldata.py) - clinical data elements, starting with the ClinicalData Element
* [admindata.py](admindata.py) - Administrative Data elements, starting with the AdminData Element
* [constants.py](constants.py) - Constants such as enumerated lists of options for Type elements (as an example)
27 changes: 27 additions & 0 deletions rwslib/builders/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-

__author__ = 'glow'

# Common elements
from rwslib.builders.common import ODMElement, TransactionalElement

# Constants
from rwslib.builders.constants import *

# Core
from rwslib.builders.core import *

# Metadata
from rwslib.builders.metadata import *

# ClinicalData
from rwslib.builders.clinicaldata import *

# AdminData
from rwslib.builders.admindata import *

# ReferenceData
#from rwslib.builders.referencedata import *

# MODM
from rwslib.builders.modm import *
Loading

0 comments on commit 6cad840

Please sign in to comment.