diff options
Diffstat (limited to 'phstuff/diphawrapper.py')
-rw-r--r-- | phstuff/diphawrapper.py | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/phstuff/diphawrapper.py b/phstuff/diphawrapper.py index 4d1742e..1b633b5 100644 --- a/phstuff/diphawrapper.py +++ b/phstuff/diphawrapper.py @@ -29,10 +29,11 @@ def save_weight_matrix(fname, weights): """Write a NumPy weight matrix to a DIPHA full distance matrix file. Corresponds to DIPHA's "distance matrix data". - Attention: DIPHA uses a convention wherein an edge's - filtration value is *half* its weight. This function compensates - by multiplying every weight by 2. Pay attention in case DIPHA's - behavior changes in the future! + Attention: DIPHA currently uses a convention wherein an edge's + filtration value is *half* its weight. Prior to version 0.0.6 of + this package, we would compensate for this by multiplying every + weight by 2. As of version 0.0.6, we no longer do so. Pay + attention in case DIPHA's behavior changes in the future! Parameters: ----------- @@ -50,7 +51,7 @@ def save_weight_matrix(fname, weights): # we compensate by multiplying all entries by 2. Be sure to pay # attention if DIPHA's behavior changes! - factor = 2.0 + factor = 1.0 m = weights.shape[0] if weights.shape[0] != weights.shape[1]: @@ -73,10 +74,11 @@ def save_masked_weight_matrix(fname, weights): matrix file, keeping edges only for unmasked entries. Corresponds to DIPHA's "sparse distance matrix data". - Attention: DIPHA uses a convention wherein an edge's filtration - value is *half* its weight. This function compensates by - multiplying every weight by 2. Pay attention in case DIPHA's - behavior changes in the future! + Attention: DIPHA currently uses a convention wherein an edge's + filtration value is *half* its weight. Prior to version 0.0.6 of + this package, we would compensate for this by multiplying every + weight by 2. As of version 0.0.6, we no longer do so. Pay + attention in case DIPHA's behavior changes in the future! Parameters: ----------- @@ -89,7 +91,7 @@ def save_masked_weight_matrix(fname, weights): """ - factor = 2.0 + factor = 1.0 n = weights.shape[1] @@ -114,10 +116,11 @@ def save_edge_list(fname, edge_list): list to a DIPHA sparse distance file. Corresponds to DIPHA's "sparse distance matrix data". - Attention: DIPHA uses a convention wherein an edge's filtration - value is *half* its weight. This function compensates by - multiplying every weight by 2. Pay attention in case DIPHA's - behavior changes in the future! + Attention: DIPHA currently uses a convention wherein an edge's + filtration value is *half* its weight. Prior to version 0.0.6 of + this package, we would compensate for this by multiplying every + weight by 2. As of version 0.0.6, we no longer do so. Pay + attention in case DIPHA's behavior changes in the future! Parameters: ----------- @@ -139,7 +142,7 @@ def save_edge_list(fname, edge_list): """ - factor = 2.0 + factor = 1.0 n = len(edge_list) |