Skip to content

Commit

Permalink
Merge pull request #180 from havakv/update-ci
Browse files Browse the repository at this point in the history
Update python version
  • Loading branch information
havakv authored Sep 4, 2024
2 parents 0e9d6f9 + 9bfa885 commit f63e582
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: ['3.8', '3.9', '3.10']
config:
- { os: ubuntu-latest, torch-version: "torch==1.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html"}
- { os: windows-latest, torch-version: "torch==1.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html"}
- { os: ubuntu-latest, torch-version: "torch --index-url https://download.pytorch.org/whl/cpu"}
- { os: windows-latest, torch-version: "torch"}
- { os: macOS-latest, torch-version: "torch"}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion pycox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

__author__ = """Haavard Kvamme"""
__email__ = 'haavard.kvamme@gmail.com'
__version__ = '0.2.3'
__version__ = '0.3.0'

import pycox.datasets
import pycox.evaluation
Expand Down
2 changes: 1 addition & 1 deletion pycox/evaluation/eval_surv.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, surv, durations, events, censor_surv=None, censor_durations=N
self.censor_surv = censor_surv
self.censor_durations = censor_durations
self.steps = steps
assert pd.Series(self.index_surv).is_monotonic
assert pd.Series(self.index_surv).is_monotonic_increasing

@property
def censor_surv(self):
Expand Down
2 changes: 1 addition & 1 deletion pycox/models/cox_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def compute_expg_at_risk(ix, t):
[self.duration_col]
.loc[lambda x: x <= max_duration]
.drop_duplicates(keep='first'))
at_risk_sum = (pd.Series([compute_expg_at_risk(ix, t) for ix, t in times.iteritems()],
at_risk_sum = (pd.Series([compute_expg_at_risk(ix, t) for ix, t in times.items()],
index=times.values)
.rename('at_risk_sum'))
events = (df
Expand Down
3 changes: 1 addition & 2 deletions pycox/models/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def sample_alive_from_dates(dates, at_risk_dict, n_control=1):
lengths = np.array([at_risk_dict[x].shape[0] for x in dates]) # Can be moved outside
idx = (np.random.uniform(size=(n_control, dates.size)) * lengths).astype('int')
samp = np.empty((dates.size, n_control), dtype=int)
samp.fill(np.nan)

for it, time in enumerate(dates):
samp[it, :] = at_risk_dict[time][idx[:, it]]
Expand All @@ -35,7 +34,7 @@ def make_at_risk_dict(durations):
allidx = durations.index.values
keys = durations.drop_duplicates(keep='first')
at_risk_dict = dict()
for ix, t in keys.iteritems():
for ix, t in keys.items():
at_risk_dict[t] = allidx[ix:]
return at_risk_dict

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.2.3
current_version = 0.3.0
commit = True
tag = False

Expand Down
7 changes: 2 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

setup(
name='pycox',
version='0.2.3',
version='0.3.0',
description="Survival analysis with PyTorch",
long_description=long_description,
long_description_content_type='text/markdown',
Expand All @@ -51,9 +51,6 @@
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.6',
],
python_requires='>=3.6'
python_requires='>=3.8'
)

0 comments on commit f63e582

Please sign in to comment.