diff --git a/__init__.py b/__init__.py index eb5e7d3cba4e2ec949ce90832e3d8651063b94dd..c15db285c638ff169fa0d342bcdd283e5f36dcbc 100644 --- a/__init__.py +++ b/__init__.py @@ -3,20 +3,12 @@ Library base importing definitions. """ # Import files/values we want to be available to library users. -from .resources.basic_graph.edge import Edge as BasicEdge -from .resources.basic_graph.node import Node as BasicNode -from .resources.basic_graph.graph import Graph as BasicGraph -from .resources.directed_graph.edge import Edge as DirectedEdge -from .resources.directed_graph.node import Node as DirectedNode -from .resources.directed_graph.graph import Graph as DirectedGraph -from .resources.state_machine.edge import Edge as StateMachineEdge -from .resources.state_machine.node import Node as StateMachineNode -from .resources.state_machine.graph import Graph as StateMachineGraph +from .resources import * # Define imports when using the * flag on this library. __all__ = [ - BasicEdge, BasicNode, BasicGraph, - DirectedEdge, DirectedNode, DirectedGraph, - StateMachineEdge, StateMachineNode, StateMachineGraph, + 'BasicEdge', 'BasicNode', 'BasicGraph', + 'DirectedEdge', 'DirectedNode', 'DirectedGraph', + 'StateMachineEdge', 'StateMachineNode', 'StateMachineGraph', ] diff --git a/main.py b/main.py index ebb126bb90ff4fdbfae0da52dba863d12925110f..0c9011b315ab742a328a4ac8ee5de1d8242cb0d5 100644 --- a/main.py +++ b/main.py @@ -14,12 +14,9 @@ Example usage and output for graph library. # User Class Imports. from random import randint from resources import logging as init_logging -from resources.basic_graph.components import BasicEdge, BasicNode -from resources.basic_graph.graph import BasicGraph -from resources.directed_graph.components import DirectedEdge, DirectedNode -from resources.directed_graph.graph import DirectedGraph -from resources.state_machine.components import StateMachineEdge, StateMachineNode -from resources.state_machine.graph import StateMachineGraph +from resources import BasicEdge, BasicGraph, BasicNode +from resources import DirectedEdge, DirectedGraph, DirectedNode +from resources import StateMachineEdge, StateMachineGraph, StateMachineNode # Initialize Logger. diff --git a/resources/__init__.py b/resources/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..28e6dd0198e5db41b9b00287708609ddeb1ea396 100644 --- a/resources/__init__.py +++ b/resources/__init__.py @@ -0,0 +1,14 @@ +""" +"Resources" folder importing definitions. +""" + +# Import files/values we want to be available to other folders. +from .graphs import * + + +# Define imports when using the * flag on this folder. +__all__ = [ + 'BasicEdge', 'BasicNode', 'BasicGraph', + 'DirectedEdge', 'DirectedNode', 'DirectedGraph', + 'StateMachineEdge', 'StateMachineNode', 'StateMachineGraph', +] diff --git a/resources/graphs/__init__.py b/resources/graphs/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..882d3e65ca82973f7d9002541bd95fa7ecbabb2e --- /dev/null +++ b/resources/graphs/__init__.py @@ -0,0 +1,16 @@ +""" +"Graphs" folder importing definitions. +""" + +# Import files/values we want to be available to other folders. +from .basic_graph import * +from .directed_graph import * +from .state_machine import * + + +# Define imports when using the * flag on this folder. +__all__ = [ + 'BasicEdge', 'BasicNode', 'BasicGraph', + 'DirectedEdge', 'DirectedNode', 'DirectedGraph', + 'StateMachineEdge', 'StateMachineNode', 'StateMachineGraph', +] diff --git a/resources/graphs/basic_graph/__init__.py b/resources/graphs/basic_graph/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..90a670a02667323f0df6598d77441e0cfd3f7a39 --- /dev/null +++ b/resources/graphs/basic_graph/__init__.py @@ -0,0 +1,13 @@ +""" +"Basic Graph" folder importing definitions. +""" + +# Import files/values we want to be available to other folders. +from .components import BasicEdge, BasicNode +from .graph import BasicGraph + + +# Define imports when using the * flag on this folder. +__all__ = [ + 'BasicEdge', 'BasicNode', 'BasicGraph', +] diff --git a/resources/basic_graph/components.py b/resources/graphs/basic_graph/components.py similarity index 100% rename from resources/basic_graph/components.py rename to resources/graphs/basic_graph/components.py diff --git a/resources/basic_graph/graph.py b/resources/graphs/basic_graph/graph.py similarity index 100% rename from resources/basic_graph/graph.py rename to resources/graphs/basic_graph/graph.py diff --git a/resources/graphs/directed_graph/__init__.py b/resources/graphs/directed_graph/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..348e802ca9a9d8264bcc7aa35223c8ddc00aeaff --- /dev/null +++ b/resources/graphs/directed_graph/__init__.py @@ -0,0 +1,13 @@ +""" +"Directed Graph" folder importing definitions. +""" + +# Import files/values we want to be available to other folders. +from .components import DirectedEdge, DirectedNode +from .graph import DirectedGraph + + +# Define imports when using the * flag on this folder. +__all__ = [ + 'DirectedEdge', 'DirectedNode', 'DirectedGraph', +] diff --git a/resources/directed_graph/components.py b/resources/graphs/directed_graph/components.py similarity index 100% rename from resources/directed_graph/components.py rename to resources/graphs/directed_graph/components.py diff --git a/resources/directed_graph/graph.py b/resources/graphs/directed_graph/graph.py similarity index 100% rename from resources/directed_graph/graph.py rename to resources/graphs/directed_graph/graph.py diff --git a/resources/graphs/state_machine/__init__.py b/resources/graphs/state_machine/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..48a24d681483aea6fe649d0f937c59c7f889fd47 --- /dev/null +++ b/resources/graphs/state_machine/__init__.py @@ -0,0 +1,13 @@ +""" +"State Machine Graph" folder importing definitions. +""" + +# Import files/values we want to be available to other folders. +from .components import StateMachineEdge, StateMachineNode +from .graph import StateMachineGraph + + +# Define imports when using the * flag on this folder. +__all__ = [ + 'StateMachineEdge', 'StateMachineNode', 'StateMachineGraph', +] diff --git a/resources/state_machine/components.py b/resources/graphs/state_machine/components.py similarity index 100% rename from resources/state_machine/components.py rename to resources/graphs/state_machine/components.py diff --git a/resources/state_machine/graph.py b/resources/graphs/state_machine/graph.py similarity index 100% rename from resources/state_machine/graph.py rename to resources/graphs/state_machine/graph.py diff --git a/resources/basic_graph/__init__.py b/tests/resources/graphs/__init__.py similarity index 100% rename from resources/basic_graph/__init__.py rename to tests/resources/graphs/__init__.py diff --git a/resources/directed_graph/__init__.py b/tests/resources/graphs/basic_graph/__init__.py similarity index 100% rename from resources/directed_graph/__init__.py rename to tests/resources/graphs/basic_graph/__init__.py diff --git a/tests/resources/basic_graph/edge.py b/tests/resources/graphs/basic_graph/edge.py similarity index 99% rename from tests/resources/basic_graph/edge.py rename to tests/resources/graphs/basic_graph/edge.py index 0f19d662acf28d6a624d4ebc4b5179d4b3d83556..f0bed5b602eb951e68c919c95b22f1d9c23ef7b5 100644 --- a/tests/resources/basic_graph/edge.py +++ b/tests/resources/graphs/basic_graph/edge.py @@ -12,7 +12,7 @@ Tests for "Basic Edge" class. import unittest # User Class Imports. -from resources.basic_graph.components import BasicEdge, BasicNode +from resources import BasicEdge, BasicNode class TestBasicEdge(unittest.TestCase): diff --git a/tests/resources/basic_graph/graph.py b/tests/resources/graphs/basic_graph/graph.py similarity index 99% rename from tests/resources/basic_graph/graph.py rename to tests/resources/graphs/basic_graph/graph.py index e3611fdb49b38debcf61701d41cbe5e14553e85d..42654fa02f97b59386ad153355f80308fec92677 100644 --- a/tests/resources/basic_graph/graph.py +++ b/tests/resources/graphs/basic_graph/graph.py @@ -12,8 +12,8 @@ Tests for "Basic Graph" class. import unittest # User Class Imports. -from resources.basic_graph.components import BasicEdge, BasicNode -from resources.basic_graph.graph import BasicGraph +from resources import BasicEdge, BasicNode +from resources import BasicGraph class TestBasicGraph(unittest.TestCase): diff --git a/tests/resources/basic_graph/node.py b/tests/resources/graphs/basic_graph/node.py similarity index 99% rename from tests/resources/basic_graph/node.py rename to tests/resources/graphs/basic_graph/node.py index b91e1b2c516cb1168dbed83b209a08a1882e5841..578dfd4774422092f2bf928c32b82f39c921d1da 100644 --- a/tests/resources/basic_graph/node.py +++ b/tests/resources/graphs/basic_graph/node.py @@ -12,7 +12,7 @@ Tests for "Basic Node" class. import unittest # User Class Imports. -from resources.basic_graph.components import BasicEdge, BasicNode +from resources import BasicEdge, BasicNode class TestBasicNode(unittest.TestCase): diff --git a/tests/resources/basic_graph/__init__.py b/tests/resources/graphs/directed_graph/__init__.py similarity index 100% rename from tests/resources/basic_graph/__init__.py rename to tests/resources/graphs/directed_graph/__init__.py diff --git a/tests/resources/directed_graph/edge.py b/tests/resources/graphs/directed_graph/edge.py similarity index 98% rename from tests/resources/directed_graph/edge.py rename to tests/resources/graphs/directed_graph/edge.py index 63b42022784e62beb6fd8e16a1788fe92fe728ef..192d63b42a67b3bb4b877ef73f743d828d7cb852 100644 --- a/tests/resources/directed_graph/edge.py +++ b/tests/resources/graphs/directed_graph/edge.py @@ -12,7 +12,7 @@ Tests for "Directed Edge" class. import unittest # User Class Imports. -from resources.directed_graph.components import DirectedEdge, DirectedNode +from resources import DirectedEdge, DirectedNode class TestDirectedEdge(unittest.TestCase): diff --git a/tests/resources/directed_graph/graph.py b/tests/resources/graphs/directed_graph/graph.py similarity index 92% rename from tests/resources/directed_graph/graph.py rename to tests/resources/graphs/directed_graph/graph.py index 815deac824abc53fb9fa1308db5e722c7b88f736..0510cfb5f41f02bbacbf28d439bcf560799d37fa 100644 --- a/tests/resources/directed_graph/graph.py +++ b/tests/resources/graphs/directed_graph/graph.py @@ -12,8 +12,8 @@ Tests for "Directed Graph" class. import unittest # User Class Imports. -from resources.directed_graph.components import DirectedEdge, DirectedNode -from resources.directed_graph.graph import DirectedGraph +from resources import DirectedEdge, DirectedNode +from resources import DirectedGraph class TestDirectedGraph(unittest.TestCase): diff --git a/tests/resources/directed_graph/node.py b/tests/resources/graphs/directed_graph/node.py similarity index 98% rename from tests/resources/directed_graph/node.py rename to tests/resources/graphs/directed_graph/node.py index b3d0644d924f46dc2d555403271a7dc9c9a4bc43..b8f023832de601bc7ab595f63c951d314fac0b52 100644 --- a/tests/resources/directed_graph/node.py +++ b/tests/resources/graphs/directed_graph/node.py @@ -12,7 +12,7 @@ Tests for "Directed Node" class. import unittest # User Class Imports. -from resources.directed_graph.components import DirectedEdge, DirectedNode +from resources import DirectedEdge, DirectedNode class TestDirectedNode(unittest.TestCase): diff --git a/tests/resources/directed_graph/__init__.py b/tests/resources/graphs/state_machine/__init__.py similarity index 100% rename from tests/resources/directed_graph/__init__.py rename to tests/resources/graphs/state_machine/__init__.py diff --git a/tests/resources/state_machine/edge.py b/tests/resources/graphs/state_machine/edge.py similarity index 99% rename from tests/resources/state_machine/edge.py rename to tests/resources/graphs/state_machine/edge.py index f3b092cee250524dfe2f9f57cf6d6be9c8d32933..2f47edc801a74930207604a8e08eee54c3adff8e 100644 --- a/tests/resources/state_machine/edge.py +++ b/tests/resources/graphs/state_machine/edge.py @@ -12,7 +12,7 @@ Tests for "State Machine Edge" class. import unittest # User Class Imports. -from resources.state_machine.components import StateMachineEdge, StateMachineNode +from resources import StateMachineEdge, StateMachineNode class TestStateMachineEdge(unittest.TestCase): diff --git a/tests/resources/state_machine/graph.py b/tests/resources/graphs/state_machine/graph.py similarity index 95% rename from tests/resources/state_machine/graph.py rename to tests/resources/graphs/state_machine/graph.py index af35200ad3929957d882571ef87ebf01855fac6a..5ab6de17208bfc96ddb6ab7ecf12939f6c0a2304 100644 --- a/tests/resources/state_machine/graph.py +++ b/tests/resources/graphs/state_machine/graph.py @@ -12,8 +12,8 @@ Tests for "State Machine Graph" class. import unittest # User Class Imports. -from resources.state_machine.components import StateMachineEdge, StateMachineNode -from resources.state_machine.graph import StateMachineGraph +from resources import StateMachineEdge, StateMachineNode +from resources import StateMachineGraph class TestDirectedGraph(unittest.TestCase): diff --git a/tests/resources/state_machine/node.py b/tests/resources/graphs/state_machine/node.py similarity index 94% rename from tests/resources/state_machine/node.py rename to tests/resources/graphs/state_machine/node.py index 8bccf7a2736dc16f850ce73c1af66e1abbcff592..1a84c22f150ccdfe53596d2d57869e73b65fc276 100644 --- a/tests/resources/state_machine/node.py +++ b/tests/resources/graphs/state_machine/node.py @@ -12,7 +12,7 @@ Tests for "State Machine Node" class. import unittest # User Class Imports. -from resources.state_machine.components import StateMachineEdge, StateMachineNode +from resources import StateMachineEdge, StateMachineNode class TestStateMachineNode(unittest.TestCase): diff --git a/tests/resources/state_machine/__init__.py b/tests/resources/state_machine/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000