Skip to content

Commit f26bb90

Browse files
committed
Update validators
1 parent 90998ad commit f26bb90

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

setup.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
__version__ = "1.1.3" # update VERSION in constants.py
44
__author__ = "Predictive Healthcare @ Penn Medicine"
55

6-
from os import path
7-
from setuptools import setup, find_packages, find_namespace_packages
6+
from setuptools import setup, find_namespace_packages
87

98

109
setup(
@@ -24,6 +23,7 @@
2423
install_requires=[
2524
"altair",
2625
"black",
26+
"gspread",
2727
"gunicorn",
2828
"dash",
2929
"dash_bootstrap_components",
@@ -42,10 +42,9 @@
4242
"Operating System :: OS Independent",
4343
],
4444
python_requires='>=3.7',
45-
entry_points = {
45+
entry_points={
4646
'console_scripts': ['penn_chime=penn_chime.cli:main'],
4747
},
4848
keywords=[],
4949
include_package_data=True,
5050
)
51-

src/penn_chime/parameters.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
)
2020
from .validators import (
2121
Date,
22+
GteOne,
2223
OptionalDate,
2324
OptionalValue,
2425
OptionalStrictlyPositive,
@@ -64,7 +65,7 @@ class Disposition(_Disposition):
6465
@classmethod
6566
def create(cls, *, days: int, rate: float):
6667
"""Mandate key word arguments."""
67-
Positive(key="days", value=days)
68+
GteOne(key="days", value=days)
6869
Rate(key="rate", value=rate)
6970
return cls(days, rate)
7071

@@ -201,7 +202,7 @@ def validate(string):
201202
(
202203
"hospitalized_days",
203204
int,
204-
0,
205+
1,
205206
None,
206207
True,
207208
),
@@ -215,7 +216,7 @@ def validate(string):
215216
(
216217
"icu_days",
217218
int,
218-
0,
219+
1,
219220
None,
220221
True,
221222
),
@@ -285,7 +286,7 @@ def validate(string):
285286
(
286287
"ventilated_days",
287288
int,
288-
0,
289+
1,
289290
None,
290291
True,
291292
),

src/penn_chime/validators/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
OptionalStrictlyPositive = ValOptionalBounded(lower_bound=EPSILON)
1616
StrictlyPositive = ValBounded(lower_bound=EPSILON)
1717
Positive = ValBounded(lower_bound=-EPSILON)
18+
GteOne = ValBounded(lower_bound=1)
1819
Rate = ValRate()
1920
Date = ValDate()
2021
OptionalDate = ValOptionalDate()

0 commit comments

Comments
 (0)