-
Notifications
You must be signed in to change notification settings - Fork 98
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
Conversation
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
abipy/core/testing.py
Outdated
flat_var.append(o) | ||
return flat_var | ||
|
||
with open(ref_file) as fp: |
There was a problem hiding this comment.
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)
I’ll try to make a hack, I use a pseudo from the abipy pseudo directory but someone programmed that the file paths are made absolute ….
… On 24 Mar 2017, at 15:23, gmatteo ***@***.***> wrote:
@gmatteo commented on this pull request.
In abipy/core/testing.py <#121 (comment)>:
> + _error = check_float(v, w)
+ elif isinstance(v, (str, unicode)):
+ _error = check_str(v, w)
+ return _error
+
+ def flatten_var(o, tree_types=(list, tuple, numpy.ndarray)):
+ flat_var = []
+ if isinstance(o, tree_types):
+ for value in o:
+ for sub_value in flatten_var(value, tree_types):
+ flat_var.append(sub_value)
+ else:
+ flat_var.append(o)
+ return flat_var
+
+ with open(ref_file) as fp:
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 <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)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#121 (review)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AF0i-IsZo8ppLdnbf5HjLtncFwZBnQ-Tks5ro9HXgaJpZM4MoSQf>.
|
this is really difficult….
… On 24 Mar 2017, at 18:11, Michiel van Setten ***@***.***> wrote:
I’ll try to make a hack, I use a pseudo from the abipy pseudo directory but someone programmed that the file paths are made absolute ….
> On 24 Mar 2017, at 15:23, gmatteo ***@***.*** ***@***.***>> wrote:
>
> @gmatteo commented on this pull request.
>
> In abipy/core/testing.py <#121 (comment)>:
>
> > + _error = check_float(v, w)
> + elif isinstance(v, (str, unicode)):
> + _error = check_str(v, w)
> + return _error
> +
> + def flatten_var(o, tree_types=(list, tuple, numpy.ndarray)):
> + flat_var = []
> + if isinstance(o, tree_types):
> + for value in o:
> + for sub_value in flatten_var(value, tree_types):
> + flat_var.append(sub_value)
> + else:
> + flat_var.append(o)
> + return flat_var
> +
> + with open(ref_file) as fp:
> 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 <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)
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub <#121 (review)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AF0i-IsZo8ppLdnbf5HjLtncFwZBnQ-Tks5ro9HXgaJpZM4MoSQf>.
>
|
* 'master' of https://github.com/setten/abipy: finalizing the input equallity test testing testing tools input equallity testing equality of inputs, length, integers and and floats implemented:
ERROR: Testing g0w0_convergence_input factory single calculation.Traceback (most recent call last):
Replace the test with duck typing test: from monty.string import is_string or: if you prefer the |
No description provided.