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

testing input equallity #121

Closed
wants to merge 11 commits into from
Closed

testing input equallity #121

wants to merge 11 commits into from

Conversation

setten
Copy link
Member

@setten setten commented Mar 24, 2017

No description provided.

setten added 4 commits March 23, 2017 16:50
length, integers and and floats implemented:

AssertionError: Two inputs were found to be not equal:
   not even the same length .. 18 is not 19
     [] were found in ref but not in actual
     [u'kptopt'] were found in actual but not in ref

   var nshiftk differs: 5 (reference) != 1 (actual)
   var charge differs: 0.01 (reference) != 0.0 (actual)
input equallity
flat_var.append(o)
return flat_var

with open(ref_file) as fp:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a problem with the pseudos more specifically with the value of pseudo.filepath stored
in json file that is actually the absolute path used on your machine. See https://travis-ci.org/abinit/abipy/jobs/214653916

You have to preprocess the dictionary returned by json, in particular the entries
with the pseudopotential paths: extract the pseudo_basename from the string and then use:

pseudo_path = os.path.join(abidata.dirpath, "pseudos", pseudo_basename)

@setten
Copy link
Member Author

setten commented Mar 24, 2017 via email

@setten
Copy link
Member Author

setten commented Mar 24, 2017 via email

gmatteo and others added 6 commits March 24, 2017 19:12
@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 63.064% when pulling c8562e8 on setten:master into df32f83 on abinit:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 63.064% when pulling c8562e8 on setten:master into df32f83 on abinit:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 63.064% when pulling c8562e8 on setten:master into df32f83 on abinit:master.

@gmatteo
Copy link
Member

gmatteo commented Mar 25, 2017

ERROR: Testing g0w0_convergence_input factory single calculation.

Traceback (most recent call last):
File "/home/travis/build/abinit/abipy/abipy/abio/tests/test_factories.py", line 122, in test_convergence_inputs_single
self.assert_input_equallity(ref_file, inputs[int(t[0])][int(t[1])])
File "/home/travis/build/abinit/abipy/abipy/core/testing.py", line 326, in assert_input_equallity
input_equality_check(ref_file, input_to_test, rtol=rtol, atol=atol, equal_nan=equal_nan)
File "/home/travis/build/abinit/abipy/abipy/core/testing.py", line 211, in input_equality_check
error = error or check_var(val_list_t[k], val_list_r[k])
File "/home/travis/build/abinit/abipy/abipy/core/testing.py", line 171, in check_var
elif isinstance(v, (str, unicode)):
NameError: name 'unicode' is not defined

unicode is gone in py3k.

Replace the test with duck typing test:

from monty.string import is_string

or:

oxplot/fysom#1

if you prefer the isinstance approach

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 63.062% when pulling 0e31554 on setten:master into df32f83 on abinit:master.

@setten setten closed this Mar 27, 2017
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

Successfully merging this pull request may close these issues.

3 participants