From 3603e3a6bab0642f10369d82178134b8cbaab43b Mon Sep 17 00:00:00 2001 From: yemeen Date: Wed, 1 Oct 2025 13:22:07 -0400 Subject: [PATCH 1/7] Update ECT with example in documentation --- doc_source/{ect_on_graphs.md => ect.md} | 0 src/ect/ect.py | 11 +++++++++++ 2 files changed, 11 insertions(+) rename doc_source/{ect_on_graphs.md => ect.md} (100%) diff --git a/doc_source/ect_on_graphs.md b/doc_source/ect.md similarity index 100% rename from doc_source/ect_on_graphs.md rename to doc_source/ect.md diff --git a/src/ect/ect.py b/src/ect/ect.py index 04b1824..77c388f 100644 --- a/src/ect/ect.py +++ b/src/ect/ect.py @@ -23,6 +23,17 @@ class ECT: The directions to consider for projection. bound_radius (float): Either ``None``, or a positive radius of the bounding circle. + + Example: + >>> from ect import ECT, EmbeddedGraph + >>> from ect import EmbeddedGraph + >>> graph = EmbeddedGraph() + >>> graph.add_node(0, [0, 0]) + >>> graph.add_node(1, [1, 0]) + >>> graph.add_edge(0, 1) + >>> ect = ECT(num_dirs=10, num_thresh=10) + >>> result = ect.calculate(graph) + >>> result.plot() """ def __init__( From 78b3c0037c59d647f7a1d6a92504de5cd01a58dc Mon Sep 17 00:00:00 2001 From: yemeen Date: Wed, 1 Oct 2025 13:23:33 -0400 Subject: [PATCH 2/7] Simplify header in ECT documentation --- doc_source/ect.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc_source/ect.md b/doc_source/ect.md index f717327..0a05124 100644 --- a/doc_source/ect.md +++ b/doc_source/ect.md @@ -1,4 +1,4 @@ -# ECT on Graphs +# ECT ```{eval-rst} .. automodule:: ect.ect From 222f6774955a508d3e465a4522745cb2e5ba62dd Mon Sep 17 00:00:00 2001 From: yemeen Date: Wed, 1 Oct 2025 15:09:17 -0400 Subject: [PATCH 3/7] Add ECTResult class to modules.rst --- doc_source/ECTResult.md | 9 +++++++++ doc_source/modules.rst | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 doc_source/ECTResult.md diff --git a/doc_source/ECTResult.md b/doc_source/ECTResult.md new file mode 100644 index 0000000..53846f1 --- /dev/null +++ b/doc_source/ECTResult.md @@ -0,0 +1,9 @@ +# ECTResult + +`ECTResult` class provides a fast way to calculate and plot items + + +```{eval-rst} +.. automodule:: ect.results + :members: +``` \ No newline at end of file diff --git a/doc_source/modules.rst b/doc_source/modules.rst index 9dbfbfa..e967bbe 100644 --- a/doc_source/modules.rst +++ b/doc_source/modules.rst @@ -7,5 +7,6 @@ Table of Contents Embedded Complex Validation System - ECT on graphs + ECT + ECTResult Directions \ No newline at end of file From 3f27dcc93d09b3d06a9d1738afa93038b9c30e57 Mon Sep 17 00:00:00 2001 From: yemeen Date: Wed, 1 Oct 2025 15:10:46 -0400 Subject: [PATCH 4/7] Update ECTResult class to manipulate ECT matrices efficiently --- doc_source/ECTResult.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc_source/ECTResult.md b/doc_source/ECTResult.md index 53846f1..f8179ff 100644 --- a/doc_source/ECTResult.md +++ b/doc_source/ECTResult.md @@ -1,6 +1,6 @@ # ECTResult -`ECTResult` class provides a fast way to calculate and plot items +`ECTResult` class provides a fast way to manipulate ECT matrices while also maintaining properties of being a numpy array. ```{eval-rst} From c0749c0bc7c81f5406f25de47bc82e7f5d3e835c Mon Sep 17 00:00:00 2001 From: yemeen Date: Thu, 2 Oct 2025 15:21:31 -0400 Subject: [PATCH 5/7] remove todos --- doc_source/contributing.rst | 9 +-------- doc_source/installation.rst | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/doc_source/contributing.rst b/doc_source/contributing.rst index 47a593f..ceae78c 100644 --- a/doc_source/contributing.rst +++ b/doc_source/contributing.rst @@ -33,7 +33,7 @@ The `ect` package uses the Sphinx documentation system for generating documentat - First, include docstrings in the code which will be autogenerated into the documentation. When in doubt, write too much. - Second, write documentation in the `doc_source` directory using the reStructuredText format. This package also supports writing files in markdown, although there are some issues when dealing with autogenerated content so it's a bit of a mix at the moment. Note that when the documentation is generated, everything in the `docs` folder is deleted and overwritten, so do not do your work in there, it will be lost! -Assuming everything (TODO: Add install list) is set up correctly, you can generate the documentation by running the following command from the top level folder:: +Assuming everything is set up correctly (see the installation instructions in the main documentation), you can generate the documentation by running the following command from the top level folder:: make html @@ -93,10 +93,3 @@ If you would like to fix an issue and you are a contributor to the project, plea If you are not a contributor, you will need to fork the code and create a pull request from your fork. Note that all pull requests need to be approved by Liz Munch before they can be merged. - -Conclusion ----------- - -- Acknowledgements -- Future development plans -- Contact information and support \ No newline at end of file diff --git a/doc_source/installation.rst b/doc_source/installation.rst index 57c42cf..099bedc 100644 --- a/doc_source/installation.rst +++ b/doc_source/installation.rst @@ -6,7 +6,7 @@ Prerequisites Before installing `ect`, make sure you have the following prerequisites: -- Python (version 3.7 or higher) +- Python (version 3.10 or higher) - Pip (Python package installer) Installing `ect` From 83bd9d0bc5623bb487eed77f6a2d82d33a4dd2f0 Mon Sep 17 00:00:00 2001 From: yemeen Date: Thu, 2 Oct 2025 15:21:49 -0400 Subject: [PATCH 6/7] update tut link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a896676..2f346e7 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ For more information on the ECT, see: ### Documentation and tutorials - The documentation is available at: [munchlab.github.io/ect](https://munchlab.github.io/ect/) -- A tutorial jupyter notebook can be found [here](https://munchlab.github.io/ect/notebooks/Tutorial-ECT_for_embedded_graphs.html) +- A tutorial jupyter notebook can be found [here](https://munchlab.github.io/ect/notebooks/Tutorial-EmbeddedComplex.html) ### Dependencies From 28407752847d93338729a3c0b3d5282337e499a0 Mon Sep 17 00:00:00 2001 From: yemeen Date: Thu, 2 Oct 2025 15:32:25 -0400 Subject: [PATCH 7/7] clean up ect documentation --- src/ect/ect.py | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/ect/ect.py b/src/ect/ect.py index 77c388f..6b7a146 100644 --- a/src/ect/ect.py +++ b/src/ect/ect.py @@ -10,29 +10,32 @@ class ECT: """ - A class to calculate the Euler Characteristic Transform (ECT) from an input :any:`EmbeddedComplex`. + A class to calculate the Euler Characteristic Transform (ECT) from an input :any:`EmbeddedComplex`, + using a set of directions to project the complex onto and thresholds to filter the projections. - The result is a matrix where entry ``M[i,j]`` is :math:`\chi(K_{a_i})` for the direction :math:`\omega_j` where :math:`a_i` is the ith entry in ``self.thresholds``, and :math:`\omega_j` is the ith entry in ``self.thetas``. + The result is a matrix where entry ``M[i,j]`` is :math:`\chi(K_{a_i})` for the direction :math:`\omega_j` + where :math:`a_i` is the ith entry in ``self.thresholds``, and :math:`\omega_j` is the jth entry in ``self.directions``. Attributes - num_dirs (int): - The number of directions to consider in the matrix. - num_thresh (int): - The number of thresholds to consider in the matrix. - directions (Directions): - The directions to consider for projection. - bound_radius (float): - Either ``None``, or a positive radius of the bounding circle. + ---------- + num_dirs : int + The number of directions to consider in the matrix. + num_thresh : int + The number of thresholds to consider in the matrix. + directions : Directions + The directions to consider for projection. + bound_radius : float + Either ``None``, or a positive radius of the bounding circle. Example: - >>> from ect import ECT, EmbeddedGraph + >>> from ect import ECT, EmbeddedComplex >>> from ect import EmbeddedGraph - >>> graph = EmbeddedGraph() - >>> graph.add_node(0, [0, 0]) - >>> graph.add_node(1, [1, 0]) - >>> graph.add_edge(0, 1) - >>> ect = ECT(num_dirs=10, num_thresh=10) - >>> result = ect.calculate(graph) + >>> complex = EmbeddedComplex() + >>> complex.add_node(0, [0, 0]) + >>> complex.add_node(1, [1, 0]) + >>> complex.add_edge(0, 1) + >>> ect = ECT(num_dirs=10, num_thresh=10) # chooses 10 uniform directions and 10 thresholds + >>> result = ect.calculate(complex) >>> result.plot() """