Best Python code snippet using lisa_python
BuildViewer.py
Source: BuildViewer.py
1#!/usr/bin/env python2"""3A simple script that copies all the cubes and everything into the right places4This has not been well set up to work universally. It's only been tested on one setup5"""6import os, shutil7# from TAP_Setup import setup8def main(RootDir, TAPViewerPath, TAPViewerSource, MapFileName, CubesPath, Seasons):9 TAPViewerDir = os.path.join(RootDir, TAPViewerPath)10 #Check if TAP Viewer Dir exists:11 if not os.path.isdir(TAPViewerDir):12 print "making new TAP Viewer Directory"13 os.mkdir(TAPViewerDir)14 # copy the exe and settings files15 shutil.copy(os.path.join(TAPViewerSource,'TAP.exe'), TAPViewerDir)16 shutil.copy(os.path.join(TAPViewerSource,'SETTINGS.TAP'), TAPViewerDir)17 # Check for TAPDATA18 TAPDATADir = os.path.join(TAPViewerDir,"TAPDATA")19 if not os.path.isdir(TAPDATADir):20 print "Making TAPDATA Directory"21 os.mkdir(TAPDATADir)22 # copy the TAPCONFIG file23 shutil.copy(os.path.join(TAPViewerSource, "TAPDATA", "TAPCONFIG.txt"), TAPDATADir)24 # copy the site.txt file25 shutil.copy(os.path.join(RootDir,"site.txt"), TAPDATADir)26 shutil.copy(os.path.join(TAPViewerSource, MapFileName), TAPDATADir)27 # copy the start times file (not required, but it's good to have it there28 # print StartTimeFiles29 # for (filename, _) in StartTimeFiles:30 # shutil.copy(filename, TAPDATADir)31 FullCubesPath = os.path.join(RootDir, CubesPath) 32 for (season, junk) in Seasons:33 SeasonPath = os.path.join(TAPDATADir,season)34 if not os.path.isdir(SeasonPath):35 print "Creating:", SeasonPath36 os.mkdir(SeasonPath)37 SeasonCubesPath = os.path.join(FullCubesPath,season)38 print SeasonPath, SeasonCubesPath39 40 for name in os.listdir(SeasonCubesPath):41 print "Moving:", name42 shutil.move(os.path.join(SeasonCubesPath,name),43 os.path.join(SeasonPath,name) )44 # These steps are both useful for archiving your TAP project, but not needed for45 # the TAP viewer to work. 46 # copy the script and Setup_TAP files to viewer dir for archive47 # setfile = os.path.join(RootDir,'Setup_TAP.py')48 # shutil.copy(setfile, TAPViewerDir)49 # move Trajectories to TapViewer dir50 # shutil.move(setup.TrajectoriesPath, TAPViewerDir)51 52 # copy the start times file (not required, but it's good to have it there53 # print StartTimeFiles54 # for (filename, _) in StartTimeFiles:55 # shutil.copy(filename, TAPDATADir)56if __name__ == '__main__':57 import Setup_TAP as tap58 main(tap.RootDir, tap.CubesPath, tap.CubesRootNames, tap.CubeType, tap.CubeDataType,59 tap.Seasons, tap.TrajectoriesPath, tap.ReceptorType, tap.Grid, tap.OilWeatheringType,...
testSetup.py
Source: testSetup.py
1#!/usr/bin/env python2"""3A way to import a particular setup by only changing one thing4"""5# getting the root dir from the command line:6import sys, os7import datetime8import numpy as np9# get default paramaters10setup = __import__('Setup_TAP')11def getSetup():12 RootDir = os.path.abspath(__file__)13 if not os.path.exists(RootDir): 14 raise Exception("RootDir: %s Doesn't exist"%RootDir)15 sys.path.insert(0, RootDir) 16 setup = __import__('Setup_TAP')17 setup.RootDir = RootDir18 print setup19 return setup20def paramstest():21 class pp:22 pass23 # number of start times you want in each season:24 pp.NumStarts = 50025 # # Length of release in hours (0 for instantaneous)26 pp.ReleaseLength = 30 *24 # in hours27 # name of the GNOME script file to run28 pp.PyGnome_script = "script_ArcticTAP"29 # number of Lagrangian elements you want in the GNOME run30 pp.NumLEs = 1000...
Check out the latest blogs from LambdaTest on this topic:
Automating testing is a crucial step in the development pipeline of a software product. In an agile development environment, where there is continuous development, deployment, and maintenance of software products, automation testing ensures that the end software products delivered are error-free.
Before we discuss the Joomla testing, let us understand the fundamentals of Joomla and how this content management system allows you to create and maintain web-based applications or websites without having to write and implement complex coding requirements.
The QA testing career includes following an often long, winding road filled with fun, chaos, challenges, and complexity. Financially, the spectrum is broad and influenced by location, company type, company size, and the QA tester’s experience level. QA testing is a profitable, enjoyable, and thriving career choice.
It’s strange to hear someone declare, “This can’t be tested.” In reply, I contend that everything can be tested. However, one must be pleased with the outcome of testing, which might include failure, financial loss, or personal injury. Could anything be tested when a claim is made with this understanding?
When it comes to UI components, there are two versatile methods that we can use to build it for your website: either we can use prebuilt components from a well-known library or framework, or we can develop our UI components from scratch.
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!