Skip to content

Commit 6cad840

Browse files
authored
Merge pull request #81 from mdsol/develop
Merge Develop to Master
2 parents 5f75314 + 3f12ad7 commit 6cad840

25 files changed

+5705
-3826
lines changed

.travis.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,20 @@ python:
55
- "3.4"
66
- "3.5"
77
- "3.6"
8-
- "pypy"
8+
99
# command to install dependencies
1010
install: "python setup.py install"
1111
# command to run tests
12-
script: "python setup.py test"
12+
script: "python setup.py test"
13+
14+
# Automated Deployment to PyPI on tag
15+
deploy:
16+
provider: pypi
17+
user: glow-mdsol
18+
password:
19+
secure: aQgdQqAFPXcV/N11Id151C27754T2YZ8SFzfv3cng7mDDvaEceGfPhyrADT6F+KGhezZEsrcb4iRfHUNk1QXlh8t/LKmmDg0q33tQsJXJKDuNiZ76KWwdfmYhX6eb51COCUHom8O7W01IaoBVyb/nBC8W4dfwCRF7BEVZ9Xyt5k5/l4vLL8Shp8AyREruEo+hMhjtt7m/c1jvSwjcLri0TpfR+bjK4LIYH2W+Dv8Gtuy4IlsZ6tUpPRq5L29HcuRzOopX/WD5emR9LP0pYpt5tWVyWxaC03CW3SZ5RQmwhwFFTqZFj8NprcAGNrlp2b+Ak1bRZs8qGfmDgcHe6pdtZYOTc+szZx6bVGUQrWy1jAtBS8JvSzHnS9VYRP9ryk1CkZffqQnPlHhKlwQOqtmkMS5Yed2cTQJCPkcoEbSy5a1nKKfxHnCJlI7a3GA4SLzgcH6lsV1WVMxyk6hVBl3DNkEycOTmSmzR63hVZBib9W3LBhivkMPHbHMRVJEFNugLLFmkS3xX/mph7sXqpGGs4LugEphxq413nT6aTp/2Q3a0IX9TQteqnyQO6JYa06/RKGkRnPm+F4A2Cx6JshpzattjgrBTKvZER+cGPB3D9ndBw54wE9reera7HvSKhP6lZTG3ZwJUdcnZhcHjKfNcEXnz6WipqVVBe9X5JHGVSQ=
20+
on:
21+
tags: true
22+
python: "3.6"
23+
distributions: "sdist bdist_wheel"
24+

docs/source/classes.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,54 @@ Note: Any Class with the Prefix **Mdsol** represents a Medidata Rave specific ex
1717
:members:
1818
:undoc-members:
1919

20+
.. autoclass:: ActionType
21+
.. autoclass:: Address
22+
.. autoclass:: AdminData
23+
.. autoclass:: Alias
2024
.. autoclass:: Annotation
25+
.. autoclass:: Annotations
2126
.. autoclass:: AuditRecord
2227
.. autoclass:: BasicDefinitions
2328
.. autoclass:: CheckValue
29+
.. autoclass:: City
2430
.. autoclass:: ClinicalData
2531
.. autoclass:: CodeList
2632
.. autoclass:: CodeListItem
2733
.. autoclass:: CodeListRef
2834
.. autoclass:: Comment
35+
.. autoclass:: ControlType
36+
.. autoclass:: Country
37+
.. autoclass:: DataType
2938
.. autoclass:: DateTimeStamp
3039
.. autoclass:: Decode
40+
.. autoclass:: DisplayName
41+
.. autoclass:: Email
42+
.. autoclass:: FirstName
3143
.. autoclass:: Flag
3244
.. autoclass:: FlagType
3345
.. autoclass:: FlagValue
3446
.. autoclass:: FormData
3547
.. autoclass:: FormDef
3648
.. autoclass:: FormRef
49+
.. autoclass:: FullName
3750
.. autoclass:: GlobalVariables
51+
.. autoclass:: GranularityType
3852
.. autoclass:: ItemData
3953
.. autoclass:: ItemDef
4054
.. autoclass:: ItemGroupData
4155
.. autoclass:: ItemGroupDef
4256
.. autoclass:: ItemGroupRef
4357
.. autoclass:: ItemRef
58+
.. autoclass:: LastName
59+
.. autoclass:: LastUpdateMixin
60+
.. autoclass:: Location
4461
.. autoclass:: LocationRef
62+
.. autoclass:: LocationType
63+
.. autoclass:: LogicalRecordPositionType
64+
.. autoclass:: LoginName
65+
.. autoclass:: MODMAttribute
66+
.. autoclass:: MODMExtensionRegistry
67+
.. autoclass:: MODMMixin
4568
.. autoclass:: MdsolAttribute
4669
.. autoclass:: MdsolCheckAction
4770
.. autoclass:: MdsolCheckStep
@@ -55,20 +78,37 @@ Note: Any Class with the Prefix **Mdsol** represents a Medidata Rave specific ex
5578
.. autoclass:: MdsolHelpText
5679
.. autoclass:: MdsolLabelDef
5780
.. autoclass:: MdsolLabelRef
81+
.. autoclass:: MdsolProtocolDeviation
5882
.. autoclass:: MdsolQuery
5983
.. autoclass:: MdsolReviewGroup
6084
.. autoclass:: MdsolViewRestriction
6185
.. autoclass:: MeasurementUnit
6286
.. autoclass:: MeasurementUnitRef
6387
.. autoclass:: MetaDataVersion
88+
.. autoclass:: MetaDataVersionRef
89+
.. autoclass:: MilestoneMixin
6490
.. autoclass:: ODM
6591
.. autoclass:: ODMElement
92+
.. autoclass:: Organization
93+
.. autoclass:: OtherText
94+
.. autoclass:: Phone
95+
.. autoclass:: PostalCode
6696
.. autoclass:: Protocol
97+
.. autoclass:: ProtocolDeviationStatus
98+
.. autoclass:: QueryStatusType
6799
.. autoclass:: Question
68100
.. autoclass:: RangeCheck
101+
.. autoclass:: RangeCheckComparatorType
102+
.. autoclass:: RangeCheckType
69103
.. autoclass:: ReasonForChange
70104
.. autoclass:: Signature
71105
.. autoclass:: SignatureRef
106+
.. autoclass:: SimpleChildElement
107+
.. autoclass:: SiteRef
108+
.. autoclass:: SourceID
109+
.. autoclass:: StateProv
110+
.. autoclass:: StepType
111+
.. autoclass:: StreetName
72112
.. autoclass:: Study
73113
.. autoclass:: StudyEventData
74114
.. autoclass:: StudyEventDef
@@ -77,7 +117,9 @@ Note: Any Class with the Prefix **Mdsol** represents a Medidata Rave specific ex
77117
.. autoclass:: Symbol
78118
.. autoclass:: TransactionalElement
79119
.. autoclass:: TranslatedText
120+
.. autoclass:: User
80121
.. autoclass:: UserRef
122+
.. autoclass:: UserType
81123

82124
rwslib.rws_requests
83125
===================

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
parentdir = os.path.split(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))[0]
2121
sys.path.insert(0,str(parentdir))
22-
import rwslib
22+
2323
from rwslib import __version__, __copyright__
2424

2525
# -- General configuration -----------------------------------------------------

rwslib/__init__.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
__title__ = 'rwslib'
44
__author__ = 'Ian Sparks ([email protected])'
5-
__version__ = '1.1.8'
5+
__version__ = '1.2.0'
66
__license__ = 'MIT'
77
__copyright__ = 'Copyright 2017 Medidata Solutions Inc'
88

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

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

9596
start_time = time.time()
96-
r = action(full_url, **kwargs)
97+
98+
try:
99+
r = action(full_url, **kwargs)
100+
except (requests.exceptions.ConnectTimeout, requests.exceptions.ReadTimeout) as exc:
101+
if isinstance(exc, (requests.exceptions.ConnectTimeout,)):
102+
raise RWSException("Server Connection Timeout", "Connection timeout for {}".format(full_url))
103+
elif isinstance(exc, (requests.exceptions.ReadTimeout,)):
104+
raise RWSException("Server Read Timeout", "Read timeout for {}".format(full_url))
105+
97106
self.request_time = time.time() - start_time
98107
self.last_result = r #see also r.elapsed for timedelta object.
99108

rwslib/builders/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# builders
2+
3+
This package assists in the building of CDISC ODM (with Medidata Extensions where applicable)
4+
5+
## Organisation
6+
The package is broken down by the logical arrangement of the ODM document itself.
7+
8+
* [common.py](common.py) - common elements, functions that are reused across the module
9+
* [core.py](core.py) - the ODM parent element
10+
* [metadata.py](metadata.py) - metadata elements, starting with the Study Element
11+
* [clinicaldata.py](clinicaldata.py) - clinical data elements, starting with the ClinicalData Element
12+
* [admindata.py](admindata.py) - Administrative Data elements, starting with the AdminData Element
13+
* [constants.py](constants.py) - Constants such as enumerated lists of options for Type elements (as an example)

rwslib/builders/__init__.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# -*- coding: utf-8 -*-
2+
3+
__author__ = 'glow'
4+
5+
# Common elements
6+
from rwslib.builders.common import ODMElement, TransactionalElement
7+
8+
# Constants
9+
from rwslib.builders.constants import *
10+
11+
# Core
12+
from rwslib.builders.core import *
13+
14+
# Metadata
15+
from rwslib.builders.metadata import *
16+
17+
# ClinicalData
18+
from rwslib.builders.clinicaldata import *
19+
20+
# AdminData
21+
from rwslib.builders.admindata import *
22+
23+
# ReferenceData
24+
#from rwslib.builders.referencedata import *
25+
26+
# MODM
27+
from rwslib.builders.modm import *

0 commit comments

Comments
 (0)