[med-svn] [Git][med-team/umap-learn][master] 7 commits: Cleanup changelog

Andreas Tille (@tille) gitlab at salsa.debian.org
Fri Sep 10 07:09:08 BST 2021



Andreas Tille pushed to branch master at Debian Med / umap-learn


Commits:
9ee805bb by Andreas Tille at 2021-09-10T08:04:37+02:00
Cleanup changelog

- - - - -
e08fb6e7 by Andreas Tille at 2021-09-10T08:05:03+02:00
routine-update: New upstream version

- - - - -
3fa8c8d1 by Andreas Tille at 2021-09-10T08:05:04+02:00
New upstream version 0.5.1+dfsg
- - - - -
3bce779b by Andreas Tille at 2021-09-10T08:05:06+02:00
Update upstream source from tag 'upstream/0.5.1+dfsg'

Update to upstream version '0.5.1+dfsg'
with Debian dir 2bce22555ac6392ec506eed0f802ba7cc6f1dab5
- - - - -
bc125ab5 by Andreas Tille at 2021-09-10T08:05:07+02:00
routine-update: Standards-Version: 4.6.0

- - - - -
30d4bb98 by Andreas Tille at 2021-09-10T08:05:11+02:00
Remove duplicate line from changelog.

Changes-By: lintian-brush

- - - - -
b41a9ab0 by Andreas Tille at 2021-09-10T08:08:37+02:00
Update to new upstream version, needs tensorflow

- - - - -


11 changed files:

- azure-pipelines.yml
- debian/changelog
- debian/control
- setup.py
- umap/__init__.py
- umap/layouts.py
- umap/plot.py
- umap/sparse.py
- umap/spectral.py
- umap/tests/test_umap_metrics.py
- umap/umap_.py


Changes:

=====================================
azure-pipelines.yml
=====================================
@@ -5,7 +5,6 @@
 
 trigger:
 - master
-- 0.5dev
 
 jobs:
   - job: Linux


=====================================
debian/changelog
=====================================
@@ -1,18 +1,19 @@
-umap-learn (0.5.0+dfsg-1) UNRELEASED; urgency=medium
+umap-learn (0.5.1+dfsg-1) UNRELEASED; urgency=medium
 
   [ Andreas Tille ]
-  * Drop unused lintian override
   * New upstream version
-  * Standards-Version: 4.5.1 (routine-update)
-  * Rename binary package tp python3-umap-learn
+  * Drop unused lintian override
+  * Rename binary package to python3-umap-learn
     Closes: #980509
   * Test runs only on 64 bit architectures
-  TODO: tensorflow
+  * Standards-Version: 4.6.0 (routine-update)
 
   [ Steffen Moeller ]
   * Fix watchfile to detect new versions on github (routine-update)
 
- -- Andreas Tille <tille at debian.org>  Thu, 14 Jan 2021 21:58:17 +0100
+  TODO: Needs tensorflow
+
+ -- Andreas Tille <tille at debian.org>  Fri, 10 Sep 2021 08:05:03 +0200
 
 umap-learn (0.4.5+dfsg-2) unstable; urgency=medium
 


=====================================
debian/control
=====================================
@@ -15,7 +15,7 @@ Build-Depends: debhelper-compat (= 13),
                python3-pynndescent,
                python3-nose <!nocheck>,
                python3-pytest
-Standards-Version: 4.5.1
+Standards-Version: 4.6.0
 Vcs-Browser: https://salsa.debian.org/med-team/umap-learn
 Vcs-Git: https://salsa.debian.org/med-team/umap-learn.git
 Homepage: https://github.com/lmcinnes/umap


=====================================
setup.py
=====================================
@@ -15,7 +15,7 @@ def readme():
 
 configuration = {
     "name": "umap-learn",
-    "version": "0.5.0",
+    "version": "0.5.1",
     "description": "Uniform Manifold Approximation and Projection",
     "long_description": readme(),
     "long_description_content_type": "text/x-rst",


=====================================
umap/__init__.py
=====================================
@@ -6,7 +6,27 @@ try:
         simplefilter("ignore")
         from .parametric_umap import ParametricUMAP
 except ImportError:
-    warn("Tensorflow not installed; ParametricUMAP will be unavailable")
+    warn(
+        "Tensorflow not installed; ParametricUMAP will be unavailable",
+         category=ImportWarning
+    )
+    # Add a dummy class to raise an error
+    class ParametricUMAP (object):
+
+        def __init__(self, **kwds):
+            warn(
+                """The umap.parametric_umap package requires Tensorflow > 2.0 to be installed.
+            You can install Tensorflow at https://www.tensorflow.org/install
+
+            or you can install the CPU version of Tensorflow using 
+
+            pip install umap-learn[parametric_umap]
+
+            """
+            )
+            raise ImportError(
+                "umap.parametric_umap requires Tensorflow >= 2.0") from None
+
 from .aligned_umap import AlignedUMAP
 
 # Workaround: https://github.com/numba/numba/issues/3341


=====================================
umap/layouts.py
=====================================
@@ -33,7 +33,7 @@ def clip(val):
     locals={
         "result": numba.types.float32,
         "diff": numba.types.float32,
-        "dim": numba.types.int32,
+        "dim": numba.types.intp,
     },
 )
 def rdist(x, y):


=====================================
umap/plot.py
=====================================
@@ -42,6 +42,7 @@ from matplotlib.patches import Patch
 from umap.utils import submatrix
 
 from bokeh.plotting import show as show_interactive
+from bokeh.plotting import output_file, output_notebook
 from bokeh.layouts import column
 from bokeh.models import CustomJS, TextInput
 from matplotlib.pyplot import show as show_static
@@ -1385,7 +1386,7 @@ def interactive(
             tooltip_dict = {}
             for col_name in hover_data:
                 data[col_name] = hover_data[col_name]
-                tooltip_dict[col_name] = "@" + col_name
+                tooltip_dict[col_name] = "@{" + col_name + "}"
             tooltips = list(tooltip_dict.items())
         else:
             tooltips = None


=====================================
umap/sparse.py
=====================================
@@ -288,15 +288,17 @@ def sparse_canberra(ind1, data1, ind2, data2):
 
 @numba.njit()
 def sparse_bray_curtis(ind1, data1, ind2, data2):  # pragma: no cover
-    abs_data1 = np.abs(data1)
-    abs_data2 = np.abs(data2)
-    denom_inds, denom_data = sparse_sum(ind1, abs_data1, ind2, abs_data2)
+    denom_inds, denom_data = sparse_sum(ind1, data1, ind2, data2)
+    denom_data = np.abs(denom_data)
 
     if denom_data.shape[0] == 0:
         return 0.0
 
     denominator = np.sum(denom_data)
 
+    if denominator == 0:
+        return 0.0
+
     numer_inds, numer_data = sparse_diff(ind1, data1, ind2, data2)
     numer_data = np.abs(numer_data)
 
@@ -589,7 +591,7 @@ sparse_named_distances = {
     # Other distances
     "canberra": sparse_canberra,
     "ll_dirichlet": sparse_ll_dirichlet,
-    # 'braycurtis': sparse_bray_curtis,
+    'braycurtis': sparse_bray_curtis,
     # Binary distances
     "hamming": sparse_hamming,
     "jaccard": sparse_jaccard,


=====================================
umap/spectral.py
=====================================
@@ -207,7 +207,7 @@ def multi_component_layout(
         distances = pairwise_distances([meta_embedding[label]], meta_embedding)
         data_range = distances[distances > 0.0].min() / 2.0
 
-        if component_graph.shape[0] < 2 * dim:
+        if component_graph.shape[0] < 2 * dim or component_graph.shape[0] <= dim + 1:
             result[component_labels == label] = (
                 random_state.uniform(
                     low=-data_range,


=====================================
umap/tests/test_umap_metrics.py
=====================================
@@ -270,6 +270,9 @@ def test_sparse_correlation(sparse_spatial_data):
     sparse_spatial_check("correlation", sparse_spatial_data)
 
 
+def test_sparse_braycurtis(sparse_spatial_data):
+    sparse_spatial_check("braycurtis", sparse_spatial_data)
+
 # ---------------------------
 # Sparse Binary Metric Tests
 # ---------------------------


=====================================
umap/umap_.py
=====================================
@@ -1283,7 +1283,6 @@ def init_graph_transform(graph, embedding):
     new_embedding: array of shape (n_new_samples, dim)
         An initial embedding of the new sample points.
     """
-    print("inside function\n", graph)
     result = np.zeros((graph.shape[0], embedding.shape[1]), dtype=np.float32)
 
     for row_index in range(graph.shape[0]):



View it on GitLab: https://salsa.debian.org/med-team/umap-learn/-/compare/2c8649a01f3fb20da2f5849ff7b80097e1b1458d...b41a9ab0b88ba6944d33f43c9d1c11e5b4526187

-- 
View it on GitLab: https://salsa.debian.org/med-team/umap-learn/-/compare/2c8649a01f3fb20da2f5849ff7b80097e1b1458d...b41a9ab0b88ba6944d33f43c9d1c11e5b4526187
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20210910/b86ef0be/attachment-0001.htm>


More information about the debian-med-commit mailing list