Skip to content

Commit c6b28a8

Browse files
committed
make release-tag: Merge branch 'master' into stable
2 parents 75c75f3 + 071c982 commit c6b28a8

File tree

24 files changed

+2523
-101
lines changed

24 files changed

+2523
-101
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Config file for automatic testing at travis-ci.org
2+
dist: bionic
23
language: python
34
python:
45
- 3.6
@@ -8,7 +9,7 @@ python:
89
install: pip install -U tox-travis
910

1011
# Command to run tests
11-
script: tox
12+
script: travis_wait 30 tox # wait before termination
1213

1314
deploy:
1415

HISTORY.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# History
22

3-
## 0.1.0
3+
## 0.1.0 - 2020-09-15
44

5-
* First release on PyPI.
5+
Release on PyPI: https://pypi.org/project/cardea/
6+
7+
* Analysis notebooks enhancement - [Issue #58](https://github.com/DAI-Lab/Cardea/issues/58) by @sarahmish
8+
9+
* MIMIC III data loader enhancement - [Issue #57](https://github.com/DAI-Lab/Cardea/issues/57) by @sarahmish
10+
11+
* Freeze package on analysis compatibility - [Issue #55](https://github.com/DAI-Lab/Cardea/issues/55) by @sarahmish

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ include HISTORY.md
44
include LICENSE
55
include README.md
66

7+
recursive-include cardea *.xml
8+
79
recursive-include tests *
810
recursive-exclude * __pycache__
911
recursive-exclude * *.py[co]

Makefile

Lines changed: 106 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.PHONY: clean clean-test clean-pyc clean-build clean-docs docs help
21
.DEFAULT_GOAL := help
32

43
define BROWSER_PYSCRIPT
@@ -26,68 +25,101 @@ export PRINT_HELP_PYSCRIPT
2625

2726
BROWSER := python -c "$$BROWSER_PYSCRIPT"
2827

28+
.PHONY: help
2929
help:
3030
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
3131

3232

3333
# CLEAN TARGETS
3434

35-
36-
clean: clean-build clean-pyc clean-coverage clean-test clean-docs ## remove all build, test, coverage, docs and Python artifacts
37-
35+
.PHONY: clean-build
3836
clean-build: ## remove build artifacts
3937
rm -fr build/
4038
rm -fr dist/
4139
rm -fr .eggs/
4240
find . -name '*.egg-info' -exec rm -fr {} +
4341
find . -name '*.egg' -exec rm -f {} +
4442

43+
.PHONY: clean-pyc
4544
clean-pyc: ## remove Python file artifacts
4645
find . -name '*.pyc' -exec rm -f {} +
4746
find . -name '*.pyo' -exec rm -f {} +
4847
find . -name '*~' -exec rm -f {} +
4948
find . -name '__pycache__' -exec rm -fr {} +
5049

50+
.PHONY: clean-docs
5151
clean-docs: ## remove previously built docs
5252
rm -f docs/api/*.rst
5353
$(MAKE) -C docs clean
5454

55+
.PHONY: clean-coverage
5556
clean-coverage: ## remove coverage artifacts
5657
rm -f .coverage
5758
rm -f .coverage.*
5859
rm -fr htmlcov/
5960

61+
.PHONY: clean-test
6062
clean-test: ## remove test and coverage artifacts
6163
rm -fr .tox/
6264
rm -fr .pytest_cache
6365

66+
.PHONY: clean
67+
clean: clean-build clean-pyc clean-test clean-coverage clean-docs ## remove all build, test, coverage, docs and Python artifacts
6468

65-
# LINT TARGETS
6669

70+
# INSTALL TARGETS
6771

72+
.PHONY: install
73+
install: clean-build clean-pyc ## install the package to the active Python's site-packages
74+
pip install .
75+
76+
.PHONY: install-test
77+
install-test: clean-build clean-pyc ## install the package and test dependencies
78+
pip install .[test]
79+
80+
.PHONY: install-develop
81+
install-develop: clean-build clean-pyc ## install the package in editable mode and dependencies for development
82+
pip install -e .[dev]
83+
84+
85+
# LINT TARGETS
86+
87+
.PHONY: lint
6888
lint: ## check style with flake8 and isort
6989
flake8 cardea tests
7090
isort -c --recursive cardea tests
7191

92+
93+
94+
.PHONY: fix-lint
7295
fixlint: ## fix lint issues using autoflake, autopep8, and isort
73-
find cardea -name '*.py' | xargs autoflake --in-place --remove-all-unused-imports --remove-unused-variables
96+
find cardea -name '*.py' | xargs autoflake --in-place --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports
7497
autopep8 --in-place --recursive --aggressive cardea
7598
isort --apply --atomic --recursive cardea
7699

77-
find tests -name '*.py' | xargs autoflake --in-place --remove-all-unused-imports --remove-unused-variables
100+
find tests -name '*.py' | xargs autoflake --in-place --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports
78101
autopep8 --in-place --recursive --aggressive tests
79102
isort --apply --atomic --recursive tests
80103

81104

82-
# TEST TARGETS
83105

84106

107+
108+
# TEST TARGETS
109+
110+
.PHONY: test
85111
test: ## run tests quickly with the default Python
86112
pytest
87113

114+
.PHONY: test-all
88115
test-all: ## run tests on every Python version with tox
89116
tox
90117

118+
119+
120+
121+
122+
.PHONY: coverage
91123
coverage: clean-coverage ## check code coverage quickly with the default Python
92124
coverage run --source cardea -m pytest
93125
coverage report -m
@@ -97,42 +129,90 @@ coverage: clean-coverage ## check code coverage quickly with the default Python
97129

98130
# DOCS TARGETS
99131

100-
132+
.PHONY: docs
101133
docs: clean-docs ## generate Sphinx HTML documentation, including API docs
102134
sphinx-apidoc --module-first --separate --no-toc --output-dir docs/api/ cardea
103135
$(MAKE) -C docs html
104136
touch docs/_build/html/.nojekyll
105137

138+
.PHONY: viewdocs
106139
viewdocs: docs ## view docs in browser
107140
$(BROWSER) docs/_build/html/index.html
108141

142+
.PHONY: servedocs
109143
servedocs: docs ## compile the docs watching for changes
110144
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
111145

112146

113147
# RELEASE TARGETS
114148

115-
116-
release: dist ## package and upload a release
117-
twine upload dist/*
118-
119-
test-release: dist ## package and upload a release on TestPyPI
120-
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
121-
149+
.PHONY: dist
122150
dist: clean ## builds source and wheel package
123151
python setup.py sdist
124152
python setup.py bdist_wheel
125153
ls -l dist
126154

155+
.PHONY: test-publish
156+
test-publish: dist ## package and upload a release on TestPyPI
157+
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
127158

128-
# INSTALL TARGETS
129-
130-
131-
install: clean-build clean-pyc ## install the package to the active Python's site-packages
132-
pip install .
133-
134-
install-test: clean-build clean-pyc ## install the package and test dependencies
135-
pip install .[test]
159+
.PHONY: publish
160+
publish: dist ## package and upload a release
161+
twine upload dist/*
136162

137-
install-develop: clean-build clean-pyc ## install the package in editable mode and dependencies for development
138-
pip install -e .[dev]
163+
.PHONY: bumpversion-release
164+
bumpversion-release: ## Merge master to stable and bumpversion release
165+
git checkout stable
166+
git merge --no-ff master -m"make release-tag: Merge branch 'master' into stable"
167+
bumpversion release
168+
git push --tags origin stable
169+
170+
.PHONY: bumpversion-patch
171+
bumpversion-patch: ## Merge stable to master and bumpversion patch
172+
git checkout master
173+
git merge stable
174+
bumpversion --no-tag patch
175+
git push
176+
177+
.PHONY: bumpversion-candidate
178+
bumpversion-candidate: ## Bump the version to the next candidate
179+
bumpversion candidate --no-tag
180+
181+
.PHONY: bumpversion-minor
182+
bumpversion-minor: ## Bump the version the next minor skipping the release
183+
bumpversion --no-tag minor
184+
185+
.PHONY: bumpversion-major
186+
bumpversion-major: ## Bump the version the next major skipping the release
187+
bumpversion --no-tag major
188+
189+
CURRENT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
190+
CHANGELOG_LINES := $(shell git diff HEAD..stable HISTORY.md | wc -l)
191+
192+
.PHONY: check-master
193+
check-master: ## Check if we are in master branch
194+
ifneq ($(CURRENT_BRANCH),master)
195+
$(error Please make the release from master branch\n)
196+
endif
197+
198+
.PHONY: check-history
199+
check-history: ## Check if HISTORY.md has been modified
200+
ifeq ($(CHANGELOG_LINES),0)
201+
$(error Please insert the release notes in HISTORY.md before releasing)
202+
endif
203+
204+
.PHONY: check-release
205+
check-release: check-master check-history ## Check if the release can be made
206+
@echo "A new release can be made"
207+
208+
.PHONY: release
209+
release: check-release bumpversion-release publish bumpversion-patch
210+
211+
.PHONY: release-candidate
212+
release-candidate: check-master publish bumpversion-candidate
213+
214+
.PHONY: release-minor
215+
release-minor: check-release bumpversion-minor release
216+
217+
.PHONY: release-major
218+
release-major: check-release bumpversion-major release

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
<img width=20% src="https://dai.lids.mit.edu/wp-content/uploads/2018/08/cardea.png" alt=“Cardea” />
33
</p>
44

5-
<p align="center">
5+
<p align="left">
66
<i>Cardea is a machine learning library built on top of FHIR schema. </I>
77
</p>
88

9-
<p align="center">
9+
<p align="left">
1010
<i>An open source project from Data to AI Lab at MIT </I>
1111
</p>
1212

1313

1414

15-
15+
[![Development Status](https://img.shields.io/badge/Development%20Status-2%20--%20Pre--Alpha-yellow)](https://pypi.org/search/?c=Development+Status+%3A%3A+2+-+Pre-Alpha)
1616
[![PyPi Shield](https://img.shields.io/pypi/v/cardea.svg)](https://pypi.python.org/pypi/cardea)
17-
[![Travis CI Shield](https://travis-ci.org/D3-AI/Cardea.svg?branch=master)](https://travis-ci.org/D3-AI/Cardea)
18-
17+
[![Travis CI Shield](https://travis-ci.org/DAI-Lab/Cardea.svg?branch=master)](https://travis-ci.org/DAI-Lab/Cardea)
18+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/DAI-Lab/Cardea/master?filepath=notebooks)
1919

2020
# Cardea
2121

@@ -39,4 +39,4 @@ Cardea is a machine learning library built on top of the FHIR data schema. The l
3939
- Free software: MIT license
4040

4141
## Documentation
42-
- Documentation: https://D3-AI.github.io/Cardea
42+
- Documentation: https://dai-lab.github.io/Cardea

cardea/__init__.py

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

44
__author__ = """MIT Data To AI Lab"""
55
__email__ = 'dailabmit@gmail.com'
6-
__version__ = '0.0.1'
6+
__version__ = '0.1.0.dev3'
77

88
import logging
99

cardea/cardea.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def generate_features(self, cutoff):
162162

163163
def execute_model(self, feature_matrix, target, primitives,
164164
optimize=False, hyperparameters=None):
165-
"""Executes and predict all the pipelines.
165+
"""Executes and predicts all of the pipelines.
166166
167167
This method executes the given pipeline and returns a list for all the pipelines
168168
with the result of each fold with its associated predicted values and actual values.
@@ -171,7 +171,7 @@ def execute_model(self, feature_matrix, target, primitives,
171171
data_frame: A dataframe, which encapsulates all the records of that entity.
172172
primitives_list: A list of the primitives within a pipeline.
173173
optimize: A boolean value which indicates whether to optimize the model or not.
174-
hyperparameters: A dictionary of hyperparameters for each primitives.
174+
hyperparameters: A dictionary of hyperparameters for each primitive.
175175
176176
Returns:
177177
A list for all the executed pipelines and its result.
@@ -182,8 +182,8 @@ def execute_model(self, feature_matrix, target, primitives,
182182
target=target,
183183
primitives_list=primitives,
184184
problem_type=self.chosen_problem.prediction_type,
185-
optimize=False,
186-
hyperparameters=None
185+
optimize=optimize,
186+
hyperparameters=hyperparameters
187187
)
188188

189189
def convert_to_json(dic):

0 commit comments

Comments
 (0)