-
Notifications
You must be signed in to change notification settings - Fork 27
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
stats package #120
stats package #120
Conversation
…wargs when calling from the Hypergraph itself
…only return a single element, while there may be multiple elements that achieve the maximum
…odeStats. Also, add the dist() convenience function
…cher object itself
…cstring uses the function "my_degree". However, the test_user_defined test function also defined a function with name "my_degree". The latter was leaking into the namespace during pytest runs so we decided to change the name of the latter to "user_degree" instead.
…stead of the underlying view
…ng py3.8 so the tests on 3.7 were failing. Also, turned one docstring into a raw string
…the cells in the notebook raises an exception, even if the exception was intentional...
|
@@ -0,0 +1,35 @@ | |||
xgi.stats.EdgeStat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seem to be a few duplicate file names in docs/source/api/stats
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of nodestats
, NodeStat
, and nodestat
are valid names implemented in this PR: the module, the class, and the decorator. All three names are imported into the xgi.stats
package, so sphinx creates all three files.
I think it's fine, at least documentation-wise, though these three names are too similar to each other that they may eventually cause a problem with end-users?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open to suggestions here
…he documentation tree that differed only in the case of some of the characters; this was causing problems for git on windows. So we have changed the decorators nodestat and edgestat to nodestat_func and edgestat_func. Additionally, we also fixed some documentation errors
This PR adds the
stats
package which implementsNodeStat
,EdgeStat
and related functionality. For an overview of all the new features, see the tutorial.The main changes are all within the newly created
xgi/stats/
package. Other classes affected areHypergraph
,NodeView
, andEdgeView
. Additionally,DegreeView
andEdgeSizeView
are deleted.This is a big diff, but it can basically be broken in three: changes to the docs (docstrings and *rst files), new tests (this PR adds 51 new tests collected by pytest), and the actual implementation, which is mostly within
xgi/stats/
,xgi/classes/hypergraph.py
andxgi/classes/reportviews.py
.In terms of documentation, I believe we now have the minimum required to make sense of the new features, but a lot more can be done for sure. To avoid repetition, in some places I just added a direct link to the tutorial.
On a technical note. The way the
xgi/stats/
package is implemented is the following.xgi/stats/__init__.py
contains all the major classes and decorators.xgi/stats/nodestats.py
contains only the functions that actually compute node statistics (like degree clustering, etc). Similarly,xgi/stats/edgestats.py
contains only the functions that compute edge statistics. I don't like having so much code in the__init__.py
module, but it is necessary for the current implementation thatnodestats.py
andedgestats.py
ONLY contain functions that compute the corresponding statistics.