Skip to content

Commit 2cbc429

Browse files
committed
make release-tag: Merge branch 'master' into stable
2 parents 8d8702a + b8facc7 commit 2cbc429

File tree

7 files changed

+31
-23
lines changed

7 files changed

+31
-23
lines changed

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
python-version: ${{ matrix.python-version }}
2222
- if: matrix.os == 'windows-latest'
2323
name: Install dependencies - Windows
24-
run: pip install 'torch>=1,<2' -f https://download.pytorch.org/whl/torch_stable.html
24+
run: pip install 'torch>=1,<1.8' -f https://download.pytorch.org/whl/torch_stable.html
2525
- name: Install package
2626
run: pip install invoke .[dev]
2727
- name: invoke lint
@@ -58,7 +58,7 @@ jobs:
5858
python-version: ${{ matrix.python-version }}
5959
- if: matrix.os == 'windows-latest'
6060
name: Install dependencies - Windows
61-
run: pip install 'torch>=1,<2' -f https://download.pytorch.org/whl/torch_stable.html
61+
run: pip install 'torch>=1,<1.8' -f https://download.pytorch.org/whl/torch_stable.html
6262
- name: Install package and dependencies
6363
run: pip install invoke .[test]
6464
- name: invoke pytest
@@ -105,7 +105,7 @@ jobs:
105105
- if: matrix.os == 'windows-latest'
106106
name: Install dependencies - Windows
107107
run: |
108-
pip install 'torch>=1,<2' -f https://download.pytorch.org/whl/torch_stable.html
108+
pip install 'torch>=1,<1.8' -f https://download.pytorch.org/whl/torch_stable.html
109109
choco install graphviz
110110
- name: Install package and dependencies
111111
run: pip install invoke jupyter .

conda/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set name = "deepecho" %}
2-
{% set version = "version = '0.2.0'" %}
2+
{% set version = "version = '0.2.1.dev1'" %}
33

44
package:
55
name: "{{ name|lower }}"

deepecho/__init__.py

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

33
__author__ = 'MIT Data To AI Lab'
44
__email__ = 'dailabmit@gmail.com'
5-
__version__ = '0.2.0'
5+
__version__ = '0.2.1.dev1'
66
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
77

88
from deepecho.demo import load_demo

deepecho/models/par.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,23 @@ def _data_to_tensor(self, data):
210210

211211
elif props['type'] in ['continuous', 'timestamp']:
212212
mu_idx, sigma_idx, missing_idx = props['indices']
213-
x[mu_idx] = 0.0 if (data[key][i] is None or props['std'] == 0) else (
214-
data[key][i] - props['mu']) / props['std']
213+
if pd.isnull(data[key][i]) or props['std'] == 0:
214+
x[mu_idx] = 0.0
215+
else:
216+
x[mu_idx] = (data[key][i] - props['mu']) / props['std']
217+
215218
x[sigma_idx] = 0.0
216-
x[missing_idx] = 1.0 if data[key][i] is None else 0.0
219+
x[missing_idx] = 1.0 if pd.isnull(data[key][i]) else 0.0
217220

218221
elif props['type'] in ['count']:
219222
r_idx, p_idx, missing_idx = props['indices']
220-
x[r_idx] = 0.0 if (data[key][i] is None or props['range'] == 0) else (
221-
data[key][i] - props['min']) / props['range']
223+
if pd.isnull(data[key][i]) or props['range'] == 0:
224+
x[r_idx] = 0.0
225+
else:
226+
x[r_idx] = (data[key][i] - props['min']) / props['range']
227+
222228
x[p_idx] = 0.0
223-
x[missing_idx] = 1.0 if data[key][i] is None else 0.0
229+
x[missing_idx] = 1.0 if pd.isnull(data[key][i]) else 0.0
224230

225231
elif props['type'] in ['categorical', 'ordinal']: # categorical
226232
value = data[key][i]

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.2.0
2+
current_version = 0.2.1.dev1
33
commit = True
44
tag = True
55
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<candidate>\d+))?

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
install_requires = [
1515
'numpy>=1.18.0,<2',
1616
'pandas>=1.1,<1.1.5',
17-
'torch>=1.4,<2',
17+
'torch>=1.4,<1.8',
1818
'tqdm>=4.10,<5',
1919
]
2020

@@ -50,7 +50,7 @@
5050
'flake8-docstrings>=1.5.0,<2',
5151
'flake8-sfs>=0.0.3,<0.1',
5252
'isort>=4.3.4,<5',
53-
'pylint>=2.5.3,<3',
53+
'pylint>=2.5.3,<2.7.2',
5454

5555
# fix style issues
5656
'autoflake>=1.1,<2',
@@ -99,6 +99,6 @@
9999
test_suite='tests',
100100
tests_require=tests_require,
101101
url='https://github.com/sdv-dev/DeepEcho',
102-
version='0.2.0',
102+
version='0.2.1.dev1',
103103
zip_safe=False,
104104
)

tests/integration/test_par.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import unittest
22

3+
import numpy as np
4+
35
from deepecho.models.par import PARModel
46

57

@@ -10,15 +12,15 @@ def test_basic(self):
1012
{
1113
'context': [],
1214
'data': [
13-
[0.0, 0.1, 0.2, 0.3, 0.4, 0.5],
15+
[0.0, np.nan, 0.2, 0.3, 0.4, 0.5],
1416
[0.5, 0.4, 0.3, 0.2, 0.1, 0.0],
1517
]
1618
},
1719
{
1820
'context': [],
1921
'data': [
2022
[0.0, 0.1, 0.2, 0.3, 0.4, 0.5],
21-
[0.5, 0.4, 0.3, 0.2, 0.1, 0.0],
23+
[0.5, 0.4, 0.3, 0.2, 0.1, np.nan],
2224
]
2325
}
2426
]
@@ -35,14 +37,14 @@ def test_conditional(self):
3537
'context': [0],
3638
'data': [
3739
[0.0, 0.1, 0.2, 0.3, 0.4, 0.5],
38-
[0.5, 0.4, 0.3, 0.2, 0.1, 0.0],
40+
[0.5, 0.4, 0.3, 0.2, np.nan, 0.0],
3941
]
4042
},
4143
{
4244
'context': [1],
4345
'data': [
4446
[0.5, 0.4, 0.3, 0.2, 0.1, 0.0],
45-
[0.0, 0.1, 0.2, 0.3, 0.4, 0.5],
47+
[0.0, 0.1, np.nan, 0.3, 0.4, 0.5],
4648
]
4749
}
4850
]
@@ -65,8 +67,8 @@ def test_mixed(self):
6567
{
6668
'context': [1],
6769
'data': [
68-
[0.5, 0.4, 0.3, 0.2, 0.1, 0.0],
69-
[0, 1, 0, 1, 0, 1],
70+
[0.5, np.nan, 0.3, 0.2, np.nan, 0.0],
71+
[0, 1, 0, 1, np.nan, 1],
7072
]
7173
}
7274
]
@@ -82,7 +84,7 @@ def test_count(self):
8284
{
8385
'context': [0.5],
8486
'data': [
85-
[0, 5, 5, 3, 1, 1],
87+
[0, 5, 5, np.nan, 1, 1],
8688
[0, 1, 2, 1, 0, 1],
8789
]
8890
},
@@ -114,7 +116,7 @@ def test_variable_length(self):
114116
'context': [1],
115117
'data': [
116118
[1, 6, 6, 4, 2, 2],
117-
[0, 1, 0, 1, 0, 1],
119+
[np.nan, 1, 0, 1, 0, np.nan],
118120
]
119121
}
120122
]

0 commit comments

Comments
 (0)