From 6b2d47e28044971aa4b387d8d131ef30940d3b32 Mon Sep 17 00:00:00 2001
From: Mark Driver <mdd31@cam.ac.uk>
Date: Fri, 28 Jul 2017 09:49:03 +0100
Subject: [PATCH] update method to change x axis order for solvation maps, and
 update axis labels for solvation curve plotting, based on changes to
 Datapoint labels.

---
 .../solvationcalculation/solvationplotinformation.py        | 2 +-
 .../test/polynomialanalysistest/polynomialplottingtest.py   | 4 ++--
 .../solvationcalculationtest/solvationmapgeneratortest.py   | 4 ++--
 .../solvationplotinformationtest.py                         | 6 +++---
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/solventmapcreator/solvationcalculation/solvationplotinformation.py b/solventmapcreator/solvationcalculation/solvationplotinformation.py
index 9122ea9..0281a6e 100644
--- a/solventmapcreator/solvationcalculation/solvationplotinformation.py
+++ b/solventmapcreator/solvationcalculation/solvationplotinformation.py
@@ -37,7 +37,7 @@ def create_input_data_values(epsilon_i_list, epsilon_j_list, temperature, theta,
 def get_axis_range(epsilon_i_list, epsilon_j_list):
     """This gets the range of the values in the x and y data.
     """
-    return (epsilon_i_list.min(), epsilon_i_list.max(),
+    return (epsilon_i_list.max(), epsilon_i_list.min(),
             epsilon_j_list.min(), epsilon_j_list.max())
 
 def create_meshgrids(epsilon_i_list, epsilon_j_list):
diff --git a/solventmapcreator/test/polynomialanalysistest/polynomialplottingtest.py b/solventmapcreator/test/polynomialanalysistest/polynomialplottingtest.py
index 5b01f83..9c37b76 100644
--- a/solventmapcreator/test/polynomialanalysistest/polynomialplottingtest.py
+++ b/solventmapcreator/test/polynomialanalysistest/polynomialplottingtest.py
@@ -46,7 +46,7 @@ class PolynomialPlottingTestCase(unittest.TestCase):
                          'x_axis_range':[-15.4, 7.2000000000000002],
                          'x_data': np.array([[-0.1, -11.1, -14.1, -15.4, -2.4,
                                               -4.3, -5.4, -9.1, 0.5, 1.2, 7.2]]),
-                         'x_label': "ssip",
+                         'x_label': "SSIP Value",
                          'y_axis_range': [-38.635444,   0.918583],
                          'y_data': np.array([[0.9185830776018105, -26.013780093398356,
                                               -34.8195308084233, -38.635444108544405,
@@ -54,7 +54,7 @@ class PolynomialPlottingTestCase(unittest.TestCase):
                                               -9.315464914185585, -20.143787975013183,
                                               0.6588682955012527, -0.4429837300591526,
                                               -25.844114335864262]]),
-                         'y_label': "/$kJmol^{-1}$"}
+                         'y_label': "Solvation Energy/$kJmol^{-1}$"}
         actual_dict = polynomialplotting.parse_energies_create_plot_input_data("resources/water.xml", 4)
         LOGGER.debug(actual_dict["x_data"].tolist())
         LOGGER.debug(actual_dict["y_data"].tolist())
diff --git a/solventmapcreator/test/solvationcalculationtest/solvationmapgeneratortest.py b/solventmapcreator/test/solvationcalculationtest/solvationmapgeneratortest.py
index 931fccd..40ba555 100644
--- a/solventmapcreator/test/solvationcalculationtest/solvationmapgeneratortest.py
+++ b/solventmapcreator/test/solvationcalculationtest/solvationmapgeneratortest.py
@@ -43,7 +43,7 @@ class SolvationMapGeneratorTestCase(unittest.TestCase):
                                             [-3.46086, -1.671915],
                                             [-2.389432,  0.06058]]),
                          "x_label":"$\\beta$", "y_label":"$\\alpha$",
-                         "plot_axis_range":(0.0, 2.0, 0.0, 1.0),
+                         "plot_axis_range":(2.0, 0.0, 0.0, 1.0),
                          "figure_label":"water_solv_map"}
         actual_dict = solvationmapgenerator.create_plot_input_data_from_files(self.epsilon_i_list, self.epsilon_j_list,
                                                                               "resources/watersolvent.xml", "water",
@@ -81,7 +81,7 @@ class SolvationMapGeneratorTestCase(unittest.TestCase):
                                             [-3.004792, -1.250065],
                                             [-2.004792,  0.454246]]),
                          "x_label":"x_label", "y_label":"y_label",
-                         "plot_axis_range":(0.0, 2.0, 0.0, 1.0)}
+                         "plot_axis_range":(2.0, 0.0, 0.0, 1.0)}
         actual_dict = solvationmapgenerator.create_plot_input_data(self.epsilon_i_list,
                                                                    self.epsilon_j_list,
                                                                    298.0, 1.0,
diff --git a/solventmapcreator/test/solvationcalculationtest/solvationplotinformationtest.py b/solventmapcreator/test/solvationcalculationtest/solvationplotinformationtest.py
index 7000a50..3e2ff03 100644
--- a/solventmapcreator/test/solvationcalculationtest/solvationplotinformationtest.py
+++ b/solventmapcreator/test/solvationcalculationtest/solvationplotinformationtest.py
@@ -37,7 +37,7 @@ class SolvationPlotInformationTestCase(unittest.TestCase):
                                             [-3.004792, -1.250065],
                                             [-2.004792,  0.454246]]),
                          "x_label":"x_label", "y_label":"y_label",
-                         "plot_axis_range":(0.0, 2.0, 0.0, 1.0)}
+                         "plot_axis_range":(2.0, 0.0, 0.0, 1.0)}
         actual_dict = solvationplotinformation.create_plot_input_data(self.epsilon_i_list, self.epsilon_j_list, 298.0, 1.0, np.array([0.5, 1.0]), "x_label", "y_label")
         self.assertListEqual(sorted(expected_dict.keys()), sorted(actual_dict.keys()))
         for key in expected_dict.keys():
@@ -51,7 +51,7 @@ class SolvationPlotInformationTestCase(unittest.TestCase):
         """Test to see if expected dictionary is produced.
         """
         expected_dict = {"x_label":"x_label", "y_label":"y_label",
-                         "plot_axis_range":(0.0, 2.0, 0.0, 1.0)}
+                         "plot_axis_range":(2.0, 0.0, 0.0, 1.0)}
         actual_dict = solvationplotinformation.create_input_data_labels(self.epsilon_i_list, self.epsilon_j_list, "x_label", "y_label")
         self.assertListEqual(sorted(expected_dict.keys()), sorted(actual_dict.keys()))
         for key in expected_dict.keys():
@@ -74,7 +74,7 @@ class SolvationPlotInformationTestCase(unittest.TestCase):
     def test_get_axis_range(self):
         """Test to see if expected axis range is returned.
         """
-        expected_range = (0.0, 2.0, 0.0, 1.0)
+        expected_range = (2.0, 0.0, 0.0, 1.0)
         actual_range = solvationplotinformation.get_axis_range(self.epsilon_i_list, self.epsilon_j_list)
         np.testing.assert_array_almost_equal(np.array(expected_range), np.array(actual_range))
     def test_create_meshgrids(self):
-- 
GitLab