Skip to content

Commit

Permalink
⬆️ minimum python version set to 3.6 (minor bug fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRossetti committed Oct 5, 2020
1 parent c7d6934 commit 73b4ab7
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
@@ -1,7 +1,8 @@
language: python
python:
- "3.5"
- "3.6"
- "3.7"
- "3.8"

before_install:
- pip install pytest pytest-cov
Expand Down
1 change: 0 additions & 1 deletion README.md
Expand Up @@ -7,7 +7,6 @@
[![Updates](https://pyup.io/repos/github/GiulioRossetti/ndlib/shield.svg)](https://pyup.io/repos/github/GiulioRossetti/ndlib/)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/GiulioRossetti/ndlib.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/GiulioRossetti/ndlib/context:python)
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/ndlib_nx/community?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FGiulioRossetti%2Fndlib.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FGiulioRossetti%2Fndlib?ref=badge_shield)
[![DOI](https://zenodo.org/badge/59556819.svg)](https://zenodo.org/badge/latestdoi/59556819)
[![PyPI download month](https://img.shields.io/pypi/dm/ndlib.svg?color=blue&style=plastic)](https://pypi.python.org/pypi/ndlib/)

Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Expand Up @@ -7,7 +7,7 @@ NDlib - Network Diffusion Library

================ =================== ================== ========== ===============
**Date** **Python Versions** **Main Author** **GitHub** **pypl**
|date| 3.x `Giulio Rossetti`_ `Source`_ `Distribution`_
|date| >=3.6 `Giulio Rossetti`_ `Source`_ `Distribution`_
================ =================== ================== ========== ===============


Expand Down
7 changes: 4 additions & 3 deletions ndlib/test/test_continuous_model.py
Expand Up @@ -17,6 +17,7 @@


class NdlibContinuousModelTest(unittest.TestCase):

def test_bare_model(self):
def initial_addiction(node, graph, status, constants):
addiction = 0
Expand Down Expand Up @@ -116,10 +117,10 @@ def test_conditions(self):

# Update functions
def update_1(node, graph, status, attributes, constants):
return status[node]['status_2'] + 0.1
return status[node]['status_2'] + 0.1

def update_2(node, graph, status, attributes, constants):
return status[node]['status_1'] + 0.5
return status[node]['status_1'] + 0.5

# Rules
model.add_rule('status_1', update_1, condition)
Expand All @@ -138,7 +139,7 @@ def sample_state_weighted(graph, status):
status_1 = [stat['status_1'] for stat in list(status.values())]
factor = 1.0/sum(status_1)
for s in status_1:
probs.append(s * factor)
probs.append(s * factor)
return np.random.choice(graph.nodes, size=1, replace=False, p=probs)

schemes = [
Expand Down
2 changes: 1 addition & 1 deletion ndlib/viz/mpl/DiffusionViz.py
Expand Up @@ -70,7 +70,7 @@ def plot(self, filename=None, percentile=90, statuses=None):
#,color=cols[i])
else:
plt.plot(range(0, mx), l[1], lw=2, label=self.srev[k], alpha=0.5) # , color=cols[i])
plt.fill_between(range(0, mx), l[0], l[2], alpha="0.2") # ,color=cols[i])
plt.fill_between(range(0, mx), l[0], l[2], alpha=0.2) # ,color=cols[i])

i += 1

Expand Down
3 changes: 0 additions & 3 deletions ndlib/viz/mpl/OpinionEvolution.py
Expand Up @@ -41,8 +41,6 @@ def plot(self, filename=None):
nodes2opinions = {}
node2col = {}

mx = 0

last_it = self.srev[-1]['iteration'] + 1
last_seen = {}

Expand Down Expand Up @@ -83,7 +81,6 @@ def plot(self, filename=None):
plt.ylabel(self.ylabel, fontsize=24)
plt.legend(loc="best", fontsize=18)


plt.tight_layout()
if filename is not None:
plt.savefig(filename)
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Expand Up @@ -14,3 +14,4 @@ tqdm
salib>=1.3
pillow
pyintergraph
six

0 comments on commit 73b4ab7

Please sign in to comment.