From 9367ec8f1399c5e552fa57170b5188996c82cecf Mon Sep 17 00:00:00 2001 From: Pavel Dmitriev Date: Thu, 10 Mar 2016 09:57:31 +0800 Subject: [PATCH] refactor --- PyTMM/tests/yaml_tests.py | 58 --------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 PyTMM/tests/yaml_tests.py diff --git a/PyTMM/tests/yaml_tests.py b/PyTMM/tests/yaml_tests.py deleted file mode 100644 index 4378a68..0000000 --- a/PyTMM/tests/yaml_tests.py +++ /dev/null @@ -1,58 +0,0 @@ -# This file is part of PyTMM. -# -# PyTMM is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# PyTMM is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Foobar. If not, see . -# -# -# Copyright 2014-2015 Pavel Dmitriev - -from pytmm.refractiveIndex import * - -# catalog = RefractiveIndex("../RefractiveIndex") -catalog = RefractiveIndex() -mat = catalog.getMaterial('other', 'pmma_resists', 'Microchem495') -print(mat.getRefractiveIndex(500)) -# f = open('Hass.yml') -# a = yaml.safe_load(f) -# f.close() -# print(a) - -# print(mat.getExtincionCoefficient(500)) - - -# -# Iterate the shit out of the catalog -# -i = 0 -for sh in catalog.catalog: - for b in sh['content']: - if 'DIVIDER' not in b: - for p in b['content']: - if 'DIVIDER' not in p: - try: - mat = catalog.getMaterial(sh['SHELF'], b['BOOK'], p['PAGE']) - a = mat.getRefractiveIndex( - (mat.refractiveIndex.rangeMin + mat.refractiveIndex.rangeMax) * 1000.0 / 2) - # b = mat.getExtinctionCoefficient((mat.extinctionCoefficient.rangeMin - # + mat.extinctionCoefficient.rangeMax)*1000.0/2) - except FormulaNotImplemented: - pass - except NoExtinctionCoefficient: - pass - except (Exception, NotImplementedError) as inst: - print("caught exception in {}".format(p['path'])) - print(inst) - i += 1 - pass - -print('Caught {} exceptions while parsing catalog'.format(i))