Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path Complex #238

Merged
merged 43 commits into from
Sep 26, 2023
Merged

Path Complex #238

merged 43 commits into from
Sep 26, 2023

Conversation

quang-truong
Copy link
Contributor

This pull request contains source code to implement the Path Complex based on simple paths, which is inspired from the original Path Complex.

@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +1.70% 🎉

Comparison is base (7f4235a) 87.89% compared to head (ef27662) 89.59%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #238      +/-   ##
==========================================
+ Coverage   87.89%   89.59%   +1.70%     
==========================================
  Files          26       28       +2     
  Lines        2858     3326     +468     
==========================================
+ Hits         2512     2980     +468     
  Misses        346      346              
Files Changed Coverage Δ
toponetx/algorithms/spectrum.py 100.00% <100.00%> (ø)
toponetx/classes/__init__.py 100.00% <100.00%> (ø)
toponetx/classes/path.py 100.00% <100.00%> (ø)
toponetx/classes/path_complex.py 100.00% <100.00%> (ø)
toponetx/classes/reportviews.py 83.93% <100.00%> (+1.70%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

toponetx/classes/path.py Outdated Show resolved Hide resolved
toponetx/classes/path.py Outdated Show resolved Hide resolved
toponetx/classes/path.py Outdated Show resolved Hide resolved
toponetx/classes/path_complex.py Outdated Show resolved Hide resolved
toponetx/classes/path_complex.py Outdated Show resolved Hide resolved
toponetx/classes/path_complex.py Outdated Show resolved Hide resolved
toponetx/classes/path_complex.py Outdated Show resolved Hide resolved
toponetx/classes/path_complex.py Outdated Show resolved Hide resolved
toponetx/classes/reportviews.py Outdated Show resolved Hide resolved
@ffl096 ffl096 added the enhancement New feature or request label Sep 12, 2023
toponetx/classes/path.py Outdated Show resolved Hide resolved
toponetx/classes/path.py Show resolved Hide resolved
toponetx/classes/path.py Show resolved Hide resolved
toponetx/classes/path_complex.py Show resolved Hide resolved
toponetx/classes/path_complex.py Show resolved Hide resolved
toponetx/classes/path_complex.py Outdated Show resolved Hide resolved
toponetx/classes/path_complex.py Show resolved Hide resolved
@mhajij
Copy link
Member

mhajij commented Sep 14, 2023

Please add the following methods :

(1) to_other_complex()

where other_complex is any more general of path complex. e.g colored HG and combinatorial complex.

(2) restrict_to_nodes

(3) restrict to paths

(4) set attrs and get attrs (similar to

def get_edge_attributes(self, name: str) -> dict[tuple, Any]:
)

(5) add hodge_laplacian_spectrum methods in the file :

https://github.com/pyt-team/TopoNetX/blob/main/toponetx/algorithms/spectrum.py

(6) add tutorial on path complex demonstrating the main methods.

@mhajij
Copy link
Member

mhajij commented Sep 14, 2023

@quang-truong Finally for adj/incidence/laplacian matrices please add weight parameter to make the signature consistent across the package #242. Also please do not forget to cite the paper https://arxiv.org/pdf/1207.2834.pdf along your paper in the documentation for PathComplex.

@quang-truong
Copy link
Contributor Author

quang-truong commented Sep 18, 2023

Please add the following methods :

(1) to_other_complex()

where other_complex is any more general of path complex. e.g colored HG and combinatorial complex.

(2) restrict_to_nodes

(3) restrict to paths

(4) set attrs and get attrs (similar to

def get_edge_attributes(self, name: str) -> dict[tuple, Any]:

)
(5) add hodge_laplacian_spectrum methods in the file :

https://github.com/pyt-team/TopoNetX/blob/main/toponetx/algorithms/spectrum.py

(6) add tutorial on path complex demonstrating the main methods.

Regarding (1), the current implementation of CombinatorialComplex prevents me from generalizing PathComplex, because paths take into account order sequence, while CombinatorialComplex converts all inputs to frozenset.

Besides that, all of the above methods are implemented. I am working on (6), which will take a while.

@quang-truong quang-truong marked this pull request as ready for review September 18, 2023 20:03
@mhajij
Copy link
Member

mhajij commented Sep 22, 2023

@ffl096 can you please take a look at this one when you get a chance, give your comments ? Thanks!

@mhajij
Copy link
Member

mhajij commented Sep 22, 2023

@ninamiolane @michaelschaub any high level comments?

toponetx/algorithms/spectrum.py Outdated Show resolved Hide resolved
toponetx/algorithms/spectrum.py Outdated Show resolved Hide resolved
toponetx/algorithms/spectrum.py Outdated Show resolved Hide resolved
toponetx/algorithms/spectrum.py Outdated Show resolved Hide resolved
toponetx/classes/path.py Outdated Show resolved Hide resolved
toponetx/classes/path_complex.py Outdated Show resolved Hide resolved
toponetx/classes/path_complex.py Outdated Show resolved Hide resolved
toponetx/classes/path_complex.py Outdated Show resolved Hide resolved
toponetx/classes/path_complex.py Outdated Show resolved Hide resolved
toponetx/classes/path_complex.py Show resolved Hide resolved
Copy link
Member

@ffl096 ffl096 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some things I didn't notice before, sorry! Other than that, this pull request looks good to me :)

toponetx/algorithms/spectrum.py Outdated Show resolved Hide resolved
toponetx/algorithms/spectrum.py Outdated Show resolved Hide resolved
toponetx/classes/path.py Show resolved Hide resolved
toponetx/classes/path.py Outdated Show resolved Hide resolved
toponetx/classes/path.py Outdated Show resolved Hide resolved
toponetx/classes/path.py Outdated Show resolved Hide resolved
toponetx/classes/path.py Outdated Show resolved Hide resolved
toponetx/classes/path.py Outdated Show resolved Hide resolved
toponetx/classes/reportviews.py Outdated Show resolved Hide resolved
@mhajij
Copy link
Member

mhajij commented Sep 25, 2023

@quang-truong we are aiming to publish the package soon and the publisher requires almost 100% code coverage, can you try to increase the code coverage of path complex to its maximal ? thank you

@quang-truong
Copy link
Contributor Author

@quang-truong we are aiming to publish the package soon and the publisher requires almost 100% code coverage, can you try to increase the code coverage of path complex to its maximal ? thank you

@mhajij I just add more test cases to cover all possible if statements and errors.

Copy link
Collaborator

@ninamiolane ninamiolane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thank you very much for this contribution!

@ninamiolane ninamiolane merged commit a8b6585 into pyt-team:main Sep 26, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants