Skip to content

Commit

Permalink
- (beta) added a '--suppress-cursor' option to remove the spinning wh…
Browse files Browse the repository at this point in the history
…eel when it is not needed

- fixed documentation text and comments
  • Loading branch information
wariobrega committed Aug 27, 2018
1 parent 284deb2 commit d68c0e4
Show file tree
Hide file tree
Showing 58 changed files with 124 additions and 87 deletions.
2 changes: 1 addition & 1 deletion algorithms/bruteforce_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

__author__ = ["Daniele Capocefalo", "Mauro Truglio", "Tommaso Mazza"]
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion algorithms/global_topology.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
""" Compute several global topology metrics of a given graph """

__author__ = ["Daniele Capocefalo", "Mauro Truglio", "Tommaso Mazza"]
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion algorithms/greedy_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

__author__ = ["Daniele Capocefalo", "Mauro Truglio", "Tommaso Mazza"]
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion algorithms/keyplayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
https://doi.org/10.1007/s10588-006-7084-x"""

__author__ = ["Daniele Capocefalo", "Mauro Truglio", "Tommaso Mazza"]
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion algorithms/local_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

__author__ = ["Daniele Capocefalo", "Mauro Truglio", "Tommaso Mazza"]
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion algorithms/scalefree_inference.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion algorithms/shortest_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

__author__ = ["Daniele Capocefalo", "Mauro Truglio", "Tommaso Mazza"]
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Tommaso Mazza"
Expand Down
2 changes: 1 addition & 1 deletion algorithms/shortestpath_gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
a NVIDIA-compliant GPU, if available"""

__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Tommaso Mazza"
Expand Down
2 changes: 1 addition & 1 deletion algorithms/sparseness.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion cmds/cmds_utils/kpsearch_wrapper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion cmds/cmds_utils/plotter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion cmds/cmds_utils/reporter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
15 changes: 10 additions & 5 deletions cmds/communities.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down Expand Up @@ -48,9 +48,12 @@ def __init__(self, args):
self.args.no_plot = True

def run(self):
cursor = CursorAnimation()
cursor.daemon = True
cursor.start()

if not self.args.suppress_cursor:
cursor = CursorAnimation()
cursor.daemon = True
cursor.start()

if not self.args.input_file:
sys.stderr.write("ERROR: Input file is missing. Quitting\n")
sys.exit(1)
Expand Down Expand Up @@ -410,6 +413,8 @@ def run(self):
sys.stdout.write(
"Module {0} is above pyntacle Plotting limits ({1} nodes , we support 1000 nodes). Will skip plotting this module.\n".format(
i, comm.vcount()))
cursor.stop()
if not self.args.suppress_cursor:
cursor.stop()

sys.stdout.write("Community Finding completed successfully. Ending\n")
sys.exit(0)
16 changes: 10 additions & 6 deletions cmds/convert.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down Expand Up @@ -32,17 +32,19 @@

class Convert():
"""
take input command line arguments in order to quickly convert one file format to another
take input network file and convert one file format to another (with several options attached)
"""
def __init__(self, args):
self.logging = log
self.args = args

def run(self):
# dictionary that stores the basename of the output file
cursor = CursorAnimation()
cursor.daemon = True
cursor.start()
if not self.args.suppress_cursor:
cursor = CursorAnimation()
cursor.daemon = True
cursor.start()

if self.args.no_header:
header = False
else:
Expand Down Expand Up @@ -150,6 +152,8 @@ def run(self):
os.path.abspath(self.args.input_file), output_path))
PyntacleExporter.Binary(graph, output_path)

cursor.stop()
if not self.args.suppress_cursor:
cursor.stop()

sys.stdout.write("{} converted successfully\n".format(os.path.basename(self.args.input_file)))
sys.exit(0)
15 changes: 10 additions & 5 deletions cmds/generate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down Expand Up @@ -42,9 +42,11 @@ def __init__(self, args):
random.seed(self.args.seed)

def run(self):
cursor = CursorAnimation()
cursor.daemon = True
cursor.start()
if not self.args.suppress_cursor:
cursor = CursorAnimation()
cursor.daemon = True
cursor.start()

if self.args.which == "random":

if self.args.nodes is None:
Expand Down Expand Up @@ -373,7 +375,10 @@ def run(self):
"Graph ({} nodes) exceeds pyntacle limits for plotting (maximum 1000 nodes). Will not draw Graph".format(
graph.vcount()))
sys.exit(0)
cursor.stop()

if not self.args.suppress_cursor:
cursor.stop()

sys.stdout.write("pyntacle Generate completed successfully. Ending\n")
if self.args.repeat == 1:
sys.exit(0)
14 changes: 9 additions & 5 deletions cmds/keyplayer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down Expand Up @@ -50,9 +50,11 @@ def __init__(self, args):
self.args.no_plot = True

def run(self):
cursor = CursorAnimation()
cursor.daemon = True
cursor.start()
if not self.args.suppress_cursor:
cursor = CursorAnimation()
cursor.daemon = True
cursor.start()

if self.args.m_reach == None and self.args.type in ["pos", "all"]:
raise Error("m reach distance must be provided")

Expand Down Expand Up @@ -606,6 +608,8 @@ def run(self):

elif graph.vcount() >= 1000:
sys.stdout.write("The graph has too many nodes ({}). Can't draw graph\n".format(graph.vcount()))
cursor.stop()
if not self.args.suppress_cursor:
cursor.stop()

sys.stdout.write("pyntacle Keyplayer completed successfully. Ending\n")
sys.exit(0)
13 changes: 8 additions & 5 deletions cmds/metrics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down Expand Up @@ -53,9 +53,10 @@ def __init__(self, args):
self.args.no_plot = True

def run(self):
cursor = CursorAnimation()
cursor.daemon = True
cursor.start()
if not self.args.suppress_cursor:
cursor = CursorAnimation()
cursor.daemon = True
cursor.start()
if self.args.no_header:
header = False
else:
Expand Down Expand Up @@ -473,6 +474,8 @@ def run(self):
sys.stdout.write("Saving graph to a Binary file\n")
PyntacleExporter.Binary(graph, binary_path)

cursor.stop()
if not self.args.suppress_cursor:
cursor.stop()

sys.stdout.write("pyntacle Metrics completed successfully. Ending\n")
sys.exit(0)
16 changes: 10 additions & 6 deletions cmds/set.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down Expand Up @@ -53,10 +53,11 @@ def __init__(self, args):
self.args.no_plot = True

def run(self):
# process input files
cursor = CursorAnimation()
cursor.daemon = True
cursor.start()

if not self.args.suppress_cursor:
cursor = CursorAnimation()
cursor.daemon = True
cursor.start()
if not self.args.input_file_1 or not self.args.input_file_2:
sys.stderr.write("ERROR: one of the two input files is missing. Quitting\n")
sys.exit(1)
Expand Down Expand Up @@ -436,6 +437,9 @@ def run(self):
reporter1.report.extend(reporter2.report)
reporter1.report.extend(reporter_final.report)
reporter1.write_report(report_dir=self.args.directory, format=self.args.report_format)
cursor.stop()

if not self.args.suppress_cursor:
cursor.stop()

sys.stdout.write("pyntacle Set completed successfully\n")
sys.exit(0)
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = ["Daniele Capocefalo", "Mauro Truglio", "Tommaso Mazza"]
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion exceptions/generic_error.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion exceptions/illegal_argument_number_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion exceptions/illegal_graph_size_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion exceptions/illegal_kppset_size_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion exceptions/missing_attribute_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion exceptions/multiple_solutions_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion exceptions/notagraph_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion exceptions/unproperly_formatted_file_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
2 changes: 1 addition & 1 deletion exceptions/unsupported_graph_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

__author__ = "Daniele Capocefalo, Mauro Truglio, Tommaso Mazza"
__copyright__ = "Copyright 2018, The pyntacle Project"
__copyright__ = "Copyright 2018, The Pyntacle Project"
__credits__ = ["Ferenc Jordan"]
__version__ = "0.2.3.1"
__maintainer__ = "Daniele Capocefalo"
Expand Down
Loading

0 comments on commit d68c0e4

Please sign in to comment.