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

nexus: better guard for structure file and internal consistency #262

Merged
merged 1 commit into from
Jun 12, 2017

Conversation

jtkrogel
Copy link
Contributor

Add a better guard to alert the user against missing structure files (per prckent's comment on #219 ). Also put checks in place to ensure the internal consistency of physical system objects (checked when physical system is passed to a simulation). This prevents Nexus from running a simulation when the user has corrupted a physical system object.

Other changes:

  1. Small fix for homonuclear reduced mass for a Morse potential
  2. Added complete pwscf functional list. Warning generated for unrecognized functional, vdW_kernel_table file demanded for vdW functionals.

@qmc-robot
Copy link

Can one of the maintainers verify this patch?

1 similar comment
@qmc-robot
Copy link

Can one of the maintainers verify this patch?

@prckent
Copy link
Contributor

prckent commented Jun 12, 2017

ok to test

@@ -766,6 +766,26 @@ def __init__(self,axes=None,scale=1.,elem=None,pos=None,mag=None,
#end def __init__


def check_consistent(self,tol=1e-8,exit=True,message=False):
Copy link
Contributor

Choose a reason for hiding this comment

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

The 'message' flag doesn't seem necessary, and could be removed to simplify the function. The function can always return (consistent,msg). If the caller doesn't want the message, it can ignore it (a single underscore is a valid variable name, so it's often used to represent an unwanted return value, giving something like "consistent, _ = self.systemcheck_consistent(exit=False)"

Similarly for check_folded_system.

Copy link
Contributor Author

@jtkrogel jtkrogel Jun 12, 2017

Choose a reason for hiding this comment

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

This is true, but it can help the UI. The "message" part is only really relevant to a message reporting system; most of the time someone writing a nexus user script will use s.check_consistent(), or "if s.check_consistent(exit=False): ...". There are a few user facing functions elsewhere in nexus that allow variable output lists depending on user request.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. I didn't realize this was a user-facing function, but that makes sense.

@markdewing markdewing merged commit ef1451c into QMCPACK:develop Jun 12, 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.

4 participants