Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python test fail #28

Open
WJiangH opened this issue Mar 7, 2022 · 0 comments
Open

python test fail #28

WJiangH opened this issue Mar 7, 2022 · 0 comments

Comments

@WJiangH
Copy link

WJiangH commented Mar 7, 2022

I am compiling with CentOS, gcc/7.3.0, and python 2.7.18. there are some errors. Is there specific requirements for python version?

raceback (most recent call last):
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/unittest/KMCLibTest/Analysis/OnTheFlyMSDTest.py", line 568, in testPrintResults
msd.printResults(stream)
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/Analysis/OnTheFlyMSD.py", line 288, in printResults
stream.write("%11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s %11s\n"%("TIME ", "MSD_x ", "MSD_y ", "MSD_z ", "MSD_xy ", "MSD_xz ", "MSD_yz ", "MSD_xyz ", "STD_x ", "STD_y ", "STD_z ", "STD_xy ", "STD_xz ", "STD_yz ", "STD_xyz ", "N_eff"))
TypeError: unicode argument expected, got 'str'

======================================================================
ERROR: testPrintResults (KMCLibTest.Analysis.TimeStepDistributionTest.TimeStepDistributionTest)
Test the time step distribution print result function.

Traceback (most recent call last):
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/unittest/KMCLibTest/Analysis/TimeStepDistributionTest.py", line 139, in testPrintResults
tsd.printResults(stream)
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/Analysis/TimeStepDistribution.py", line 108, in printResults
stream.write("%10.5f %10i %20.15f\n"%(t, v, n))
TypeError: unicode argument expected, got 'str'

======================================================================
ERROR: testPrintResults (KMCLibTest.Analysis.ProcessStatisticsTest.ProcessStatisticsTest)
Test that we can print the results

Traceback (most recent call last):
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/unittest/KMCLibTest/Analysis/ProcessStatisticsTest.py", line 188, in testPrintResults
ps.printResults(stream)
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/Analysis/ProcessStatistics.py", line 102, in printResults
stream.write("%15s %15s %15s %12s\n"%(" time (t)", " count (n)", "(dn/dt) ", "(n/t)"))
TypeError: unicode argument expected, got 'str'

======================================================================
ERROR: testPrintResults (KMCLibTest.Analysis.CompositionTest.CompositionTest)
Test that we can print the results

Traceback (most recent call last):
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/unittest/KMCLibTest/Analysis/CompositionTest.py", line 215, in testPrintResults
cc.printResults(stream)
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/Analysis/Composition.py", line 97, in printResults
stream.write(format_str_1%tuple(types_str))
TypeError: unicode argument expected, got 'str'

======================================================================
ERROR: testRunInitialMatch (KMCLibTest.CoreComponents.KMCLatticeModelTest.KMCLatticeModelTest)
Test the output of initial matchinformation from a run of the A-B flip model.

Traceback (most recent call last):
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/unittest/KMCLibTest/CoreComponents/KMCLatticeModelTest.py", line 482, in testRunInitialMatch
ab_flip_model.run(control_parameters=control_parameters)
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/CoreComponents/KMCLatticeModel.py", line 125, in run
prettyPrint(msg)
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/Utilities/PrintUtilities.py", line 31, in prettyPrint
output.write(msg)
TypeError: unicode argument expected, got 'str'

======================================================================
ERROR: testPrettyPrint (KMCLibTest.Utilities.PrintUtilitiesTest.PrintUtilitiesTest)
Test that we can call the pretty print function.

Traceback (most recent call last):
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/unittest/KMCLibTest/Utilities/PrintUtilitiesTest.py", line 35, in testPrettyPrint
prettyPrint(ref_str)
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/Utilities/PrintUtilities.py", line 31, in prettyPrint
output.write(msg)
TypeError: unicode argument expected, got 'str'

======================================================================
ERROR: testPrintHeader (KMCLibTest.Utilities.PrintUtilitiesTest.PrintUtilitiesTest)
Test the print header function.

Traceback (most recent call last):
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/unittest/KMCLibTest/Utilities/PrintUtilitiesTest.py", line 71, in testPrintHeader
printHeader()
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/Utilities/PrintUtilities.py", line 46, in printHeader
prettyPrint("# -----------------------------------------------------------------------------", output)
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/src/KMCLib/Utilities/PrintUtilities.py", line 31, in prettyPrint
output.write(msg)
TypeError: unicode argument expected, got 'str'

======================================================================
FAIL: testScript (KMCLibTest.CoreComponents.KMCConfigurationTest.KMCConfigurationTest)
Test that we can generate a valid script.

Traceback (most recent call last):
File "/home/wenjiang0716/KMC_gcc_7.3.0/KMCLib/python/unittest/KMCLibTest/CoreComponents/KMCConfigurationTest.py", line 676, in testScript
self.assertEqual(script, ref_script)
AssertionError: "\n# -----------------------------------------------------------------------------\n# Unit cell\n\ncell_vectors = [[ 2.800000e+00, 0.000000e+00, 0.000000e+00],\n [ 0.000000e+00, 3.200000e+00, 0.000000e+00],\n [ 0.000000e+00, 5.000000e-01, 3.000000e+00]]\n\nbasis_points = [[ 0.000000e+00, 0.000000e+00, 0.000000e+00]]\n\nunit_cell = KMCUnitCell(\n cell_vectors=cell_vectors,\n basis_points=basis_points)\n\n# -----------------------------------------------------------------------------\n# Lattice\n\nlattice = KMCLattice(\n unit_cell=unit_cell,\n repetitions=(1,1,1),\n periodic=(False, False, False))\n\n# -----------------------------------------------------------------------------\n# Configuration\n\ntypes = ['ThisIsTheTypeOfMyOnlySiteInThisUnrealisticallyShortStructure']\n\npossible_types = ['A','CDEFGHI','ThisIsTheTypeOfMyOnlySiteInThisUnrealisticallyShortStructure',\n 'B']\n\nconfig = KMCConfiguration(\n lattice=lattice,\n types=types,\n possible_types=possible_types)\n" != "\n# -----------------------------------------------------------------------------\n# Unit cell\n\ncell_vectors = [[ 2.800000e+00, 0.000000e+00, 0.000000e+00],\n [ 0.000000e+00, 3.200000e+00, 0.000000e+00],\n [ 0.000000e+00, 5.000000e-01, 3.000000e+00]]\n\nbasis_points = [[ 0.000000e+00, 0.000000e+00, 0.000000e+00]]\n\nunit_cell = KMCUnitCell(\n cell_vectors=cell_vectors,\n basis_points=basis_points)\n\n# -----------------------------------------------------------------------------\n# Lattice\n\nlattice = KMCLattice(\n unit_cell=unit_cell,\n repetitions=(1,1,1),\n periodic=(False, False, False))\n\n# -----------------------------------------------------------------------------\n# Configuration\n\ntypes = ['ThisIsTheTypeOfMyOnlySiteInThisUnrealisticallyShortStructure']\n\npossible_types = ['ThisIsTheTypeOfMyOnlySiteInThisUnrealisticallyShortStructure',\n 'A','B','CDEFGHI']\n\nconfig = KMCConfiguration(\n lattice=lattice,\n types=types,\n possible_types=possible_types)\n"


Ran 190 tests in 5.015s

FAILED (failures=1, errors=7)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant