Skip to content

Commit 9ea1e20

Browse files
authored
Merge branch 'master' into build/correct-requires-python-metadata
2 parents 44c41a0 + 61d751b commit 9ea1e20

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

RELEASES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 0.9.4dev
44

55
#### New features
6+
+ NumPy 2.0 support is added (PR #629)
67
+ New quantized FGW solvers `ot.gromov.quantized_fused_gromov_wasserstein`, `ot.gromov.quantized_fused_gromov_wasserstein_samples` and `ot.gromov.quantized_fused_gromov_wasserstein_partitioned` (PR #603)
78
+ `ot.gromov._gw.solve_gromov_linesearch` now has an argument to specify if the matrices are symmetric in which case the computation can be done faster (PR #607).
89
+ Continuous entropic mapping (PR #613)

ot/da.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ class label
497497

498498
if (ys is not None) and (yt is not None):
499499

500-
if self.limit_max != np.infty:
500+
if self.limit_max != np.inf:
501501
self.limit_max = self.limit_max * nx.max(self.cost_)
502502

503503
# missing_labels is a (ns, nt) matrix of {0, 1} such that
@@ -519,7 +519,7 @@ class label
519519
cost_correction = label_match * missing_labels * self.limit_max
520520
# this operation is necessary because 0 * Inf = NAN
521521
# thus is irrelevant when limit_max is finite
522-
cost_correction = nx.nan_to_num(cost_correction, -np.infty)
522+
cost_correction = nx.nan_to_num(cost_correction, -np.inf)
523523
self.cost_ = nx.maximum(self.cost_, cost_correction)
524524

525525
# distribution estimation
@@ -1067,7 +1067,7 @@ class SinkhornTransport(BaseTransport):
10671067
method from :ref:`[66]
10681068
<references-sinkhorntransport>` and :ref:`[19]
10691069
<references-sinkhorntransport>`.
1070-
limit_max: float, optional (default=np.infty)
1070+
limit_max: float, optional (default=np.inf)
10711071
Controls the semi supervised mode. Transport between labeled source
10721072
and target samples of different classes will exhibit an cost defined
10731073
by this variable
@@ -1109,7 +1109,7 @@ def __init__(self, reg_e=1., method="sinkhorn_log", max_iter=1000,
11091109
tol=10e-9, verbose=False, log=False,
11101110
metric="sqeuclidean", norm=None,
11111111
distribution_estimation=distribution_estimation_uniform,
1112-
out_of_sample_map='continuous', limit_max=np.infty):
1112+
out_of_sample_map='continuous', limit_max=np.inf):
11131113

11141114
if out_of_sample_map not in ['ferradans', 'continuous']:
11151115
raise ValueError('Unknown out_of_sample_map method')
@@ -1417,7 +1417,7 @@ class SinkhornLpl1Transport(BaseTransport):
14171417
The kind of out of sample mapping to apply to transport samples
14181418
from a domain into another one. Currently the only possible option is
14191419
"ferradans" which uses the method proposed in :ref:`[6] <references-sinkhornlpl1transport>`.
1420-
limit_max: float, optional (default=np.infty)
1420+
limit_max: float, optional (default=np.inf)
14211421
Controls the semi supervised mode. Transport between labeled source
14221422
and target samples of different classes will exhibit a cost defined by
14231423
limit_max.
@@ -1450,7 +1450,7 @@ def __init__(self, reg_e=1., reg_cl=0.1,
14501450
tol=10e-9, verbose=False,
14511451
metric="sqeuclidean", norm=None,
14521452
distribution_estimation=distribution_estimation_uniform,
1453-
out_of_sample_map='ferradans', limit_max=np.infty):
1453+
out_of_sample_map='ferradans', limit_max=np.inf):
14541454
self.reg_e = reg_e
14551455
self.reg_cl = reg_cl
14561456
self.max_iter = max_iter

ot/regpath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ def semi_relaxed_path(a: np.array, b: np.array, C: np.array, reg=1e-4,
762762
active_index.append(i * m + j)
763763
gamma_list = []
764764
t_list = []
765-
current_gamma = np.Inf
765+
current_gamma = np.inf
766766
augmented_H0 = construct_augmented_H(active_index, m, Hc, HrHr)
767767
add_col = np.array([])
768768
id_pop = -1

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
[build-system]
2-
requires = ["setuptools", "wheel", "oldest-supported-numpy", "cython>=0.23"]
3-
build-backend = "setuptools.build_meta"
2+
requires = [
3+
"setuptools>=42",
4+
"oldest-supported-numpy; python_version < '3.9'",
5+
"numpy>=2.0.0; python_version >= '3.9'",
6+
"cython>=0.23"
7+
]
8+
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
license='MIT',
7070
scripts=[],
7171
data_files=[],
72-
setup_requires=["oldest-supported-numpy", "cython>=0.23"],
7372
install_requires=["numpy>=1.16", "scipy>=1.6"],
7473
python_requires=">=3.7",
7574
classifiers=[

0 commit comments

Comments
 (0)