diff --git a/hexrd/core/instrument/hedm_instrument.py b/hexrd/core/instrument/hedm_instrument.py index 78d7de323..162f58eef 100644 --- a/hexrd/core/instrument/hedm_instrument.py +++ b/hexrd/core/instrument/hedm_instrument.py @@ -2245,7 +2245,7 @@ def __init__(self, filename): self.fid = filename else: self.fid = open(filename, 'w') - print(self._header, file=self.fid) + logger.info(self._header, file=self.fid) def __del__(self): self.close() @@ -2282,7 +2282,7 @@ def dump_patch( self._delim.join(np.tile('{:<23.16e}', 10)).format(*res[7:]), ] ) - print(output_str, file=self.fid) + logger.info(output_str, file=self.fid) return output_str @@ -2337,7 +2337,7 @@ def __init__(self, filename=None, array=None): self.fid = filename else: self.fid = open(filename, 'w') - print(self._header, file=self.fid) + logger.info(self._header, file=self.fid) def __del__(self): self.close() @@ -2373,7 +2373,7 @@ def dump_grain(self, grain_id, completeness, chisq, grain_params): self._delim.join(np.tile('{:<23.16e}', len(res) - 3)).format(*res[3:]), ] ) - print(output_str, file=self.fid) + logger.info(output_str, file=self.fid) return output_str diff --git a/hexrd/core/material/material.py b/hexrd/core/material/material.py index 587178317..656068474 100644 --- a/hexrd/core/material/material.py +++ b/hexrd/core/material/material.py @@ -1562,26 +1562,3 @@ def get_hkl_strings(pdata): 'return_indices': True, } return np.intersect1d(**kwargs)[1:] - - -# -# ============================== Executable section for testing -# - - -if __name__ == '__main__': - # - # For testing - # - import sys - - if len(sys.argv) == 1: - print("need argument: materials.cfg") - sys.exit() - - ml = loadMaterialList(sys.argv[1]) - - print('MATERIAL LIST\n') - print((' from file: ', sys.argv[1])) - for m in ml: - print(m) diff --git a/hexrd/core/material/symbols.py b/hexrd/core/material/symbols.py index cbaf9e653..4f83d80fd 100644 --- a/hexrd/core/material/symbols.py +++ b/hexrd/core/material/symbols.py @@ -222,11 +222,12 @@ def PrintPossibleSG(xtal_sys): for i in range(sgmin, sgmax + 1): j = i - sgmin + 1 - pstr = f'{i}:{pstr_spacegroup[i - 1]}\t' + pstr = f"{i}:{pstr_spacegroup[i - 1]}\t" + line += pstr + if j % 4 == 0 or j == sgmax: - print(pstr) - else: - print(pstr, end='') + logger.info(line.rstrip()) + line = "" return sgmin, sgmax diff --git a/hexrd/core/valunits.py b/hexrd/core/valunits.py index f2d5f6be4..1eaf02894 100644 --- a/hexrd/core/valunits.py +++ b/hexrd/core/valunits.py @@ -34,7 +34,6 @@ """ -import doctest import math import numpy as np @@ -308,31 +307,3 @@ def _degrees(x: float) -> valWUnit: # Function alias _angstroms = _angstrom - -if __name__ == '__main__': # pragma: no cover - # - # doc testing - # - print("running doctest") - doctest.testmod() - - # - # other tests - # - def testConversions(): - print('===== Testing unit conversions ...') - print('..... angles:') - v = valWUnit('180d', 'angle', 180.0, 'degrees') - print(v) - print((' in degrees:', v.getVal('degrees'))) - print((' in radians: ', v.getVal('radians'))) - - print('..... lengths:') - ulist = ['m', 'mm', 'meter', 'angstrom'] - v = valWUnit('one meter', 'length', 1.0, 'meter') - print(v) - for u in ulist: - print((' in ', u, ': ', v.getVal(u))) - return - - testConversions() diff --git a/scripts/install/install_build_dependencies.py b/scripts/install/install_build_dependencies.py index 632855c22..4ff4d4e68 100755 --- a/scripts/install/install_build_dependencies.py +++ b/scripts/install/install_build_dependencies.py @@ -183,5 +183,4 @@ def install(library, destination): library = sys.argv[1] destination = sys.argv[2] - print(f'Installing "{library}" to "{destination}"') install(library, destination) diff --git a/tests/fit_grains_check.py b/tests/fit_grains_check.py index e74502bbd..7a27187aa 100755 --- a/tests/fit_grains_check.py +++ b/tests/fit_grains_check.py @@ -138,7 +138,3 @@ def compare_grain_fits( ctol=ctol, vtol=vtol, ) - if cresult: - print("test passed") - else: - print("test failed")