-
Notifications
You must be signed in to change notification settings - Fork 176
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
Support several CALYPSO run in different pressure in one iteration #814
Conversation
Merge 'calypso' from origin into 'calypso'
- rename model_devi_calypso.py run_calypso.py - rename calypso.py make_calypso.py - add new file calypso_check_outcar.py calypso_run_opt.py - add new file calypso_run_model_devi.py - delete write_modd.py - modify README.md and run.py
…fy test_calypso.py
… fix bug in runopt script
Conflicts: .gitignore README.md dpgen/generator/lib/make_calypso.py dpgen/generator/lib/run_calypso.py dpgen/generator/run.py tests/generator/test_calypso.py
Codecov Report
@@ Coverage Diff @@
## devel #814 +/- ##
==========================================
+ Coverage 35.16% 36.01% +0.85%
==========================================
Files 96 97 +1
Lines 16817 17227 +410
==========================================
+ Hits 5913 6204 +291
- Misses 10904 11023 +119
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
.gitignore
Outdated
@@ -41,4 +41,4 @@ dbconfig.json | |||
.idea/* | |||
_build | |||
tests/generator/calypso_test_path | |||
doc/api/ | |||
doc/api/ |
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.
please do not remove the '\n' at the end of the file
dpgen/generator/lib/make_calypso.py
Outdated
@@ -53,8 +54,8 @@ def make_calypso_input(nameofatoms,numberofatoms, | |||
ret+= "# 0 combination of all method\n" | |||
ret+= "# If GenType=3 or 4, it determined the small unit to grow the whole structure\n" | |||
ret+= "# It determines which local optimization method should be interfaced in the simulation.\n" | |||
assert icode != None or type(icode) == type([0,1]) or type(icode[0]) == type(0) | |||
ret+= "ICode= %d\n"%(icode[0]) | |||
assert icode != None or type(icode) == type(0) |
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.
shouldn't be and
? If you want all the conditions are satisfied.
I would recommend changing it to assert icode is not None and type(icode) is int
dpgen/generator/lib/make_calypso.py
Outdated
ret+= "PSTRESS = %f\n"%(pstress[0]) | ||
assert fmax != None or type(fmax) == type([200]) | ||
ret+= "fmax = %f\n"%(fmax[0]) | ||
assert pstress != None or type(pstress) == type(200) or type(pstress) == type(0.001) |
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.
similar issue
dpgen/generator/lib/make_calypso.py
Outdated
@@ -95,18 +96,19 @@ def make_calypso_input(nameofatoms,numberofatoms, | |||
ret+= "###################End Parameters for VSC ##########################\n" | |||
return ret | |||
|
|||
def _make_model_devi_buffet(jdata,calypso_run_opt_path): | |||
def _make_model_devi_buffet(jdata,caly_run_opt_path): |
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.
I would prefer the original variable name, which is self-explanatory to the readers. It is not easy to relate caly
to calypso
...
dpgen/generator/run.py
Outdated
if run_mode == 1: | ||
caly_run_opt_path.append('%s.%03d'%(_calypso_run_opt_path, 0)) | ||
elif run_mode == 2: |
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.
add a comment explaining what does the run_modes mean?
dpgen/generator/lib/run_calypso.py
Outdated
print('too little confs, ') | ||
return | ||
dlog.info('too little confs, ') | ||
sys.exit() |
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.
Use raise
instead
…tion now can support both kit v2.0 and kit v2.1
dpgen/generator/run.py
Outdated
check_outcar_script = os.path.join(calypso_run_opt_path,'check_outcar.py') | ||
shutil.copyfile(check_outcar_file,check_outcar_script) | ||
# Create work path list | ||
caly_run_opt_path = [] |
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.
caly_run_opt_path = [] | |
calypso_run_opt_path = [] |
To improve the readability of the code
Could you please merge the devel branch to fix the bug in UT? Thanks! |
Support several CALYPSO run in different pressure in one iteration:
One can do this by changing
model_devi_jobs
intothe
PSTRESS
is aList
which can contain several different pressure and the number of CALYPSO Loop is same as the length ofPSTRESS
in one iterationhere is picture of this situation
the
times
is aList
which can be seen as a collection ofiter number
, in this example"times":[4, 5]
means iter.000004 and iter.000005 will run the same CALYPSO Loop