napistu 0.3.7__py3-none-any.whl → 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- napistu/__main__.py +8 -4
- napistu/constants.py +28 -35
- napistu/ingestion/napistu_edgelist.py +4 -4
- napistu/matching/interactions.py +41 -39
- napistu/modify/gaps.py +2 -1
- napistu/network/constants.py +61 -45
- napistu/network/data_handling.py +1 -1
- napistu/network/neighborhoods.py +3 -3
- napistu/network/net_create.py +440 -616
- napistu/network/net_create_utils.py +734 -0
- napistu/network/net_propagation.py +1 -1
- napistu/network/{napistu_graph_core.py → ng_core.py} +57 -15
- napistu/network/ng_utils.py +28 -21
- napistu/network/paths.py +4 -4
- napistu/network/precompute.py +35 -74
- napistu/sbml_dfs_utils.py +46 -0
- napistu/utils.py +80 -5
- {napistu-0.3.7.dist-info → napistu-0.4.0.dist-info}/METADATA +2 -2
- {napistu-0.3.7.dist-info → napistu-0.4.0.dist-info}/RECORD +34 -31
- tests/conftest.py +102 -1
- tests/test_network_data_handling.py +5 -2
- tests/test_network_net_create.py +92 -201
- tests/test_network_net_create_utils.py +538 -0
- tests/test_network_ng_core.py +19 -0
- tests/test_network_ng_utils.py +1 -1
- tests/test_network_precompute.py +4 -3
- tests/test_rpy2_callr.py +0 -1
- tests/test_rpy2_init.py +0 -1
- tests/test_sbml_dfs_utils.py +45 -0
- tests/test_utils.py +26 -2
- {napistu-0.3.7.dist-info → napistu-0.4.0.dist-info}/WHEEL +0 -0
- {napistu-0.3.7.dist-info → napistu-0.4.0.dist-info}/entry_points.txt +0 -0
- {napistu-0.3.7.dist-info → napistu-0.4.0.dist-info}/licenses/LICENSE +0 -0
- {napistu-0.3.7.dist-info → napistu-0.4.0.dist-info}/top_level.txt +0 -0
tests/test_utils.py
CHANGED
@@ -2,9 +2,10 @@ from __future__ import annotations
|
|
2
2
|
|
3
3
|
import gzip
|
4
4
|
import os
|
5
|
+
import tempfile
|
5
6
|
from datetime import datetime
|
6
|
-
from
|
7
|
-
from unittest.mock import patch
|
7
|
+
from pathlib import Path
|
8
|
+
from unittest.mock import Mock, patch
|
8
9
|
|
9
10
|
import numpy as np
|
10
11
|
import pandas as pd
|
@@ -705,3 +706,26 @@ def test_update_pathological_names():
|
|
705
706
|
s3 = pd.Series(["foo", "bar", "baz"])
|
706
707
|
out3 = utils.update_pathological_names(s3, "prefix_")
|
707
708
|
assert list(out3) == ["foo", "bar", "baz"]
|
709
|
+
|
710
|
+
|
711
|
+
def test_parquet_save_load():
|
712
|
+
"""Test that write_parquet and read_parquet work correctly."""
|
713
|
+
# Create test DataFrame
|
714
|
+
original_df = pd.DataFrame(
|
715
|
+
{
|
716
|
+
"sc_id_origin": ["A", "B", "C"],
|
717
|
+
"sc_id_dest": ["B", "C", "A"],
|
718
|
+
"path_length": [1, 2, 3],
|
719
|
+
"path_weights": [0.1, 0.5, 0.8],
|
720
|
+
"has_connection": [True, False, True],
|
721
|
+
}
|
722
|
+
)
|
723
|
+
|
724
|
+
# Write and read using temporary file
|
725
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
726
|
+
file_path = Path(temp_dir) / "test.parquet"
|
727
|
+
utils.save_parquet(original_df, file_path)
|
728
|
+
result_df = utils.load_parquet(file_path)
|
729
|
+
|
730
|
+
# Verify they're identical
|
731
|
+
pd.testing.assert_frame_equal(original_df, result_df)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|