diff --git a/StructuralGT/pytest/__pycache__/conftest.cpython-310-pytest-7.2.1.pyc b/StructuralGT/pytest/__pycache__/conftest.cpython-310-pytest-7.2.1.pyc new file mode 100644 index 00000000..22c9b2b7 Binary files /dev/null and b/StructuralGT/pytest/__pycache__/conftest.cpython-310-pytest-7.2.1.pyc differ diff --git a/StructuralGT/pytest/__pycache__/conftest.cpython-312-pytest-8.3.3.pyc b/StructuralGT/pytest/__pycache__/conftest.cpython-312-pytest-8.3.3.pyc new file mode 100644 index 00000000..fcf73f85 Binary files /dev/null and b/StructuralGT/pytest/__pycache__/conftest.cpython-312-pytest-8.3.3.pyc differ diff --git a/StructuralGT/pytest/__pycache__/network_factory.cpython-310.pyc b/StructuralGT/pytest/__pycache__/network_factory.cpython-310.pyc index a57d30d2..1370c8d6 100644 Binary files a/StructuralGT/pytest/__pycache__/network_factory.cpython-310.pyc and b/StructuralGT/pytest/__pycache__/network_factory.cpython-310.pyc differ diff --git a/StructuralGT/pytest/__pycache__/network_factory.cpython-312.pyc b/StructuralGT/pytest/__pycache__/network_factory.cpython-312.pyc new file mode 100644 index 00000000..cb953e00 Binary files /dev/null and b/StructuralGT/pytest/__pycache__/network_factory.cpython-312.pyc differ diff --git a/StructuralGT/pytest/__pycache__/options.cpython-310.pyc b/StructuralGT/pytest/__pycache__/options.cpython-310.pyc new file mode 100644 index 00000000..d29013cd Binary files /dev/null and b/StructuralGT/pytest/__pycache__/options.cpython-310.pyc differ diff --git a/StructuralGT/pytest/__pycache__/options.cpython-312.pyc b/StructuralGT/pytest/__pycache__/options.cpython-312.pyc new file mode 100644 index 00000000..5f6eed60 Binary files /dev/null and b/StructuralGT/pytest/__pycache__/options.cpython-312.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_AverageNodalConnectivity.cpython-310-pytest-7.2.1.pyc b/StructuralGT/pytest/__pycache__/test_AverageNodalConnectivity.cpython-310-pytest-7.2.1.pyc new file mode 100644 index 00000000..e4ce50c6 Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_AverageNodalConnectivity.cpython-310-pytest-7.2.1.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_AverageNodalConnectivity.cpython-312-pytest-8.1.1.pyc b/StructuralGT/pytest/__pycache__/test_AverageNodalConnectivity.cpython-312-pytest-8.1.1.pyc new file mode 100644 index 00000000..328f45b4 Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_AverageNodalConnectivity.cpython-312-pytest-8.1.1.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_AverageNodalConnectivity.cpython-312-pytest-8.3.3.pyc b/StructuralGT/pytest/__pycache__/test_AverageNodalConnectivity.cpython-312-pytest-8.3.3.pyc new file mode 100644 index 00000000..1402a795 Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_AverageNodalConnectivity.cpython-312-pytest-8.3.3.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_Constructors.cpython-310-pytest-7.2.1.pyc b/StructuralGT/pytest/__pycache__/test_Constructors.cpython-310-pytest-7.2.1.pyc new file mode 100644 index 00000000..eb9e9c7d Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_Constructors.cpython-310-pytest-7.2.1.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_Constructors.cpython-312-pytest-8.1.1.pyc b/StructuralGT/pytest/__pycache__/test_Constructors.cpython-312-pytest-8.1.1.pyc new file mode 100644 index 00000000..ea0edc64 Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_Constructors.cpython-312-pytest-8.1.1.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_Electronic.cpython-310-pytest-7.2.1.pyc b/StructuralGT/pytest/__pycache__/test_Electronic.cpython-310-pytest-7.2.1.pyc new file mode 100644 index 00000000..c2adb665 Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_Electronic.cpython-310-pytest-7.2.1.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_Electronic.cpython-312-pytest-8.1.1.pyc b/StructuralGT/pytest/__pycache__/test_Electronic.cpython-312-pytest-8.1.1.pyc new file mode 100644 index 00000000..fa05071e Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_Electronic.cpython-312-pytest-8.1.1.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_Electronic.cpython-312-pytest-8.3.3.pyc b/StructuralGT/pytest/__pycache__/test_Electronic.cpython-312-pytest-8.3.3.pyc new file mode 100644 index 00000000..081deaa6 Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_Electronic.cpython-312-pytest-8.3.3.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_Geometric.cpython-310-pytest-7.2.1.pyc b/StructuralGT/pytest/__pycache__/test_Geometric.cpython-310-pytest-7.2.1.pyc new file mode 100644 index 00000000..c7efae15 Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_Geometric.cpython-310-pytest-7.2.1.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_Geometric.cpython-312-pytest-8.1.1.pyc b/StructuralGT/pytest/__pycache__/test_Geometric.cpython-312-pytest-8.1.1.pyc new file mode 100644 index 00000000..8fdc2b44 Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_Geometric.cpython-312-pytest-8.1.1.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_Geometric.cpython-312-pytest-8.3.3.pyc b/StructuralGT/pytest/__pycache__/test_Geometric.cpython-312-pytest-8.3.3.pyc new file mode 100644 index 00000000..70f3ca08 Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_Geometric.cpython-312-pytest-8.3.3.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_Networks.cpython-310-pytest-7.2.1.pyc b/StructuralGT/pytest/__pycache__/test_Networks.cpython-310-pytest-7.2.1.pyc new file mode 100644 index 00000000..b70ef20f Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_Networks.cpython-310-pytest-7.2.1.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_Networks.cpython-312-pytest-8.3.3.pyc b/StructuralGT/pytest/__pycache__/test_Networks.cpython-312-pytest-8.3.3.pyc new file mode 100644 index 00000000..5ba32345 Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_Networks.cpython-312-pytest-8.3.3.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_Structural.cpython-310-pytest-7.2.1.pyc b/StructuralGT/pytest/__pycache__/test_Structural.cpython-310-pytest-7.2.1.pyc new file mode 100644 index 00000000..b24e2bec Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_Structural.cpython-310-pytest-7.2.1.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_Structural.cpython-312-pytest-8.1.1.pyc b/StructuralGT/pytest/__pycache__/test_Structural.cpython-312-pytest-8.1.1.pyc new file mode 100644 index 00000000..33af008b Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_Structural.cpython-312-pytest-8.1.1.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_Structural.cpython-312-pytest-8.3.3.pyc b/StructuralGT/pytest/__pycache__/test_Structural.cpython-312-pytest-8.3.3.pyc new file mode 100644 index 00000000..3ef0682a Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_Structural.cpython-312-pytest-8.3.3.pyc differ diff --git a/StructuralGT/pytest/__pycache__/test_const.cpython-312-pytest-8.3.3.pyc b/StructuralGT/pytest/__pycache__/test_const.cpython-312-pytest-8.3.3.pyc new file mode 100644 index 00000000..50e442f3 Binary files /dev/null and b/StructuralGT/pytest/__pycache__/test_const.cpython-312-pytest-8.3.3.pyc differ diff --git a/StructuralGT/pytest/conftest.py b/StructuralGT/pytest/conftest.py index cce80c80..20fa2a7c 100644 --- a/StructuralGT/pytest/conftest.py +++ b/StructuralGT/pytest/conftest.py @@ -1,4 +1,4 @@ -from StructuralGT import networks +from StructuralGT.networks import Network import numpy as np import matplotlib.pyplot as plt import pytest @@ -20,7 +20,7 @@ @pytest.fixture(scope="session") def fibrous(weight_type=None): - ANF = networks.Network(_path + '/pytest/data/ANF', prefix='slice', dim=3) + ANF = Network('StructuralGT/pytest/data/ANF', prefix='slice', dim=3) ANF.binarize(options=anf_options) ANF.img_to_skel(crop=[200,300,200,300, 1, 3]) ANF.set_graph(weight_type=weight_type) @@ -29,7 +29,7 @@ def fibrous(weight_type=None): @pytest.fixture(scope="session") def conductive(): - AgNWN = networks.Network(_path + '/pytest/data/AgNWN', prefix='slice') + AgNWN = Network('StructuralGT/pytest/data/AgNWN', prefix='slice') AgNWN.binarize(options=agnwn_options) AgNWN.img_to_skel(crop=[149, 868, 408, 800]) AgNWN.set_graph(weight_type=['FixedWidthConductance'], R_j=10, rho_dim=2) @@ -85,10 +85,10 @@ def main(aligned=False, num_sticks=210, stick_length=300.0): @pytest.fixture(scope="session") def random_stick(): fig = main(aligned=False) - img_path = _path + '/pytest/data/Random' + img_path = 'StructuralGT/pytest/data/Random' fig.savefig(img_path + '/slice0000.png',bbox_inches='tight', dpi=300) - RS = networks.Network(img_path, prefix='slice') + RS = Network(img_path, prefix='slice') RS.binarize(options=stick_options) RS.img_to_skel() RS.set_graph(sub=False) @@ -98,10 +98,10 @@ def random_stick(): @pytest.fixture(scope="session") def aligned_stick(): fig = main(aligned=True) - img_path = _path + '/pytest/data/Aligned' + img_path = 'StructuralGT/pytest/data/Aligned' fig.savefig(img_path + '/slice0000.png',bbox_inches='tight', dpi=300) - RS = networks.Network(img_path, prefix='slice') + RS = Network(img_path, prefix='slice') RS.binarize(options=stick_options) RS.img_to_skel() RS.set_graph(sub=False) diff --git a/StructuralGT/pytest/data/.DS_Store b/StructuralGT/pytest/data/.DS_Store new file mode 100644 index 00000000..1809841e Binary files /dev/null and b/StructuralGT/pytest/data/.DS_Store differ diff --git a/StructuralGT/pytest/data/ANF/Binarized/network.gsd b/StructuralGT/pytest/data/ANF/Binarized/network.gsd new file mode 100644 index 00000000..878cd42e Binary files /dev/null and b/StructuralGT/pytest/data/ANF/Binarized/network.gsd differ diff --git a/StructuralGT/pytest/data/ANF/Binarized/network.json b/StructuralGT/pytest/data/ANF/Binarized/network.json new file mode 100644 index 00000000..1054ad2c --- /dev/null +++ b/StructuralGT/pytest/data/ANF/Binarized/network.json @@ -0,0 +1 @@ +{"stack_dir": "StructuralGT/pytest/data/ANF/Binarized", "_2d": "True", "dim": "2", "cropper": "(200, 300, 200, 300)"} \ No newline at end of file diff --git a/StructuralGT/pytest/data/ANF/Binarized/skel.gsd b/StructuralGT/pytest/data/ANF/Binarized/skel.gsd index cfa6fa70..ac42e89b 100644 Binary files a/StructuralGT/pytest/data/ANF/Binarized/skel.gsd and b/StructuralGT/pytest/data/ANF/Binarized/skel.gsd differ diff --git a/StructuralGT/pytest/data/ANF/Binarized/slice000.tiff b/StructuralGT/pytest/data/ANF/Binarized/slice000.tiff deleted file mode 100644 index 15867973..00000000 Binary files a/StructuralGT/pytest/data/ANF/Binarized/slice000.tiff and /dev/null differ diff --git a/StructuralGT/pytest/data/ANF/Binarized/slice0000.tiff b/StructuralGT/pytest/data/ANF/Binarized/slice0000.tiff new file mode 100644 index 00000000..db6e26de Binary files /dev/null and b/StructuralGT/pytest/data/ANF/Binarized/slice0000.tiff differ diff --git a/StructuralGT/pytest/data/ANF/Binarized/slice001.tiff b/StructuralGT/pytest/data/ANF/Binarized/slice001.tiff deleted file mode 100644 index 05f5d7b4..00000000 Binary files a/StructuralGT/pytest/data/ANF/Binarized/slice001.tiff and /dev/null differ diff --git a/StructuralGT/pytest/data/ANF/Binarized/slice002.tiff b/StructuralGT/pytest/data/ANF/Binarized/slice002.tiff deleted file mode 100644 index 41981cb0..00000000 Binary files a/StructuralGT/pytest/data/ANF/Binarized/slice002.tiff and /dev/null differ diff --git a/StructuralGT/pytest/data/ANF/Binarized/slice003.tiff b/StructuralGT/pytest/data/ANF/Binarized/slice003.tiff deleted file mode 100644 index 8b834918..00000000 Binary files a/StructuralGT/pytest/data/ANF/Binarized/slice003.tiff and /dev/null differ diff --git a/StructuralGT/pytest/data/ANF/Binarized/slice004.tiff b/StructuralGT/pytest/data/ANF/Binarized/slice004.tiff deleted file mode 100644 index ad6e25fd..00000000 Binary files a/StructuralGT/pytest/data/ANF/Binarized/slice004.tiff and /dev/null differ diff --git a/StructuralGT/pytest/data/ANF/Binarized/slice005.tiff b/StructuralGT/pytest/data/ANF/Binarized/slice005.tiff deleted file mode 100644 index 8cf95756..00000000 Binary files a/StructuralGT/pytest/data/ANF/Binarized/slice005.tiff and /dev/null differ diff --git a/StructuralGT/pytest/data/ANF/Binarized/slice006.tiff b/StructuralGT/pytest/data/ANF/Binarized/slice006.tiff deleted file mode 100644 index b964ce63..00000000 Binary files a/StructuralGT/pytest/data/ANF/Binarized/slice006.tiff and /dev/null differ diff --git a/StructuralGT/pytest/data/ANF/Binarized/slice007.tiff b/StructuralGT/pytest/data/ANF/Binarized/slice007.tiff deleted file mode 100644 index 74eec36e..00000000 Binary files a/StructuralGT/pytest/data/ANF/Binarized/slice007.tiff and /dev/null differ diff --git a/StructuralGT/pytest/data/ANF/Binarized/slice008.tiff b/StructuralGT/pytest/data/ANF/Binarized/slice008.tiff deleted file mode 100644 index af3d4170..00000000 Binary files a/StructuralGT/pytest/data/ANF/Binarized/slice008.tiff and /dev/null differ diff --git a/StructuralGT/pytest/data/AgNWN/.DS_Store b/StructuralGT/pytest/data/AgNWN/.DS_Store index 5008ddfc..218f1c26 100644 Binary files a/StructuralGT/pytest/data/AgNWN/.DS_Store and b/StructuralGT/pytest/data/AgNWN/.DS_Store differ diff --git a/StructuralGT/pytest/data/AgNWN/Binarized/connected_skel.gsd b/StructuralGT/pytest/data/AgNWN/Binarized/connected_skel.gsd index 0ccd6e4c..8064abb5 100644 Binary files a/StructuralGT/pytest/data/AgNWN/Binarized/connected_skel.gsd and b/StructuralGT/pytest/data/AgNWN/Binarized/connected_skel.gsd differ diff --git a/StructuralGT/pytest/data/AgNWN/Binarized/network.gsd b/StructuralGT/pytest/data/AgNWN/Binarized/network.gsd index b34293ee..35bbe453 100644 Binary files a/StructuralGT/pytest/data/AgNWN/Binarized/network.gsd and b/StructuralGT/pytest/data/AgNWN/Binarized/network.gsd differ diff --git a/StructuralGT/pytest/data/AgNWN/Binarized/network.json b/StructuralGT/pytest/data/AgNWN/Binarized/network.json index 309b8378..f2763247 100644 --- a/StructuralGT/pytest/data/AgNWN/Binarized/network.json +++ b/StructuralGT/pytest/data/AgNWN/Binarized/network.json @@ -1 +1 @@ -{"stack_dir": "/Users/alaink/Software/StructuralGT/StructuralGT/pytest/data/AgNWN/Binarized", "_2d": "True", "dim": "2", "cropper": "(408, 800, 149, 868)"} \ No newline at end of file +{"stack_dir": "StructuralGT/pytest/data/AgNWN/Binarized", "_2d": "True", "dim": "2", "cropper": "(408, 800, 149, 868)"} \ No newline at end of file diff --git a/StructuralGT/pytest/data/AgNWN/Binarized/skel.gsd b/StructuralGT/pytest/data/AgNWN/Binarized/skel.gsd index 0f3d7a17..acd88d23 100644 Binary files a/StructuralGT/pytest/data/AgNWN/Binarized/skel.gsd and b/StructuralGT/pytest/data/AgNWN/Binarized/skel.gsd differ diff --git a/StructuralGT/pytest/data/Aligned/Binarized/network.gsd b/StructuralGT/pytest/data/Aligned/Binarized/network.gsd new file mode 100644 index 00000000..175ab4cb Binary files /dev/null and b/StructuralGT/pytest/data/Aligned/Binarized/network.gsd differ diff --git a/StructuralGT/pytest/data/Aligned/Binarized/network.json b/StructuralGT/pytest/data/Aligned/Binarized/network.json new file mode 100644 index 00000000..ea97fb3b --- /dev/null +++ b/StructuralGT/pytest/data/Aligned/Binarized/network.json @@ -0,0 +1 @@ +{"stack_dir": "StructuralGT/pytest/data/Aligned/Binarized", "_2d": "True", "dim": "2", "cropper": "None"} \ No newline at end of file diff --git a/StructuralGT/pytest/data/Aligned/Binarized/skel.gsd b/StructuralGT/pytest/data/Aligned/Binarized/skel.gsd index c666cf0f..fa8c33af 100644 Binary files a/StructuralGT/pytest/data/Aligned/Binarized/skel.gsd and b/StructuralGT/pytest/data/Aligned/Binarized/skel.gsd differ diff --git a/StructuralGT/pytest/data/Aligned/Binarized/slice0000.tiff b/StructuralGT/pytest/data/Aligned/Binarized/slice0000.tiff index d04a2c6a..1feaf854 100644 Binary files a/StructuralGT/pytest/data/Aligned/Binarized/slice0000.tiff and b/StructuralGT/pytest/data/Aligned/Binarized/slice0000.tiff differ diff --git a/StructuralGT/pytest/data/Aligned/slice0000.png b/StructuralGT/pytest/data/Aligned/slice0000.png index 53e1538f..15cb5aa8 100644 Binary files a/StructuralGT/pytest/data/Aligned/slice0000.png and b/StructuralGT/pytest/data/Aligned/slice0000.png differ diff --git a/StructuralGT/pytest/data/Random/Binarized/network.gsd b/StructuralGT/pytest/data/Random/Binarized/network.gsd new file mode 100644 index 00000000..4289310a Binary files /dev/null and b/StructuralGT/pytest/data/Random/Binarized/network.gsd differ diff --git a/StructuralGT/pytest/data/Random/Binarized/network.json b/StructuralGT/pytest/data/Random/Binarized/network.json new file mode 100644 index 00000000..743b9345 --- /dev/null +++ b/StructuralGT/pytest/data/Random/Binarized/network.json @@ -0,0 +1 @@ +{"stack_dir": "StructuralGT/pytest/data/Random/Binarized", "_2d": "True", "dim": "2", "cropper": "None"} \ No newline at end of file diff --git a/StructuralGT/pytest/data/Random/Binarized/skel.gsd b/StructuralGT/pytest/data/Random/Binarized/skel.gsd index 62771320..97e4545b 100644 Binary files a/StructuralGT/pytest/data/Random/Binarized/skel.gsd and b/StructuralGT/pytest/data/Random/Binarized/skel.gsd differ diff --git a/StructuralGT/pytest/data/Random/Binarized/slice0000.tiff b/StructuralGT/pytest/data/Random/Binarized/slice0000.tiff index 9b5a3291..e9574518 100644 Binary files a/StructuralGT/pytest/data/Random/Binarized/slice0000.tiff and b/StructuralGT/pytest/data/Random/Binarized/slice0000.tiff differ diff --git a/StructuralGT/pytest/data/Random/slice0000.png b/StructuralGT/pytest/data/Random/slice0000.png index 62a85de4..1d38a1be 100644 Binary files a/StructuralGT/pytest/data/Random/slice0000.png and b/StructuralGT/pytest/data/Random/slice0000.png differ diff --git a/StructuralGT/pytest/data/Small/Binarized/network.gsd b/StructuralGT/pytest/data/Small/Binarized/network.gsd new file mode 100644 index 00000000..ae3a931c Binary files /dev/null and b/StructuralGT/pytest/data/Small/Binarized/network.gsd differ diff --git a/StructuralGT/pytest/data/Small/Binarized/network.json b/StructuralGT/pytest/data/Small/Binarized/network.json new file mode 100644 index 00000000..de3b37b6 --- /dev/null +++ b/StructuralGT/pytest/data/Small/Binarized/network.json @@ -0,0 +1 @@ +{"stack_dir": "StructuralGT/pytest/data/Small/Binarized", "_2d": "True", "dim": "2", "cropper": "None"} \ No newline at end of file diff --git a/StructuralGT/pytest/data/Small/Binarized/skel.gsd b/StructuralGT/pytest/data/Small/Binarized/skel.gsd index f72286ed..faa6e8e8 100644 Binary files a/StructuralGT/pytest/data/Small/Binarized/skel.gsd and b/StructuralGT/pytest/data/Small/Binarized/skel.gsd differ diff --git a/StructuralGT/pytest/data/Small/Binarized/slice0000.tiff b/StructuralGT/pytest/data/Small/Binarized/slice0000.tiff new file mode 100644 index 00000000..ff76e3e9 Binary files /dev/null and b/StructuralGT/pytest/data/Small/Binarized/slice0000.tiff differ diff --git a/StructuralGT/pytest/graph.json b/StructuralGT/pytest/graph.json new file mode 100644 index 00000000..4c31dae8 --- /dev/null +++ b/StructuralGT/pytest/graph.json @@ -0,0 +1 @@ +{"stack_dir": "/Users/alaink/miniconda3/envs/SGTE-dev/lib/python3.10/site-packages/StructuralGT-0.0.1-py3.10-macosx-11.0-arm64.egg/StructuralGT/pytest/data/Small/Binarized", "depth": "None", "_2d": "True", "dim": "2", "cropper": "None"} \ No newline at end of file diff --git a/StructuralGT/pytest/network.json b/StructuralGT/pytest/network.json new file mode 100644 index 00000000..bce13c41 --- /dev/null +++ b/StructuralGT/pytest/network.json @@ -0,0 +1 @@ +{"stack_dir": "/Users/alaink/miniconda3/envs/SGTE-dev/lib/python3.10/site-packages/StructuralGT-0.0.1-py3.10-macosx-11.0-arm64.egg/StructuralGT/pytest/data/Small/Binarized", "depth": "None", "_2d": "True", "dim": "2", "cropper": "(50, 50)"} \ No newline at end of file diff --git a/StructuralGT/pytest/sbox.py b/StructuralGT/pytest/sbox.py new file mode 100644 index 00000000..52f31f0d --- /dev/null +++ b/StructuralGT/pytest/sbox.py @@ -0,0 +1,11 @@ +import igraph + +G1 = igraph.Graph.K_Regular(10, 2) +G2 = igraph.Graph.K_Regular(10, 2) + +def graph_function(G): + print(G.degree()) + +graph_function(list(G1,G2)) + + diff --git a/StructuralGT/pytest/test_AverageNodalConnectivity.py b/StructuralGT/pytest/test_AverageNodalConnectivity.py index 6a5983da..c799cacd 100644 --- a/StructuralGT/pytest/test_AverageNodalConnectivity.py +++ b/StructuralGT/pytest/test_AverageNodalConnectivity.py @@ -5,7 +5,6 @@ import numpy.testing as npt import numpy as np -"""TODO-FIX class TestAverageNodalConnectivity: def test(self, fibrous): #Obtain a connected graph @@ -29,4 +28,3 @@ def test(self, fibrous): np.mean(np.asarray(vals)), rtol=1e-2, ) -""" diff --git a/StructuralGT/pytest/test_Networks.py b/StructuralGT/pytest/test_Networks.py index dd22436c..9f978461 100644 --- a/StructuralGT/pytest/test_Networks.py +++ b/StructuralGT/pytest/test_Networks.py @@ -1,44 +1,35 @@ from StructuralGT.networks import Network, ParticleNetwork, Graph -import StructuralGT - +from StructuralGT import error import pytest import shutil import os import options -_path = StructuralGT.__path__[0] -Small_path = _path + '/pytest/data/Small/' #2D directory with single image -AgNWN_path = _path + '/pytest/data/AgNWN/' #2D directory with several images -ANF_path = _path + '/pytest/data/ANF/' #3D directory +Small_path = 'StructuralGT/pytest/data/Small/' #2D directory with single image +AgNWN_path = 'StructuralGT/pytest/data/AgNWN/' #2D directory with several images +ANF_path = 'StructuralGT/pytest/data/ANF/' #3D directory class TestNetwork: - - """ - CURRENTLY BROKEN - WILL FIX LATER def test_3d_constructor(self): - with pytest.raises(ValueError): + with pytest.raises(error.ImageDirectoryError): testNetwork = Network(ANF_path, dim=3, prefix='wrong_prefix') - with pytest.raises(ValueError): - testNetwork = Network(ANF_path, dim=3, depth=[283,282]) - testNetwork = Network(ANF_path, dim=3, prefix='slice', depth=[3,287]) - assert len(testNetwork.image_stack)==6 + #assert len(testNetwork.image_stack)==6 testNetwork = Network(ANF_path, dim=3, depth=[281,288]) testNetwork = Network(ANF_path, dim=3, prefix='slice') assert len(testNetwork.image_stack)==12 - return testNetwork - """ + #return testNetwork uncomment if 3D network becomes required as a fixture in other tests @pytest.fixture def test_2d_constructor(self): - with pytest.raises(ImageDirectoryError): + with pytest.raises(error.ImageDirectoryError): testNetwork = Network(AgNWN_path, prefix='wrong_prefix') with pytest.raises(UserWarning): diff --git a/StructuralGT/pytest/test_Structural.py b/StructuralGT/pytest/test_Structural.py index c7411ce3..011dd2c8 100644 --- a/StructuralGT/pytest/test_Structural.py +++ b/StructuralGT/pytest/test_Structural.py @@ -128,46 +128,3 @@ def test_compute(self, conductive): #TODO: Add tests - -""" -class TestWeightedStructural: - @pytest.fixture - def test_compute(self): - #Obtain an unweighted connected graph - testNetwork = conductive(weight_type=['Length']) - testGraph = testNetwork.graph.to_networkx() - - #Instantiate a compute module and run calculation - ComputeModule = Structural(weight_type='Length') - ComputeModule.compute(testNetwork) - - return ComputeModule, testGraph - - def test_diameter(self, test_compute): - ComputeModule, testGraph = test_compute - npt.assert_allclose( - ComputeModule.diameter, - diameter(testGraph, weight='Length'), - atol=1e-2, - ) - - def test_betweenness(self, test_compute): - ComputeModule, testGraph = test_compute - npt.assert_allclose( - ComputeModule.betweenness, - np.fromiter(betweenness_centrality(testGraph, - weight='Length').values(), - dtype=float), - atol=1e-2, - ) - - def test_closenness(self, test_compute): - ComputeModule, testGraph = test_compute - npt.assert_allclose( - ComputeModule.closeness, - np.fromiter(closeness_centrality(testGraph, - distance='Length').values(), - dtype=float), - atol=1e-2, - ) -"""