How to use the pysces.PyscesUtils.TimerBox function in pysces

To help you get started, we’ve selected a few pysces examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PySCeS / pysces / pysces / examples / testparscanner.py View on Github external
#!/usr/bin/env python
# Testing the new parallel scanner class

import os
backupdir = os.getcwd()

import numpy as np
import pysces

tbox=pysces.PyscesUtils.TimerBox()
import time

m=pysces.model('isola2a')

ser = pysces.Scanner(m)

print("Serial execution...")
print("Start: ", tbox.normal_timer('SER'))
print(next(tbox.SER))
t1=time.time()
ser.quietRun = True
ser.addScanParameter('V4',60,100,11)
ser.addScanParameter('V1',100,160,16)
ser.addScanParameter('V2',100,130,16,slave=True)
ser.addScanParameter('V3',80,90,6)
ser.addUserOutput('J_R1', 'A', 'ecR4_X','ccJR1_R1')
github PySCeS / pysces / pysces / examples / testinvalidstate.py View on Github external
#!/usr/bin/env python
# Testing the new parallel scanner class - detection of invalid states
# --jr20101218

import os
backupdir = os.getcwd()

import numpy as np
import pysces

tbox=pysces.PyscesUtils.TimerBox()
import time

m=pysces.model('isola2a')

ser = pysces.Scanner(m)

print("Serial execution...")
print("Start: ", tbox.normal_timer('SER'))
print(next(tbox.SER))
t1=time.time()
ser.quietRun = True
ser.addScanParameter('V4',0.01,200,2000,log=True)
ser.addUserOutput('J_R1', 'A')
ser.Run()
print("Done: ", next(tbox.SER))
t2=time.time()
github PySCeS / pysces / pysces / examples / testRunScatter.py View on Github external
#!/usr/bin/env python
# Testing the new parallel scanner class

import os
backupdir = os.getcwd()

import numpy as np
import pysces

tbox=pysces.PyscesUtils.TimerBox()
import time

m=pysces.model('isola2a')

print("\n\nParallel execution...using RunScatter")
par2 = pysces.ParScanner(m)
t5=time.time()
par2.addScanParameter('V4',60,100,11)
par2.addScanParameter('V1',100,130,16)
par2.addScanParameter('V2',100,130,16,slave=True)
par2.addScanParameter('V3',80,90,6)
par2.addUserOutput('J_R1', 'A', 'ecR4_X', 'ccJR1_R1')
#par2.addUserOutput('J_R1', 'A')
par2.RunScatter()
t6=time.time()
print("Duration: %.2f seconds" % (t6-t5))
github PySCeS / pysces / pysces / PyscesScan.py View on Github external
def __init__(self,model):
        """
        Instantiate PITCONScanUtils with a loaded PySCeS model instance.
        """
        self.model = model
        self.timer = TimerBox()
github PySCeS / pysces / pysces / PyscesParScan.py View on Github external
raise OSError(str(ex)+'\nPARSCANNER: Requires a running IPython cluster. See "ipcluster --help".\n')
            dv = rc[:]       # direct view
            lv = rc.load_balanced_view()
            self.dv=dv
            self.lv=lv
            dv.execute('from pysces.PyscesParScan import Analyze, setModValue')
        else:
            raise UserWarning(engine+" is not a valid parallel engine!")
        self.GenDict = {}
        self.GenOrder = []
        self.ScanSpace = []
        self.mod = mod
        self.SteadyStateResults = []
        self.UserOutputList = []
        self.UserOutputResults = []
        self.scanT = TimerBox()
github PySCeS / pysces / pysces / PyscesScan.py View on Github external
def __init__(self, mod):
        try:
            N = mod.nmatrix
        except Exception as ex:
            print('\nSCANNER: Please load a model  before trying to use it.')

        self.GenDict = {}
        self.GenOrder = []
        self.ScanSpace = []
        self.mod = mod
        self.SteadyStateResults = []
        self.UserOutputList = []
        self.UserOutputResults = []
        self.scanT = TimerBox()