Skip to content

Commit c8d807b

Browse files
committed
make release-tag: Merge branch 'main' into stable
2 parents 35eb259 + cf8b0c4 commit c8d807b

19 files changed

+170563
-684
lines changed

.github/workflows/readme.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ jobs:
2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip
24-
python -m pip install invoke rundoc .
24+
python -m pip install invoke tomli rundoc .
2525
- name: Run the README.md
2626
run: invoke readme

.github/workflows/tutorials.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ jobs:
2020
- name: Install package and dependencies
2121
run: |
2222
python -m pip install --upgrade pip
23-
python -m pip install invoke jupyter .[tutorials]
23+
python -m pip install invoke tomli jupyter .[tutorials]
2424
- name: invoke tutorials
2525
run: invoke tutorials

HISTORY.md

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

3+
## v0.10.1 - 2024-03-13
4+
5+
This release fixes a bug that occurred when calculating probability density in a gaussian copula.
6+
7+
### Bugs Fixed
8+
9+
* Warning printed too many times (`RuntimeWarning: invalid value encountered in scalar divide ....`) - Issue [#364](https://github.com/sdv-dev/Copulas/issues/364) by @frances-h
10+
* Set `allow_singular=True` when calculating probability_density - Issue [#374](https://github.com/sdv-dev/Copulas/issues/374) by @fealho
11+
12+
### Maintenance
13+
14+
* Transition from using setup.py to pyroject.toml to specify project metadata - Issue [#376](https://github.com/sdv-dev/Copulas/issues/376) by @frances-h
15+
* Remove bumpversion and use bump-my-version - Issue [#377](https://github.com/sdv-dev/Copulas/issues/377) by @frances-h
16+
* Add build to dev requirements - Issue [#382](https://github.com/sdv-dev/Copulas/pull/382) by @amontanez24
17+
18+
## v0.10.0 - 2023-11-13
19+
20+
This release updates all visualizations to use plotly, and removes the matplotlib dependency.
21+
22+
### New Features
23+
24+
* Move visualization functions to plotly and get rid of matplotlib dependency - Issue [#348](https://github.com/sdv-dev/Copulas/issues/348) by @fealho
25+
326
## v0.9.2 - 2023-10-12
427

528
This release removes a warning that was being raised when univariate distributions failed to fit and logs the message instead.

MANIFEST.in

Lines changed: 0 additions & 12 deletions
This file was deleted.

Makefile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ serve-docs: ## compile the docs watching for changes
158158

159159
.PHONY: dist
160160
dist: clean ## builds source and wheel package
161-
python setup.py sdist
162-
python setup.py bdist_wheel
161+
python -m build --wheel --sdist
163162
ls -l dist
164163

165164
.PHONY: publish-confirm
@@ -197,23 +196,23 @@ git-push-tags-stable: ## Push tags and stable to github
197196

198197
.PHONY: bumpversion-release
199198
bumpversion-release: ## Bump the version to the next release
200-
bumpversion release
199+
bump-my-version bump release
201200

202201
.PHONY: bumpversion-patch
203202
bumpversion-patch: ## Bump the version to the next patch
204-
bumpversion --no-tag patch
203+
bump-my-version bump patch --no-tag
205204

206205
.PHONY: bumpversion-candidate
207206
bumpversion-candidate: ## Bump the version to the next candidate
208-
bumpversion candidate --no-tag
207+
bump-my-version bump candidate --no-tag
209208

210209
.PHONY: bumpversion-minor
211210
bumpversion-minor: ## Bump the version the next minor skipping the release
212-
bumpversion --no-tag minor
211+
bump-my-version bump minor --no-tag
213212

214213
.PHONY: bumpversion-major
215214
bumpversion-major: ## Bump the version the next major skipping the release
216-
bumpversion --no-tag major
215+
bump-my-version bump major --no-tag
217216

218217
.PHONY: bumpversion-revert
219218
bumpversion-revert: ## Undo a previous bumpversion-release
@@ -223,7 +222,7 @@ bumpversion-revert: ## Undo a previous bumpversion-release
223222

224223
CLEAN_DIR := $(shell git status --short | grep -v ??)
225224
CURRENT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
226-
CURRENT_VERSION := $(shell grep "^current_version" setup.cfg | grep -o "dev[0-9]*")
225+
CURRENT_VERSION := $(shell grep "^current_version" pyproject.toml | grep -o "dev[0-9]*")
227226
CHANGELOG_LINES := $(shell git diff HEAD..origin/stable HISTORY.md 2>&1 | wc -l)
228227

229228
.PHONY: check-clean

copulas/__init__.py

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

55
__author__ = 'DataCebo, Inc.'
66
__email__ = '[email protected]'
7-
__version__ = '0.9.2'
7+
__version__ = '0.10.1.dev1'
88

99
import contextlib
1010
import importlib

copulas/multivariate/gaussian.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ def probability_density(self, X):
148148
"""
149149
self.check_fit()
150150
transformed = self._transform_to_normal(X)
151-
return stats.multivariate_normal.pdf(transformed, cov=self.correlation)
151+
152+
return stats.multivariate_normal.pdf(
153+
transformed, cov=self.correlation, allow_singular=True)
152154

153155
def cumulative_distribution(self, X):
154156
"""Compute the cumulative distribution value for each point in X.

copulas/univariate/truncated_gaussian.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""TruncatedGaussian module."""
22

3+
import warnings
4+
35
import numpy as np
46
from scipy.optimize import fmin_slsqp
57
from scipy.stats import truncnorm
@@ -47,10 +49,12 @@ def nnlf(params):
4749
return truncnorm.nnlf((a, b, loc, scale), X)
4850

4951
initial_params = X.mean(), X.std()
50-
optimal = fmin_slsqp(nnlf, initial_params, iprint=False, bounds=[
51-
(self.min, self.max),
52-
(0.0, (self.max - self.min)**2)
53-
])
52+
with warnings.catch_warnings():
53+
warnings.simplefilter('ignore', category=RuntimeWarning)
54+
optimal = fmin_slsqp(nnlf, initial_params, iprint=False, bounds=[
55+
(self.min, self.max),
56+
(0.0, (self.max - self.min)**2)
57+
])
5458

5559
loc, scale = optimal
5660
a = (self.min - loc) / scale

0 commit comments

Comments
 (0)