Best Python code snippet using fMBT_python
gaussian_tools.py
Source: gaussian_tools.py
...20 return self._Energy21 @property22 def intCoords(self):23 if self._intCoords is None:24 self._intCoords = self.get_intCoords()25 return self._intCoords26 def get_Ens(self):27 energy_array = []28 for f in self.log_files:29 with GI.GaussianLogReader(f) as reader:30 parse = reader.parse("OptimizedScanEnergies")31 temp_energy_array, temp_coords = parse["OptimizedScanEnergies"]32 if np.any(energy_array):33 energy_array = np.append(energy_array, temp_energy_array)34 else:35 energy_array = copy.deepcopy(temp_energy_array)36 return energy_array37 def get_intCoords(self):38 coords = {}39 for f in self.log_files:40 with GI.GaussianLogReader(f) as reader:41 parse = reader.parse("OptimizedScanEnergies")42 temp_energy_array, temp_coords = parse["OptimizedScanEnergies"]43 if coords:44 for key in coords.keys():45 coords[key] = np.append(coords[key],temp_coords[key])46 else:47 coords = copy.deepcopy(temp_coords)48 return coords49class GLogPlotter:50 def __init__(self, files):51 self.files = files...
gaussian_tools-checkpoint.py
Source: gaussian_tools-checkpoint.py
...20 return self._Energy21 @property22 def intCoords(self):23 if self._intCoords is None:24 self._intCoords = self.get_intCoords()25 return self._intCoords26 def get_Ens(self):27 energy_array = []28 for f in self.log_files:29 with GI.GaussianLogReader(f) as reader:30 parse = reader.parse("OptimizedScanEnergies")31 temp_energy_array, temp_coords = parse["OptimizedScanEnergies"]32 if np.any(energy_array):33 energy_array = np.append(energy_array, temp_energy_array)34 else:35 energy_array = copy.deepcopy(temp_energy_array)36 return energy_array37 def get_intCoords(self):38 coords = {}39 for f in self.log_files:40 with GI.GaussianLogReader(f) as reader:41 parse = reader.parse("OptimizedScanEnergies")42 temp_energy_array, temp_coords = parse["OptimizedScanEnergies"]43 if coords:44 for key in coords.keys():45 coords[key] = np.append(coords[key],temp_coords[key])46 else:47 coords = copy.deepcopy(temp_coords)48 return coords49class GLogPlotter:50 def __init__(self, files):51 self.files = files...
matcher4fmbt.py
Source: matcher4fmbt.py
...17'''18import fmbtgti19import MatcherWrapper20def _area2searcharea(screenshot, area):21 top, left = fmbtgti._intCoords(area[:2], screenshot.size())22 bottom, right = fmbtgti._intCoords(area[2:], screenshot.size())23 return (top, left, bottom, right)24def _resultbbox2bbox(resultbbox):25 return (resultbbox.x,26 resultbbox.y,27 resultbbox.x + resultbbox.width,28 resultbbox.y + resultbbox.height)29class MatcherOcrEngine(fmbtgti.OcrEngine):30 """31 OCR engine specific parameters, can be used in all32 ...OcrText() methods:33 match (float, optional):34 minimum match score in range [0.0, 1.0].35 The default is 1.0 (exact match).36 area ((left, top, right, bottom), optional):37 search from the given area only. Left, top38 right and bottom are either absolute coordinates39 (integers) or floats in range [0.0, 1.0]. In the40 latter case they are scaled to screenshot41 dimensions. The default is (0.0, 0.0, 1.0, 1.0),42 that is, search everywhere in the screenshot.43 """44 def __init__(self, *args, **kwargs):45 fmbtgti.OcrEngine.__init__(self, *args, **kwargs)46 mconfig = MatcherWrapper.MatcherConfig(useOCR = True, useOIR = False)47 self._matcher = MatcherWrapper.Matcher(mconfig)48 def _addScreenshot(self, screenshot, **neverMindDefaults):49 self._matcher.loadImage(screenshot.filename())50 def _removeScreenshot(self, screenshot):51 self._matcher.unloadImage(screenshot.filename())52 def _findText(self, screenshot, text, match=1.0, area=(0.0, 0.0, 1.0, 1.0)):53 top, left = fmbtgti._intCoords(area[:2], screenshot.size())54 bottom, right = fmbtgti._intCoords(area[2:], screenshot.size())55 threshold = int(match*100)56 result = self._matcher.match(57 screenshot = screenshot.filename(),58 icon = text,59 threshold = threshold,60 method = "OCR",61 searcharea = _area2searcharea(screenshot, area),62 resultimage = "")63 if result.result[0]/100.0 < match:64 return []65 else:66 return [fmbtgti.GUIItem(67 "OCR text",68 _resultbbox2bbox(result.bbox[0]),...
Check out the latest blogs from LambdaTest on this topic:
Collecting and examining data from multiple sources can be a tedious process. The digital world is constantly evolving. To stay competitive in this fast-paced environment, businesses must frequently test their products and services. While it’s easy to collect raw data from multiple sources, it’s far more complex to interpret it properly.
Hola Testers! Hope you all had a great Thanksgiving weekend! To make this time more memorable, we at LambdaTest have something to offer you as a token of appreciation.
When I started writing tests with Cypress, I was always going to use the user interface to interact and change the application’s state when running tests.
So, now that the first installment of this two fold article has been published (hence you might have an idea of what Agile Testing is not in my opinion), I’ve started feeling the pressure to explain what Agile Testing actually means to me.
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!!