FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
phasecalculator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab has been upgraded. See what's new in the
Changelog
.
Show more breadcrumbs
Yusuf Hamied Department of Chemistry
Hunter Group
SSIPtools
SSIMPLEapps
phasecalculator
Commits
60e3ce79
Commit
60e3ce79
authored
5 years ago
by
Mark Driver
Browse files
Options
Downloads
Patches
Plain Diff
update documentation.
parent
31e2da19
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
phasecalculator/runners/phasecalculatorrunner.py
+88
-54
88 additions, 54 deletions
phasecalculator/runners/phasecalculatorrunner.py
phasecalculator/runners/similarityanalysisrunner.py
+21
-20
21 additions, 20 deletions
phasecalculator/runners/similarityanalysisrunner.py
with
109 additions
and
74 deletions
phasecalculator/runners/phasecalculatorrunner.py
+
88
−
54
View file @
60e3ce79
...
...
@@ -34,8 +34,23 @@ LOGGER.setLevel(logging.WARN)
def
run_all_analysis
(
system_info
,
**
kwargs
):
# TODO Logging output of analysis
"""
Generate required solvent and phase XML then run all relevant analysis.
Parameters
----------
system_info : System
System information.
output_filename : str, optional
output file location for similarity matrix. The default is
"
similaritymatrix.csv
"
.
memory_req : str, optional
Memory settings for jar executable. The default is None.
Returns
-------
None.
"""
phase_filename
,
solvent_list
=
create_phase_and_solvent_xml_files
(
system_info
,
**
kwargs
)
if
system_info
.
calc_vle
():
run_vle_analysis
(
system_info
,
phase_filename
,
**
kwargs
)
...
...
@@ -45,21 +60,26 @@ def run_all_analysis(system_info, **kwargs):
run_similarity_analysis
(
system_info
,
solvent_list
,
**
kwargs
)
def
run_fgip_analysis
(
system_info
,
solvent_filename_dict_list
,
**
kwargs
):
"""
"""
Run FGIP analysis.
Parameters
----------
system_info : TYPE
DESCRIPTION.
solvent_filename_dict_list : TYPE
DESCRIPTION.
**kwargs : TYPE
DESCRIPTION.
system_info : System
System information.
solvent_filename_dict_list : dict
dictionary of solvent filenames with temperature information.
output_filename : str, optional
output file location for similarity matrix. The default is
"
similaritymatrix.csv
"
.
memory_req : str, optional
Memory settings for jar executable. The default is None.
Returns
-------
None.
combined_results : list
combined results of FGIP generation.
combined_latex_blocks : str
combined latex blocks for figures.
"""
# TODO: for each solvent file/temp combo in dict
...
...
@@ -81,16 +101,19 @@ def run_fgip_analysis(system_info, solvent_filename_dict_list, **kwargs):
combined_latex_blocks
+=
latex_blocks
return
combined_results
,
combined_latex_blocks
def
run_similarity_analysis
(
system_info
,
solvent_filename_dict
,
**
kwargs
):
"""
"""
Run similarity analysis.
Parameters
----------
system_info : TYPE
DESCRIPTION.
solvent_filename_dict : TYPE
DESCRIPTION.
**kwargs : TYPE
DESCRIPTION.
system_info : System
System information.
solvent_filename_dict : dict
dictionary of solvent filenames with temperature information.
output_filename : str, optional
output file location for similarity matrix. The default is
"
similaritymatrix.csv
"
.
memory_req : str, optional
Memory settings for jar executable. The default is None.
Returns
-------
...
...
@@ -115,25 +138,30 @@ def run_similarity_analysis(system_info, solvent_filename_dict, **kwargs):
output_type
=
system_info
.
output_information
.
similarity_output_type
out_res
,
poly_filename_list
=
simrun
.
extract_all_solvents_and_generate_polynomials
(
solvent_filename_dict_list
,
output_dir
)
simrun
.
run_similarity_analysis
(
poly_filename_list
,
output_type
,
output_dir
)
#
simrun
.
run_similarity_analysis
(
poly_filename_list
,
output_type
,
output_dir
,
**
kwargs
)
def
run_vle_analysis
(
system_info
,
phase_filename
,
**
kwargs
):
"""
"""
Run VLE phase calculation.
Parameters
----------
system_info : TYPE
DESCRIPTION.
phase_filename : TYPE
DESCRIPTION.
**kwargs : TYPE
DESCRIPTION.
system_info : System
System information.
phase_filename : str
Filename for phase XML.
memory_req : str, optional
Memory settings for jar executable. The default is None.
Raises
------
FileNotFoundError
If jar file is not found.
Returns
-------
TYPE
DESCRIPTION
.
CompletedProcess
result of system call
.
"""
jar_path
=
system_info
.
runtime_information
.
phasetransfer_jar
...
...
@@ -158,32 +186,32 @@ def create_output_dir(system_info):
return
output_path
.
as_posix
()
def
create_free_energy_output_filename
(
solvent_filename
):
"""
"""
Create free energy filename for solvent file.
Parameters
----------
solvent_filename :
TYPE
DESCRIPTION
.
solvent_filename :
str
Input solvent filename
.
Returns
-------
TYPE
DESCRIPTION
.
str
Output energy filename
.
"""
return
solvent_filename
.
replace
(
"
.xml
"
,
"
free.xml
"
)
def
create_binding_energy_output_filename
(
solvent_filename
):
"""
"""
Create binding energy filename for solvent file.
Parameters
----------
solvent_filename :
TYPE
DESCRIPTION
.
solvent_filename :
str
Input solvent filename
.
Returns
-------
TYPE
DESCRIPTION
.
str
Output energy filename
.
"""
return
solvent_filename
.
replace
(
"
.xml
"
,
"
binding.xml
"
)
...
...
@@ -192,35 +220,41 @@ def create_phase_output_filename(phase_filename):
Parameters
----------
phase_filename :
TYPE
DESCRIPTION
.
phase_filename :
str
Input phase filename
.
Returns
-------
TYPE
DESCRIPTION
.
str
phase output filename
.
"""
return
phase_filename
.
replace
(
"
.xml
"
,
"
calculated.xml
"
)
def
create_phase_and_solvent_xml_files
(
system_info
,
**
kwargs
):
"""
"""
Create solvent and phase files for given system.
Parameters
----------
system_info : TYPE
DESCRIPTION.
filestem : TYPE, optional
DESCRIPTION. The default is
"
system
"
.
**kwargs : TYPE
DESCRIPTION.
system_info : System
System object.
filestem : str, optional
filename stem. The default is
"
system
"
.
solvent_info_filename : str, optional
Filename for file containing solvent information. Defaults to file in
phasexmlcreator module.
name_inchikey_map : dict, optional
inchikey: name pairs. Defaults to names of solvents in pureinformation
module.
Returns
-------
phase_file : TYPE
DESCRIPTION.
solvent_list : TYPE
DESCRIPTION.
phase_file : str
Phase filename.
solvent_list : list of dict
List of dictionaries containing solvent filename and temperature information.
"""
return
phasexmlrun
.
create_phase_and_solvent_files
(
system_info
,
**
kwargs
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
phasecalculator/runners/similarityanalysisrunner.py
+
21
−
20
View file @
60e3ce79
...
...
@@ -32,18 +32,19 @@ LOGGER = logging.getLogger(__name__)
LOGGER
.
setLevel
(
logging
.
WARN
)
def
run_similarity_analysis
(
poly_filename_list
,
output_type
,
output_dir
,
output_filename
=
"
similaritymatrix.csv
"
):
"""
"""
Run similarity analysis.
Parameters
----------
poly_filename_list : TYPE
DESCRIPTION.
output_type : TYPE
DESCRIPTION.
output_dir : TYPE
DESCRIPTION.
output_filename : TYPE, optional
DESCRIPTION. The default is
"
similaritymatrix.csv
"
.
poly_filename_list : list of str
list of polynomial filenames.
output_type : str
Output type. Three options:
"
all
"
,
"
mixturecomparison
"
or
"
purecomparison
"
.
output_dir : str
output directory for results.
output_filename : str, optional
output file location for similarity matrix. The default is
"
similaritymatrix.csv
"
.
Returns
-------
...
...
@@ -59,21 +60,21 @@ def run_similarity_analysis(poly_filename_list, output_type, output_dir, output_
def
extract_all_solvents_and_generate_polynomials
(
solv_energy_dict_list
,
directory_base
):
"""
"""
Extract results for all solvents, and partition results based on temperature.
Parameters
----------
solv_energy_dict_list :
TYPE
DESCRIPTION
.
directory_base :
TYPE
DESCRIPTION
.
solv_energy_dict_list :
list of dicts
Solvation energy files
.
directory_base :
str
Base output directory
.
Returns
-------
combined_out_res :
TYPE
DESCRIPTION
.
combined_filename_list :
TYPE
DESCRIPTION
.
combined_out_res :
list
List of polynomial generation results
.
combined_filename_list :
list of str
Polynomial filename list
.
"""
combined_out_res
=
[]
...
...
@@ -120,8 +121,8 @@ def extract_solvents_and_generate_polynomials(solvent_filename, energy_xml_filen
----------
solvent_filename : str
filename for solvent XML.
energy_xml_filename :
TYPE
DESCRIPTION
.
energy_xml_filename :
str
energy XML filename
.
directory : str
Directory to put files.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment