def test_victory_check(self, mem, x, y): q = mp.Queue() example.main(mem, q) x1 = q.get() y1 = q.get() self.assertEqual(y, x1) self.assertEqual(x, y1)
def run(self): if self.distribution.install_requires: self.distribution.fetch_build_eggs(self.distribution.install_requires) import example example.main(self.config_file)
def run(self): if self.distribution.install_requires: self.distribution.fetch_build_eggs( self.distribution.install_requires, ) import example example.main(self.config_file)
def main(): """Runs all VPSolver examples.""" print "example:" example.main() print "example_vbp:" example_vbp.main() print "example_vsbpp:" example_vsbpp.main() print "example_mvbp:" example_mvbp.main()
def test_example(): """Test example.""" import example example.main()
def test_default(self): """ This method just runs the example code in order to test for runtime errors. """ example.main()
def test_example(): example.main(num_epochs=3)
#!/usr/bin/env python import example example.main()
def main(): server = make_server('127.0.0.1', 8080, example.main()) print('http://127.0.0.1:8080') server.serve_forever()
def test_main(): """ test ... """ ex.main()
def bert(): user_string = request.values['comment'] out = main(user_string) return jsonify(out)
from pycosmo import cosmo ### # Extraction du spectre SALT2 ### m = InstrumentModel("LSSTPG") cfg = saltpath.read_card_file(saltpath.fitmodel_filename) salt2_model_path = saltpath.SALTPATH + os.sep + cfg['SALT2'] M0_filename = salt2_model_path + os.sep + 'salt2_template_0.dat' nt = NTuple.fromtxt(M0_filename) idx = nt['f0'] == 0 gx = np.linspace(nt['f1'][idx].min() - 1e-10, nt['f1'][idx].max() + 1e-10, 100) base = bspline.BSpline(gx, order=4) p = base.linear_fit(nt['f1'][idx], nt['f2'][idx]) lcs0, log0, model = example.main(0) lcs1, log1, model = example.main(1) color_law_params = np.array([ 1.86053680e-13, -3.60052385e-09, 2.60815642e-05, -8.46865354e-02, 1.04582345e+02 ]) dt = [('z', float), ('c', float), ('X1', float), ('dL', float), ('band', 'S1'), ('#SN', int), ('A', float), ('l_eff', float), ('zp', float), ('snr', float)] def find_amplitude(snova, band, k='LSSTPG::'): band = k + band amplitude = snova.lcmodel(snova.sn, [snova.sn.DayMax], [band])[0]
def test_default(self): example.main()
import numpy as np from croaks import NTuple import os from saunerie import bspline import example import matplotlib.pyplot as plt from saunerie.instruments import InstrumentModel from scipy.sparse import csr_matrix, coo_matrix from saunerie.interpolation import Func1D import saunerie.constants as constants from saunerie import saltpath, salt2 from saunerie.stellarlibs import FilterSet, ALIGN_WITH_INTEG_FLUX lcs, log, model = example.main() for (i, lc) in enumerate(lcs): if i == 0: ret = np.array(np.lib.recfunctions.append_fields(lc.lc, ['phase', 'dL', 'z'], [lc.lc['mjd']-lc.sn['DayMax'], lc.sn['dL'], lc.sn['z']])) else: paquet = np.array(np.lib.recfunctions.append_fields(lc.lc, ['phase', 'dL', 'z'], [lc.lc['mjd']-lc.sn['DayMax'], lc.sn['dL'], lc.sn['z']])) ret = np.append(ret, paquet) if i % 100 == 0: print 'Data computed for %d supernovae' % i lambda_grid = np.linspace(2000, 8000, 300) phase_grid = np.linspace(-35, 70, 8) base = bspline.BSpline2D(lambda_grid, phase_grid, xorder=4, yoerde=4)
from example import main # GLOBALS phys_iterations = 1 fps_calculated = 60 running = True gravity = [0, -1000] delta = 0 debug = True size = [500, 500] fps = 60 n = 0 # Setup engine engine = pyEngine.Engine(size, gravity = gravity, iterations = phys_iterations, debug = debug, fps = fps) #scene = scene1(pyEngine.pygame, pyEngine.pymunk, engine.space, size) scene = main(pyEngine.pygame, pyEngine.pymunk, engine.space, size) engine.addScene(scene) engine.setCurrentScene(scene) while running: flag = engine.loop() if flag: running = False pyEngine.Engine.pygame.quit()