/start.py (2fa307ee1f510eefc21af359b48003c3b368c85b) (2122 bytes) (mode 100755) (type blob)
#!/usr/bin/env python
import datetime
import argparse
import cProfile, pstats, StringIO
from file_importer import FileImporter
from metric_calculator import MetricCalculator
import datetime as dt
print 'Starting metric calculation',dt.datetime.now()
## added this line of code ###
start_time = dt.datetime.now()
##############################
parser = argparse.ArgumentParser(description='Read a Tab-separated Graph Datafile and start Calculation of Metrics and Statistics as configured in config.py')
parser.add_argument('filename', metavar='filename', type=str,
help='the name of the data file containing tab separated node ids')
parser.add_argument('--profiling',dest='profiling',action='store_true', help='enable runtime profiling into profiling.txt file')
args = parser.parse_args()
if args.profiling:
pr = cProfile.Profile()
s = StringIO.StringIO()
timestamp = str(datetime.datetime.now().strftime('%Y%m%d_%H%M%S'))
outfile = open('profiling_output_'+timestamp+'.txt', 'w')
pr.enable()
fi = FileImporter(args.filename)
graph = fi.read()
#print('This should be a Network X graph',graph)
print 'Network X graph has the following number of nodes',graph.number_of_nodes()
print 'Network X graph has the following number of edges',graph.number_of_edges()
graph_gt = fi.read_gt()
print 'Graph tool graph has the following number of nodes',graph_gt['graph_gt'].num_vertices()
print 'Graph tool graph has the following number of edges',graph_gt['graph_gt'].num_edges()
#print('Gt graph has the following properties')
## added two lines of code ###
duration_parsing_lines = dt.datetime.now() - start_time
print 'Time taken to parse lines:',duration_parsing_lines
mc = MetricCalculator(graph,graph_gt)
mc.start()
if args.profiling:
ps = pstats.Stats(pr, stream=s).sort_stats('cumulative')
ps.print_stats()
outfile.write(s.getvalue())
## added this line of code ###
duration_total = dt.datetime.now() - start_time
##############################
print 'Ending metric calculation',dt.datetime.now()
## and this line below #######
print 'Time taken to calculate:',duration_total
Mode |
Type |
Size |
Ref |
File |
100644 |
blob |
112 |
cb89d830628675849b4fc506e25faaee9ada3055 |
README.md |
100644 |
blob |
39806 |
a3ed366a3ca7fa6017d524c37cb15d492ef7a0ab |
RU_ASN.txt |
040000 |
tree |
- |
fe0210446ce6fae4108a4700bb1ca9d427592d96 |
RedisHelpers |
100644 |
blob |
1256 |
489636a0073e3dfe2bfd04ee893d609d304a8490 |
advancedscores.py |
100644 |
blob |
1175 |
51d93965eefe7cc74022747e2b9207a5d619dacc |
advancedscores.pyc |
100644 |
blob |
1420 |
985dee55c7d8134c4860db8bcccced703b2eb0af |
change_output_file.py |
100644 |
blob |
7814 |
05c0bdf71013c680ab4bc02a57d0f02bec1df0fa |
config.py |
100644 |
blob |
2752 |
04b1176c3586c57b214cf3b20c110c4bd0956d25 |
config.pyc |
040000 |
tree |
- |
75923ffe9842fe9106a2bed8acbc4bdfb5219025 |
data |
100644 |
blob |
4571 |
88c66d8e136505e5a29e3aeb8e6e7e131424f4e3 |
file_importer.py |
100644 |
blob |
2190 |
9b19358d5f4c39da2da330a4dba4416ae089ff61 |
file_importer.pyc |
100644 |
blob |
633 |
df288a704ff3390fbe5f3090d488fe45df79c23a |
graph_test.py |
100644 |
blob |
901 |
ae318bee51ebd11d4524c90cc13193f7e8bc208f |
gt_file_importer.py |
100644 |
blob |
1366 |
12f8577e0a31cee71b70c20849d18ebd36174796 |
gt_file_importer.pyc |
100644 |
blob |
2064 |
728489f88ef880350a83f4ab8b1e0510239ce067 |
gt_start.py |
100644 |
blob |
858 |
28f726f3a2fe224a374f24b299fdfdc8bef9f569 |
indexing.py |
100644 |
blob |
1571 |
68587bbbe3043dbed78d9b3b3018e802e93c6931 |
indexing.pyc |
100644 |
blob |
33232205 |
7ca601d1ca32abf3244359ce3ad85ea6a1b60010 |
log |
100644 |
blob |
16008 |
e7f06881cdc4375940715dd3abf9ff5bcdb42fbe |
metric_calculator.py |
100644 |
blob |
11204 |
b7d78f3bc365a4639c4b462f1724b732d8a11122 |
metric_calculator.pyc |
100644 |
blob |
14963 |
6692689a02b4cca1b60e568579723eedb748beec |
metrics.py |
100644 |
blob |
11616 |
a56470059e373ca2da9ac235a5457235a3a2fef8 |
metrics.pyc |
100644 |
blob |
61770227 |
1adc4f608c6a5fb41881af629b708af873dfed5f |
nohup.out |
100644 |
blob |
1665 |
a959a8cc528f486a80a84e2ab233457870d255a1 |
normalizations.py |
100644 |
blob |
1402 |
85e8e32fc6b18fabf451d9290c9d33b95d453f5e |
normalizations.pyc |
100644 |
blob |
11004 |
7038340d6cfb9a543d0aea01f2c2856460333a7b |
percolation.py |
100644 |
blob |
6411 |
e81344c0f958c1b9ef244749208d4c4f6ca91bd0 |
percolation.pyc |
100644 |
blob |
1445 |
5c06bec9674e666d2a5633804e1579df1acb6a9e |
ru_file_importer.py |
100644 |
blob |
1976 |
2ec49e610f1a124fa66df97f6fd6e6bb230797e4 |
ru_file_importer.pyc |
100644 |
blob |
16641 |
ee1f7cf9d0fabd7fb76787e8c375cafd9e5c9f35 |
ru_metric_calculator.py |
100644 |
blob |
11412 |
3d1104701e131696433e467a5bef30a589105865 |
ru_metric_calculator.pyc |
100644 |
blob |
2101 |
faf282d2fa893c507daa12ae97d29407238b3748 |
ru_start.py |
100755 |
blob |
2122 |
2fa307ee1f510eefc21af359b48003c3b368c85b |
start.py |
100644 |
blob |
2150 |
cf8423b852f3c09938906493ea831d0cfbbec941 |
statistics.py |
100644 |
blob |
2126 |
f8f55b53a1757681125d5af18c87980b44afe6bb |
statistics.pyc |
100644 |
blob |
1107 |
90c62617dd2c7340c2f3d31a3f485d30f9736865 |
test.py |
100644 |
blob |
6574 |
39e8f0848567e9d6836abb6283290ab35f5fdde3 |
visualization.py |
100644 |
blob |
5643 |
a4a569c1d73df7dec64e48b266a38bb481e0c0bb |
visualization.pyc |
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"
Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/coria/coria-backend
Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/coria/coria-backend
Clone this repository using git:
git clone git://git.rocketgit.com/user/coria/coria-backend
You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a
merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main