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
f2498c21
Commit
f2498c21
authored
7 years ago
by
M.D. Driver
Browse files
Options
Downloads
Patches
Plain Diff
formatting.
parent
a8db4998
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
solventmapcreator/test/clusteringanalysistest/clusterstatisticstest.py
+7
-6
7 additions, 6 deletions
...ator/test/clusteringanalysistest/clusterstatisticstest.py
with
7 additions
and
6 deletions
solventmapcreator/test/clusteringanalysistest/clusterstatisticstest.py
+
7
−
6
View file @
f2498c21
...
...
@@ -42,16 +42,16 @@ class ClusterStatisticsTestCase(unittest.TestCase):
def
test_calculate_max_dist
(
self
):
"""
Test to see if expected max dist matrix is produced.
"""
expected_matrix
=
np
.
array
([
17.
,
22.
,
28.
,
33.
])
expected_matrix
=
np
.
array
([
17.
,
22.
,
28.
,
33.
])
actual_matrix
=
clusterstatistics
.
calculate_max_dist
(
self
.
example_linkage_matrix
)
np
.
testing
.
assert_array_almost_equal
(
expected_matrix
,
actual_matrix
)
def
test_calculate_inconsistency
(
self
):
"""
Test to see if expected inconsistency matrix is returned.
"""
expected_matrix
=
np
.
array
([[
17.
,
0.
,
1.
,
0.
],
[
19.5
,
3.535534
,
2.
,
0.707107
],
[
28.
,
0.
,
1.
,
0.
],
[
27.666667
,
5.507571
,
3.
,
0.968364
]])
expected_matrix
=
np
.
array
([[
17.
,
0.
,
1.
,
0.
],
[
19.5
,
3.535534
,
2.
,
0.707107
],
[
28.
,
0.
,
1.
,
0.
],
[
27.666667
,
5.507571
,
3.
,
0.968364
]])
actual_matrix
=
clusterstatistics
.
calculate_inconsistency
(
self
.
example_linkage_matrix
)
np
.
testing
.
assert_array_almost_equal
(
expected_matrix
,
actual_matrix
)
def
test_calculate_cophenetic_distance
(
self
):
...
...
@@ -59,7 +59,8 @@ class ClusterStatisticsTestCase(unittest.TestCase):
returned as expected.
"""
expected_distance
=
0.73020316123580109
expected_matrix
=
np
.
array
([
17.
,
33.
,
33.
,
22.
,
33.
,
33.
,
22.
,
28.
,
33.
,
33.
])
expected_matrix
=
np
.
array
([
17.
,
33.
,
33.
,
22.
,
33.
,
33.
,
22.
,
28.
,
33.
,
33.
])
actual_distance
,
actual_matrix
=
clusterstatistics
.
calculate_cophenetic_distance
(
self
.
example_linkage_matrix
,
self
.
example_distance_matrix
)
self
.
assertAlmostEqual
(
expected_distance
,
actual_distance
)
...
...
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