Skip to content

Commit

Permalink
Merge pull request #3 from aaronmussig/1.0.1
Browse files Browse the repository at this point in the history
1.0.1
  • Loading branch information
aaronmussig authored Apr 7, 2020
2 parents 9c1f0d4 + 6690ad3 commit 1682869
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
2 changes: 1 addition & 1 deletion vtracker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
__title__ = 'VTracker'
__description__ = 'For tracking the relationship between group membership changes across versions.'
__url__ = 'https://github.com/aaronmussig/vtracker'
__version__ = '1.0.0'
__version__ = '1.0.1'
__author__ = 'Aaron Mussig'
__author_email__ = '[email protected]'
__license__ = 'GPL3'
Expand Down
25 changes: 21 additions & 4 deletions vtracker/graph.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
from typing import Optional, Dict, Tuple, Generator, Set, Hashable
###############################################################################
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################

from typing import Optional, Dict, Tuple, Generator, Set

from .exceptions import DuplicateNode, DuplicateEdge

Expand All @@ -14,7 +31,7 @@ def __init__(self):
self._edge_id = 0 # type: int

def add_node(self, key, attrs=None):
# type: (Hashable, Optional[dict]) -> None
# type: (str, Optional[dict]) -> None
"""Add a node to the graph.
Parameters
Expand Down Expand Up @@ -106,7 +123,7 @@ def iter_nodes(self):
-------
Generator[Node]
Yields all nodes in the graph."""
for node in self._nodes.values():
for node in sorted(self._nodes.values(), key=lambda n: n._node_id):
yield node

def iter_edges(self):
Expand All @@ -117,7 +134,7 @@ def iter_edges(self):
-------
Generator[Edge]
Yields all edges in the graph."""
for edge in self._edges.values():
for edge in sorted(self._edges.values(), key=lambda e: e._edge_id):
yield edge


Expand Down
19 changes: 18 additions & 1 deletion vtracker/vtracker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
###############################################################################
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################

from collections import defaultdict

from typing import Iterable, Dict, Tuple, Union, Set, List
from typing import Iterable, Dict, Tuple, Set, List

from .exceptions import MissingVersion, DuplicateEntity
from .graph import Graph
Expand Down

0 comments on commit 1682869

Please sign in to comment.