Skip to content

Commit 67794d3

Browse files
committed
make release-tag: Merge branch 'main' into stable
2 parents 04d12d9 + c295abe commit 67794d3

File tree

10 files changed

+79
-34
lines changed

10 files changed

+79
-34
lines changed

CONTRIBUTING.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,17 @@ Release Workflow
174174
The process of releasing a new version involves several steps combining both ``git`` and
175175
``bumpversion`` which, briefly:
176176

177-
1. Merge what is in ``master`` branch into ``stable`` branch.
177+
1. Merge what is in ``main`` branch into ``stable`` branch.
178178
2. Update the version in ``setup.cfg``, ``deepecho/__init__.py`` and
179179
``HISTORY.md`` files.
180180
3. Create a new git tag pointing at the corresponding commit in ``stable`` branch.
181-
4. Merge the new commit from ``stable`` into ``master``.
181+
4. Merge the new commit from ``stable`` into ``main``.
182182
5. Update the version in ``setup.cfg`` and ``deepecho/__init__.py``
183183
to open the next development iteration.
184184

185185
.. note:: Before starting the process, make sure that ``HISTORY.md`` has been updated with a new
186186
entry that explains the changes that will be included in the new version.
187-
Normally this is just a list of the Pull Requests that have been merged to master
187+
Normally this is just a list of the Pull Requests that have been merged to main
188188
since the last release.
189189

190190
Once this is done, run of the following commands:

HISTORY.md

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

3+
## 0.5.0 - 2023-11-13
4+
5+
This release updates the PAR's model progress bar to show loss values and time elapsed (verbose option).
6+
7+
### New Features
8+
* Update progress bar for PAR fitting - Issue [#80](https://github.com/sdv-dev/DeepEcho/issues/80) by @frances-h
9+
10+
311
## 0.4.2 - 2023-07-25
412

513
This release drops support for Python 3.7 and adds support for Python 3.11.

INSTALL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ make install
4747

4848
If you intend to modify the source code or contribute to the project you will need to
4949
install it from the source using the `make install-develop` command. In this case, we
50-
recommend you to branch from `master` first:
50+
recommend you to branch from `main` first:
5151

5252
```bash
5353
git clone git@github.com:sdv-dev/DeepEcho
5454
cd DeepEcho
55-
git checkout master
55+
git checkout main
5656
git checkout -b <your-branch-name>
5757
make install-develp
5858
```

Makefile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -165,22 +165,22 @@ publish: dist publish-confirm ## package and upload a release
165165
twine upload dist/*
166166

167167
.PHONY: bumpversion-release
168-
bumpversion-release: ## Merge master to stable and bumpversion release
168+
bumpversion-release: ## Merge main to stable and bumpversion release
169169
git checkout stable || git checkout -b stable
170-
git merge --no-ff master -m"make release-tag: Merge branch 'master' into stable"
170+
git merge --no-ff main -m"make release-tag: Merge branch 'main' into stable"
171171
bumpversion release
172172
git push --tags origin stable
173173

174174
.PHONY: bumpversion-release-test
175-
bumpversion-release-test: ## Merge master to stable and bumpversion release
175+
bumpversion-release-test: ## Merge main to stable and bumpversion release
176176
git checkout stable || git checkout -b stable
177-
git merge --no-ff master -m"make release-tag: Merge branch 'master' into stable"
177+
git merge --no-ff main -m"make release-tag: Merge branch 'main' into stable"
178178
bumpversion release --no-tag
179179
@echo git push --tags origin stable
180180

181181
.PHONY: bumpversion-patch
182-
bumpversion-patch: ## Merge stable to master and bumpversion patch
183-
git checkout master
182+
bumpversion-patch: ## Merge stable to main and bumpversion patch
183+
git checkout main
184184
git merge stable
185185
bumpversion --no-tag patch
186186
git push
@@ -199,7 +199,7 @@ bumpversion-major: ## Bump the version the next major skipping the release
199199

200200
.PHONY: bumpversion-revert
201201
bumpversion-revert: ## Undo a previous bumpversion-release
202-
git checkout master
202+
git checkout main
203203
git branch -D stable
204204

205205
CLEAN_DIR := $(shell git status --short | grep -v ??)
@@ -213,10 +213,10 @@ ifneq ($(CLEAN_DIR),)
213213
$(error There are uncommitted changes)
214214
endif
215215

216-
.PHONY: check-master
217-
check-master: ## Check if we are in master branch
218-
ifneq ($(CURRENT_BRANCH),master)
219-
$(error Please make the release from master branch\n)
216+
.PHONY: check-main
217+
check-main: ## Check if we are in main branch
218+
ifneq ($(CURRENT_BRANCH),main)
219+
$(error Please make the release from main branch\n)
220220
endif
221221

222222
.PHONY: check-candidate
@@ -232,7 +232,7 @@ ifeq ($(CHANGELOG_LINES),0)
232232
endif
233233

234234
.PHONY: check-release
235-
check-release: check-clean check-candidate check-master check-history ## Check if the release can be made
235+
check-release: check-clean check-candidate check-main check-history ## Check if the release can be made
236236
@echo "A new release can be made"
237237

238238
.PHONY: release
@@ -242,7 +242,7 @@ release: check-release bumpversion-release publish bumpversion-patch
242242
release-test: check-release bumpversion-release-test publish-test bumpversion-revert
243243

244244
.PHONY: release-candidate
245-
release-candidate: check-master publish bumpversion-candidate
245+
release-candidate: check-main publish bumpversion-candidate
246246

247247
.PHONY: release-candidate-test
248-
release-candidate-test: check-clean check-master publish-test
248+
release-candidate-test: check-clean check-main publish-test

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66

77
[![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)
88
[![PyPi Shield](https://img.shields.io/pypi/v/deepecho.svg)](https://pypi.python.org/pypi/deepecho)
9-
[![Tests](https://github.com/sdv-dev/DeepEcho/workflows/Run%20Tests/badge.svg)](https://github.com/sdv-dev/DeepEcho/actions?query=workflow%3A%22Run+Tests%22+branch%3Amaster)
9+
[![Tests](https://github.com/sdv-dev/DeepEcho/workflows/Run%20Tests/badge.svg)](https://github.com/sdv-dev/DeepEcho/actions?query=workflow%3A%22Run+Tests%22+branch%3Amain)
1010
[![Downloads](https://pepy.tech/badge/deepecho)](https://pepy.tech/project/deepecho)
11-
[![Coverage Status](https://codecov.io/gh/sdv-dev/DeepEcho/branch/master/graph/badge.svg)](https://codecov.io/gh/sdv-dev/DeepEcho)
12-
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/sdv-dev/DeepEcho/master?filepath=tutorials/timeseries_data)
11+
[![Coverage Status](https://codecov.io/gh/sdv-dev/DeepEcho/branch/main/graph/badge.svg)](https://codecov.io/gh/sdv-dev/DeepEcho)
12+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/sdv-dev/DeepEcho/main?filepath=tutorials/timeseries_data)
1313
[![Slack](https://img.shields.io/badge/Slack%20Workspace-Join%20now!-36C5F0?logo=slack)](https://bit.ly/sdv-slack-invite)
1414

1515
<div align="left">
1616
<br/>
1717
<p align="center">
1818
<a href="https://github.com/sdv-dev/DeepEcho">
19-
<img align="center" width=40% src="https://github.com/sdv-dev/SDV/blob/master/docs/images/DeepEcho-DataCebo.png"></img>
19+
<img align="center" width=40% src="https://github.com/sdv-dev/SDV/blob/stable/docs/images/DeepEcho-DataCebo.png"></img>
2020
</a>
2121
</p>
2222
</div>
@@ -49,12 +49,12 @@ time series**. It provides:
4949
[SDV Blog]: https://sdv.dev/blog
5050
[Documentation]: https://sdv.dev/SDV
5151
[Repository]: https://github.com/sdv-dev/DeepEcho
52-
[License]: https://github.com/sdv-dev/DeepEcho/blob/master/LICENSE
52+
[License]: https://github.com/sdv-dev/DeepEcho/blob/main/LICENSE
5353
[Development Status]: https://pypi.org/search/?c=Development+Status+%3A%3A+2+-+Pre-Alpha
54-
[Slack Logo]: https://github.com/sdv-dev/SDV/blob/master/docs/images/slack.png
54+
[Slack Logo]: https://github.com/sdv-dev/SDV/blob/stable/docs/images/slack.png
5555
[Community]: https://bit.ly/sdv-slack-invite
56-
[MyBinder Logo]: https://github.com/sdv-dev/SDV/blob/master/docs/images/mybinder.png
57-
[Tutorials]: https://mybinder.org/v2/gh/sdv-dev/DeepEcho/master?filepath=tutorials
56+
[MyBinder Logo]: https://github.com/sdv-dev/SDV/blob/stable/docs/images/mybinder.png
57+
[Tutorials]: https://mybinder.org/v2/gh/sdv-dev/DeepEcho/main?filepath=tutorials
5858

5959
# Install
6060

@@ -160,7 +160,7 @@ us developing new features or cool ideas!
160160

161161

162162
<div align="center">
163-
<a href="https://datacebo.com"><img align="center" width=40% src="https://github.com/sdv-dev/SDV/blob/master/docs/images/DataCebo.png"></img></a>
163+
<a href="https://datacebo.com"><img align="center" width=40% src="https://github.com/sdv-dev/SDV/blob/stable/docs/images/DataCebo.png"></img></a>
164164
</div>
165165
<br/>
166166
<br/>

deepecho/__init__.py

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

33
__author__ = 'DataCebo, Inc.'
44
__email__ = 'info@sdv.dev'
5-
__version__ = '0.4.2'
5+
__version__ = '0.5.0.dev1'
66
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
77

88
from deepecho.demo import load_demo

deepecho/models/par.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def __init__(self, epochs=128, sample_size=1, cuda=True, verbose=True):
105105

106106
self.device = torch.device(device)
107107
self.verbose = verbose
108+
self.loss_values = pd.DataFrame(columns=['Epoch', 'Loss'])
108109

109110
LOGGER.info('%s instance created', self)
110111

@@ -321,9 +322,13 @@ def fit_sequences(self, sequences, context_types, data_types):
321322
self._model = PARNet(self._data_dims, self._ctx_dims).to(self.device)
322323
optimizer = torch.optim.Adam(self._model.parameters(), lr=1e-3)
323324

324-
iterator = range(self.epochs)
325+
iterator = tqdm(range(self.epochs), disable=(not self.verbose))
325326
if self.verbose:
326-
iterator = tqdm(iterator)
327+
pbar_description = 'Loss ({loss:.3f})'
328+
iterator.set_description(pbar_description.format(loss=0))
329+
330+
# Reset loss_values dataframe
331+
self.loss_values = pd.DataFrame(columns=['Epoch', 'Loss'])
327332

328333
X_padded, seq_len = torch.nn.utils.rnn.pad_packed_sequence(X)
329334
for epoch in iterator:
@@ -333,8 +338,20 @@ def fit_sequences(self, sequences, context_types, data_types):
333338
optimizer.zero_grad()
334339
loss = self._compute_loss(X_padded[1:, :, :], Y_padded[:-1, :, :], seq_len)
335340
loss.backward()
341+
342+
epoch_loss_df = pd.DataFrame({
343+
'Epoch': [epoch],
344+
'Loss': [loss.item()]
345+
})
346+
if not self.loss_values.empty:
347+
self.loss_values = pd.concat(
348+
[self.loss_values, epoch_loss_df]
349+
).reset_index(drop=True)
350+
else:
351+
self.loss_values = epoch_loss_df
352+
336353
if self.verbose:
337-
iterator.set_description(f'Epoch {epoch +1} | Loss {loss.item()}')
354+
iterator.set_description(pbar_description.format(loss=loss.item()))
338355

339356
optimizer.step()
340357

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.4.2
2+
current_version = 0.5.0.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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,6 @@
112112
test_suite='tests',
113113
tests_require=tests_require,
114114
url='https://github.com/sdv-dev/DeepEcho',
115-
version='0.4.2',
115+
version='0.5.0.dev1',
116116
zip_safe=False,
117117
)

tests/integration/test_par.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ def test_basic(self):
3535
model.fit_sequences(sequences, context_types, data_types)
3636
model.sample_sequence([])
3737

38+
# Assert
39+
assert set(model.loss_values.columns) == {'Epoch', 'Loss'}
40+
assert len(model.loss_values) == 128
41+
3842
def test_conditional(self):
3943
"""Test the ``PARModel`` with conditional sampling."""
4044
sequences = [
@@ -60,6 +64,10 @@ def test_conditional(self):
6064
model.fit_sequences(sequences, context_types, data_types)
6165
model.sample_sequence([0])
6266

67+
# Assert
68+
assert set(model.loss_values.columns) == {'Epoch', 'Loss'}
69+
assert len(model.loss_values) == 128
70+
6371
def test_mixed(self):
6472
"""Test the ``PARModel`` with mixed input data."""
6573
sequences = [
@@ -85,6 +93,10 @@ def test_mixed(self):
8593
model.fit_sequences(sequences, context_types, data_types)
8694
model.sample_sequence([0])
8795

96+
# Assert
97+
assert set(model.loss_values.columns) == {'Epoch', 'Loss'}
98+
assert len(model.loss_values) == 128
99+
88100
def test_count(self):
89101
"""Test the PARModel with datatype ``count``."""
90102
sequences = [
@@ -110,6 +122,10 @@ def test_count(self):
110122
model.fit_sequences(sequences, context_types, data_types)
111123
model.sample_sequence([0])
112124

125+
# Assert
126+
assert set(model.loss_values.columns) == {'Epoch', 'Loss'}
127+
assert len(model.loss_values) == 128
128+
113129
def test_variable_length(self):
114130
"""Test ``PARModel`` with variable data length."""
115131
sequences = [
@@ -134,3 +150,7 @@ def test_variable_length(self):
134150
model = PARModel()
135151
model.fit_sequences(sequences, context_types, data_types)
136152
model.sample_sequence([0])
153+
154+
# Assert
155+
assert set(model.loss_values.columns) == {'Epoch', 'Loss'}
156+
assert len(model.loss_values) == 128

0 commit comments

Comments
 (0)