FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
solventmapcreator
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
Show more breadcrumbs
Yusuf Hamied Department of Chemistry
Hunter Group
SSIPtools
SSIMPLEapps
solventmapcreator
Commits
b2450529
Commit
b2450529
authored
7 years ago
by
M.D. Driver
Browse files
Options
Downloads
Patches
Plain Diff
added method to get fractional occupancy by giving solvent id.
parent
54d59cb6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
solventmapcreator/io/solventxmlreader.py
+7
-0
7 additions, 0 deletions
solventmapcreator/io/solventxmlreader.py
solventmapcreator/test/iotest/solventxmlreadertest.py
+6
-0
6 additions, 0 deletions
solventmapcreator/test/iotest/solventxmlreadertest.py
with
13 additions
and
0 deletions
solventmapcreator/io/solventxmlreader.py
+
7
−
0
View file @
b2450529
...
...
@@ -23,6 +23,13 @@ PHASE_NAMESPACE_DICT = {"phase":"http://www-hunter.ch.cam.ac.uk/PhaseSchema",
IDEAL_MAX_SSIP_CONCENTRATION_MOLAR
=
300.0
def
get_fractional_occupancy_for_solvent
(
solvent_list_element
,
solvent_id
):
"""
This extracts the solvent XML, and calculates the fractional occupancy
contribution for the solvent.
"""
solvent_element
=
get_solvent_element_by_id
(
solvent_list_element
,
solvent_id
)
return
calculate_fractional_occupancy_for_solvent
(
solvent_element
)
def
calculate_fractional_occupancy_for_solvent
(
solvent_element
):
"""
This calculates the contribution to the fractional occupancy from the solvent.
"""
...
...
This diff is collapsed.
Click to expand it.
solventmapcreator/test/iotest/solventxmlreadertest.py
+
6
−
0
View file @
b2450529
...
...
@@ -31,6 +31,12 @@ class SolventXMLReaderTestCase(unittest.TestCase):
del
self
.
solvent_list_xml
del
self
.
water_solvent_element
del
self
.
water_molecule_element
def
test_get_fractional_occupancy_for_solvent
(
self
):
"""
Test to see if expected fractional occupancy is returned.
"""
expected_value
=
55.35
*
4.0
/
300.0
actual_value
=
solventxmlreader
.
get_fractional_occupancy_for_solvent
(
self
.
solvent_list_xml
,
"
water
"
)
self
.
assertAlmostEqual
(
expected_value
,
actual_value
)
def
test_calculate_fractional_occupancy_for_solvent
(
self
):
"""
Test to see if expected value is returned for the fractional
occupancy.
...
...
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