Skip to content

Commit

Permalink
changed electrodes to have junctions and updated measure
Browse files Browse the repository at this point in the history
  • Loading branch information
leobrowning92 committed Apr 16, 2018
1 parent 829ddc5 commit 09010b4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions measure_perc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@



def measure_fullnet(n, v=True, scaling=60, remote=False, l='exp', save=False, show=False):
def measure_fullnet(n,scaling=60, l='exp', save=False, show=False, v=True ,remote=False):
start = timer()
data=pd.DataFrame(columns = ['sticks', 'size', 'density', 'nclust', 'maxclust', 'ion', 'ioff','ioff_totaltop', 'ioff_partialtop', 'runtime', 'fname'])
try:
Expand Down Expand Up @@ -97,16 +97,25 @@ def measure_number_series_compareL(remote=True):
pool = Pool(os.cpu_count()-1)
pool.map(n_vary_expL_remote, nexp)
pool.map(n_vary_066L_remote, nconst)
def measure_async(cores,start,step,number,save=False):
nrange=[start+i*step for i in range(number)]
pool=Pool(cores)
results=[pool.apply_async(measure_fullnet,args=(n,5,'exp',save)) for n in nrange]
output=[res.get() for res in results]
return output

if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-t",'--test',action="store_true",default=False)
parser.add_argument('--show',action="store_true",default=False)
parser.add_argument('-s','--save',action="store_true",default=False)
parser.add_argument("--cores",type=int,default=1)
parser.add_argument("--start",type=int)
parser.add_argument("--step",type=int,default=0)
parser.add_argument("--number",type=int)
args = parser.parse_args()

if args.test:
measure_fullnet(500,scaling=5,save=args.save, show=args.show)
measure_async(2,500,0,10)
else:
measure_number_series(remote=args.remote)
measure_number_series_compareL(remote=args.remote)
measure_async(args.cores, args.start, args.step, args.number, args.save)
2 changes: 1 addition & 1 deletion percolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def make_graph(self):
return False,False,False

def populate_graph(self):
offmap={'ms':1000,'sm':1000, 'mm':1,'ss':1,'vs':1,'sv':1,'vm':1,'mv':1}
offmap={'ms':1000,'sm':1000, 'mm':1,'ss':1,'vs':1000,'sv':1000,'vm':1000,'mv':1000}
for edge in self.graph.edges():
self.graph.edges[edge]['component']=Transistor( off_resistance=offmap[self.graph.edges[edge]['kind']])

Expand Down

0 comments on commit 09010b4

Please sign in to comment.