Skip to content

Commit

Permalink
Merge pull request #33 from nicoloval/bug/fixing_dependencies
Browse files Browse the repository at this point in the history
Bug/fixing dependencies
  • Loading branch information
EmilianoMarchese authored Feb 26, 2021
2 parents bae8522 + efabfc2 commit 32c159a
Show file tree
Hide file tree
Showing 7 changed files with 164 additions and 84 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ Simple Example
As an example we solve the UBCM for zachary karate club network.

```
import numpy as np
import networkx as nx
from NEMtropy import UndirectedGraph
Expand Down
Empty file added requirements.txt
Empty file.
20 changes: 11 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from setuptools import setup, find_packages
from setuptools import setup


with open('README.md', "r", encoding="utf-8") as fh:
Expand All @@ -8,16 +8,17 @@
setup(
name="NEMtropy",
author="Nicolo' Vallarano, Emiliano Marchese, Matteo Bruno",
author_email='nicolo.vallarano@imtlucca.it, emiliano.marchese@imtlucca.it, matteo.bruno@imtlucca.it',
author_email='nicolo.vallarano@imtlucca.it, emiliano.marchese@imtlucca.it,'
' matteo.bruno@imtlucca.it',
packages=["NEMtropy"],
package_dir={'': 'src'},
version="2.0.1",
description="NEMtropy is a Maximum-Entropy toolbox for networks, it"
" provides the user with a state of the art solver for a range variety"
" of Maximum Entropy Networks models derived from the ERGM family."
" This module allows you to solve the desired model and generate a"
" number of randomized graphs from the original one:"
" the so-called graphs ensemble.",
" provides the user with a state of the art solver for a"
" range variety of Maximum Entropy Networks models derived"
" from the ERGM family. This module allows you to solve the"
" desired model and generate a number of randomized graphs"
" from the original one: the so-called graphs ensemble.",
long_description=long_description,
long_description_content_type="text/markdown",
license="GNU General Public License v3",
Expand All @@ -26,7 +27,8 @@
keywords=['Network reconstruction', 'Networks Null Models',
'Maximum Entrophy Methods'],
classifiers=[
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
'License :: OSI Approved :: GNU Library or Lesser General'
' Public License (LGPL)',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
Expand All @@ -38,7 +40,7 @@
"scipy>=1.4",
"networkx>=2.4",
"powerlaw>=1.4"
"tqdm>=4.56.2"
"tqdm>=4.5"
],
extras_require={
"dev": [
Expand Down
1 change: 1 addition & 0 deletions src/NEMtropy.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
numpy>=1.17
scipy>=1.4
networkx>=2.4
powerlaw>=1.4tqdm>=4.5

[dev]
pytest>=6.0.1
Expand Down
23 changes: 12 additions & 11 deletions src/NEMtropy/models_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1991,10 +1991,10 @@ def linsearch_fun_DCM(xx, args):
Alpha determines how much to move on the descending direction
found by the algorithm.
:param X: Tuple of arguments to find alpha:
:param xx: Tuple of arguments to find alpha:
solution, solution step, tuning parameter beta,
initial alpha, function f
:type X: (numpy.ndarray, numpy.ndarray, float, float, func)
:type xx: (numpy.ndarray, numpy.ndarray, float, float, func)
:param args: Tuple, step function and arguments.
:type args: (func, tuple)
:return: Working alpha.
Expand Down Expand Up @@ -2073,6 +2073,7 @@ def linsearch_fun_DCM_fixed(xx):
# DECM functions
# --------------


@jit(nopython=True)
def iterative_decm(x, args):
"""Returns the next iterative step for the DECM Model.
Expand Down Expand Up @@ -2567,10 +2568,10 @@ def linsearch_fun_DECM(xx, args):
Alpha determines how much to move on the descending direction
found by the algorithm.
:param X: Tuple of arguments to find alpha:
:param xx: Tuple of arguments to find alpha:
solution, solution step, tuning parameter beta,
initial alpha, function f
:type X: (numpy.ndarray, numpy.ndarray, float, float, func)
:type xx: (numpy.ndarray, numpy.ndarray, float, float, func)
:param args: Tuple, step function and arguments.
:type args: (func, tuple)
:return: Working alpha.
Expand Down Expand Up @@ -2627,10 +2628,10 @@ def linsearch_fun_DECM_fixed(xx):
Alpha determines how much to move on the descending direction
found by the algorithm.
:param X: Tuple of arguments to find alpha:
:param xx: Tuple of arguments to find alpha:
solution, solution step, tuning parameter beta,
initial alpha, step.
:type X: (numpy.ndarray, numpy.ndarray, float, float, int)
:type xx: (numpy.ndarray, numpy.ndarray, float, float, int)
:return: Working alpha.
:rtype: float
"""
Expand Down Expand Up @@ -3147,8 +3148,8 @@ def expected_in_degree_dcm_exp(theta):
"""Expected in-degrees after the DBCM. It is based on DBCM
exponential version.
:param sol: DBCM solution.
:type sol: numpy.ndarray
:param theta: DBCM solution.
:type theta: numpy.ndarray
:return: In-degrees DBCM expectation.
:rtype: numpy.ndarray
"""
Expand Down Expand Up @@ -3381,8 +3382,8 @@ def loglikelihood_decm_exp(x, args):
"""Returns DECM [*]_ loglikelihood function evaluated in theta.
It is based on the exponential version of the DECM.
:param theta: Evaluating point *theta*.
:type theta: numpy.ndarray
:param x: Evaluating point *theta*.
:type x: numpy.ndarray
:param args: Arguments to define the loglikelihood function.
Out and in degrees sequences, and out and in strengths sequences
:type args: (numpy.ndarray, numpy.ndarray, numpy.ndarray,
Expand Down Expand Up @@ -3653,7 +3654,7 @@ def expected_decm_exp(theta):
It is based on DBCM exponential version.
:param theta: DBCM solution.
:type x: numpy.ndarray
:type theta: numpy.ndarray
:return: DBCM expected parameters sequence.
:rtype: numpy.ndarray
"""
Expand Down
Loading

0 comments on commit 32c159a

Please sign in to comment.