Skip to content

Commit

Permalink
Merge pull request #3 from IdeasLabUT/issue-1-fix
Browse files Browse the repository at this point in the history
Fixes - including issue #1
  • Loading branch information
arastuie authored Jun 9, 2024
2 parents d7fb1b9 + 59b3a61 commit e362710
Show file tree
Hide file tree
Showing 21 changed files with 61 additions and 55 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ dynetworkx/classes/test.py
DyNetworkX.egg-info/
tutorials/facebook-wall.txt.anon
tutorials/execs.email.linesnum

# venv
.venv
14 changes: 10 additions & 4 deletions README.rst → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ DyNetworkX
==========

DyNetworkX is a Python package for the study of dynamic network analysis (DNA).
DyNetworkX used to be a fork of `NetworkX <https://networkx.github.io/documentation/stable/index.html>`_
package. Thus, implementation, documentation and the development of DyNetworkX is heavily
DyNetworkX used to be a fork of [NetworkX](https://networkx.github.io/documentation/stable/index.html) package. Thus, implementation, documentation and the development of DyNetworkX is heavily
influenced by NetworkX.

**Documentation:** https://dynetworkx.readthedocs.io/
Expand All @@ -21,6 +20,13 @@ The audience for DyNetworkX includes mathematicians, physicists, biologists,
computer scientists, and social scientists. Overall, everyone interested
in analyzing dynamic networks.

Install
-------
You can install the latest version of DyNetworkX using pip:
```python
pip install dynetworkx
```

Python
------

Expand All @@ -30,12 +36,12 @@ algorithms. Python has a vibrant and growing ecosystem of packages that
NetworkX uses to provide more features such as numerical linear algebra and
drawing. In order to make the most out of NetworkX you will want to know how
to write basic programs in Python. Among the many guides to Python, we
recommend the `Python documentation <https://docs.python.org/3/>`_.
recommend the [Python documentation](https://docs.python.org/3/).

License
-------

Released under the 3-Clause BSD license (see `dydoc/source/license.rst`)::
Released under the 3-Clause BSD license (see [LICENSE.txt](LICENSE.txt)):

Copyright (C) 2018 IDEASLab @ The University of Toledo.

Expand Down
3 changes: 1 addition & 2 deletions dynetworkx/classes/impulsedigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
from networkx.classes.digraph import DiGraph
from networkx.classes.multidigraph import MultiDiGraph

import dynetworkx as dnx
from networkx.exception import NetworkXError
from sortedcontainers import SortedList, SortedDict
from sortedcontainers import SortedDict
import random
import math
from timeit import default_timer as timer
Expand Down
6 changes: 2 additions & 4 deletions dynetworkx/classes/impulsegraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
from networkx.classes.graph import Graph
from networkx.exception import NetworkXError
from networkx.classes.multigraph import MultiGraph
from networkx.classes.reportviews import NodeView, EdgeView, NodeDataView
from sortedcontainers import SortedList, SortedDict
from networkx.classes.reportviews import NodeDataView
from sortedcontainers import SortedDict
import random
import math
from timeit import default_timer as timer
from sklearn.linear_model import LinearRegression
from itertools import product

from dynetworkx.classes.intervalgraph import IntervalGraph


class ImpulseGraph(object):
"""Base class for undirected impulse graphs.
Expand Down
3 changes: 1 addition & 2 deletions dynetworkx/classes/intervaldigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
from networkx.classes.digraph import DiGraph
from networkx.classes.multidigraph import MultiDiGraph

import dynetworkx as dnx
from networkx.exception import NetworkXError
from dynetworkx.classes.intervaltree import IntervalTree
from sortedcontainers import SortedList, SortedDict
from sortedcontainers import SortedDict
import random
import math
from timeit import default_timer as timer
Expand Down
4 changes: 2 additions & 2 deletions dynetworkx/classes/intervalgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from networkx.exception import NetworkXError
from dynetworkx.classes.intervaltree import IntervalTree
from networkx.classes.multigraph import MultiGraph
from networkx.classes.reportviews import NodeView, EdgeView, NodeDataView
from networkx.classes.reportviews import NodeDataView
from sortedcontainers import SortedList, SortedDict
import random
import math
Expand Down Expand Up @@ -775,7 +775,7 @@ def has_edge(self, u, v, begin=None, end=None, overlapping=True):
True
With specific overlapping interval:
>>> G.has_edge(1, 2, begin=2)
True
>>> G.has_edge(2, 4, begin=12)
Expand Down
2 changes: 0 additions & 2 deletions dynetworkx/classes/intervaltree.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import networkx as nx
from sortedcontainers import SortedDict, SortedList
import operator

class Node:
Expand Down
4 changes: 2 additions & 2 deletions dynetworkx/classes/snapshotgraph.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from networkx.classes.graph import Graph
import numpy as np
from networkx import adjacency_matrix, from_numpy_array
from sortedcontainers import SortedDict, SortedList
from sortedcontainers import SortedDict
import copy


Expand Down Expand Up @@ -733,7 +733,7 @@ def add_nodes_from(self, nbunch, sbunch=None, start=None, end=None, **attrs):
[0 0 0 0 0 0 0]]
"""

if sbunch and (start or end):
raise ValueError('Either sbunch or (start and end) can be specified.')
elif sbunch:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
3 4 5.0 weight=1.0
1 2 3.0
2 3 4.0
3 4 5.0 weight=1.0
6 7 8.0 weight=2.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
3 4 5.0 weight=1.0
1 2 3.0
2 3 4.0
3 4 5.0 weight=1.0
6 7 8.0 weight=2.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1 2 3 4.0
13 14 15 16.0 weight=2.0
5 6 7 8.0
9 10 11 12.0 weight=1.0
13 14 15 16.0 weight=2.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1 2 3 4.0
13 14 15 16.0 weight=2.0
5 6 7 8.0
9 10 11 12.0 weight=1.0
13 14 15 16.0 weight=2.0
1 change: 0 additions & 1 deletion dynetworkx/tests/test_impulsedigraph.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import dynetworkx as dnx
import networkx as nx


def test_impulsedigraph_init_default():
Expand Down
2 changes: 0 additions & 2 deletions dynetworkx/tests/test_impulsegraph.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import dynetworkx as dnx
import networkx as nx
from networkx import from_numpy_matrix, from_numpy_array
import os
import numpy as np

current_dir = os.path.dirname(__file__)

Expand Down
1 change: 0 additions & 1 deletion dynetworkx/tests/test_intervaldigraph.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import dynetworkx as dnx
import networkx as nx


def test_intervaldigraph_init():
Expand Down
4 changes: 2 additions & 2 deletions dynetworkx/tests/test_snapshotgraph.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import dynetworkx as dnx
import networkx as nx
from networkx import from_numpy_matrix, from_numpy_array
from networkx import from_numpy_array
import os
import numpy as np

Expand Down Expand Up @@ -320,7 +320,7 @@ def test_snapshotgraph_load_from_text_multi():
desired.insert(from_numpy_array(
np.array([[0, 1, 1, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0],
[0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 1, 0]])), start=0, end=3)
desired.insert(from_numpy_matrix(
desired.insert(from_numpy_array(
np.array([[0, 1, 1, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0],
[0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 1, 0]])), start=3, end=10)

Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
-r requirements/default.txt
-r requirements/test.txt
-r requirements/dynetworkx.txt
-r requirements/dynetworkx.txt
-r requirements/test.txt
6 changes: 3 additions & 3 deletions requirements/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Index

- [`default.txt`](default.txt)
- [`dynetworkx.txt`](dynetworkx.txt)
Default requirements
- [`extras.txt`](extras.txt)
Optional requirements
Expand All @@ -16,12 +16,12 @@
### Installing requirements

```bash
$ pip install -U -r requirements/default.txt
$ pip install -U -r requirements/dynetworkx.txt
```

### Running the tests

```bash
$ pip install -U -r requirements/default.txt
$ pip install -U -r requirements/dynetworkx.txt
$ pip install -U -r requirements/test.txt
```
1 change: 0 additions & 1 deletion requirements/default.txt

This file was deleted.

3 changes: 1 addition & 2 deletions requirements/dynetworkx.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
networkx>=2.0
sortedcontainers
numpy
timeit
sklearn
scikit-learn
46 changes: 28 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
from os import path

from setuptools import setup

pwd = path.abspath(path.dirname(__file__))
with open(path.join(pwd, "README.md"), "r", encoding="utf-8") as fh:
long_description = fh.read()

setup(
name='DyNetworkX',
version='0.3.2',
author='Makan Arastuie',
author_email='[email protected]',
packages=['dynetworkx',
'dynetworkx.algorithms',
'dynetworkx.classes',
'dynetworkx.tests',
],
license='Released under the 3-Clause BSD license.',
url='https://github.com/IdeasLabUT/dynetworkx',
description='DyNetworkX is a Python package for the study of dynamic network analysis.',
long_description=open('README.rst').read(),
install_requires=['networkx',
'sortedcontainers',
'numpy',
],
python_requires='>=3.4',
name="dynetworkx",
version="0.4.2",
author="Makan Arastuie",
author_email="[email protected]",
packages=[
"dynetworkx",
"dynetworkx.algorithms",
"dynetworkx.classes",
"dynetworkx.tests",
],
license="Released under the 3-Clause BSD license.",
url="https://github.com/IdeasLabUT/dynetworkx",
description="DyNetworkX is a Python package for the study of dynamic network analysis.",
long_description=long_description,
long_description_content_type="text/markdown",
install_requires=[
"networkx>=2.0",
"sortedcontainers",
"numpy",
"scikit-learn",
],
python_requires=">=3.4",
)

0 comments on commit e362710

Please sign in to comment.