Skip to content

Commit 61f29c7

Browse files
authored
Merge pull request #636 from CUQI-DTU/drop-python-38
Drop support of Python 3.8
2 parents f5b55b4 + b09e5d8 commit 61f29c7

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ubuntu-latest] # Add windows-latest, macos-latest to test on multiple OS
16-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
16+
python-version: ["3.9", "3.10", "3.11", "3.12"]
1717
steps:
1818
- uses: actions/checkout@v3
1919
- name: Set up Python ${{ matrix.python-version }}

cuqi/distribution/_beta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def logpdf(self, x):
4848

4949
# Check bounds
5050
if np.any(x<=0) or np.any(x>=1) or np.any(self.alpha<=0) or np.any(self.beta<=0):
51-
return -np.Inf
51+
return -np.inf
5252

5353
# Compute logpdf
5454
return np.sum(sps.beta.logpdf(x, a=self.alpha, b=self.beta))

cuqi/distribution/_cauchy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ def _is_out_of_bounds(self, x):
7575
def logpdf(self, x):
7676

7777
if self._is_out_of_bounds(x):
78-
return -np.Inf
78+
return -np.inf
7979

8080
return np.sum(-np.log(np.pi*self.scale*(1+((x-self.location)/self.scale)**2)))
8181

8282
def cdf(self, x):
8383

8484
if self._is_out_of_bounds(x):
85-
return -np.Inf
85+
return -np.inf
8686

8787
return np.sum(sps.cauchy.cdf(x, loc=self.location, scale=self.scale))
8888

cuqi/distribution/_truncated_normal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def logpdf(self, x):
9797
# the unnormalized logpdf
9898
# check if x falls in the range between np.array a and b
9999
if np.any(x < self.low) or np.any(x > self.high):
100-
return -np.Inf
100+
return -np.inf
101101
else:
102102
return self._normal.logpdf(x)
103103

demos/demo38_truncated_normal.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
p = cuqi.distribution.TruncatedNormal(
1313
mean=np.array([0, 0]),
1414
std=np.array([1, 1]),
15-
low=np.array([0, -np.Inf]),
16-
high=np.array([np.Inf, 0]))
15+
low=np.array([0, -np.inf]),
16+
high=np.array([np.inf, 0]))
1717

1818
plt.figure()
1919
plot_2D_density(p, -5, 5, -5, 5)
@@ -40,8 +40,8 @@
4040
x = cuqi.distribution.TruncatedNormal(
4141
mean=np.array([0, 0]),
4242
std=np.array([1, 1]),
43-
low=np.array([0, -np.Inf]),
44-
high=np.array([np.Inf, 0]))
43+
low=np.array([0, -np.inf]),
44+
high=np.array([np.inf, 0]))
4545
# the data distribution
4646
b = cuqi.distribution.Gaussian(A@x, 0.1)
4747

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ maintainers = [
1212
{name = "Chao Zhang", email = "[email protected]"}
1313
]
1414
readme = "README.md"
15-
requires-python = ">=3.8"
15+
requires-python = ">=3.9"
1616
license = {file = "LICENSE"}
1717
dynamic = ["dependencies", "version"]
1818

0 commit comments

Comments
 (0)