Repository: MatterMiners/tardis

Issue:
Inconsistent spelling of utilization/utilisation
COBalD consistenly uses `utilisation` but in TARDIS both [utili**s**ation](https://github.com/MatterMiners/tardis/search?q=utilisation&unscoped_q=utilisation) and [utili**z**ation](https://github.com/MatterMiners/tardis/search?q=utilization&unscoped_q=utilization) are used. This can be confusing because those names are also exposed to the user via the configuration files. 

I'm happy to provide a PR once it is clear which spelling should be used.

Discussion:

Patch:
diff --git a/docs/source/adapters/batchsystem.rst b/docs/source/adapters/batchsystem.rst
index e12431a..e9041b7 100644
--- a/docs/source/adapters/batchsystem.rst
+++ b/docs/source/adapters/batchsystem.rst
@@ -7,7 +7,7 @@ Batch System Adapters
 Fake Batch System Adapter
 -------------------------
 
-.. |FakeBatchSystemAdapter.get_utilization| replace:: :py:meth:`~tardis.adapters.batchsystems.fakebatchsystem.FakeBatchSystemAdapter.get_utilization`
+.. |FakeBatchSystemAdapter.get_utilisation| replace:: :py:meth:`~tardis.adapters.batchsystems.fakebatchsystem.FakeBatchSystemAdapter.get_utilisation`
 
 .. |FakeBatchSystemAdapter.get_allocation| replace:: :py:meth:`~tardis.adapters.batchsystems.fakebatchsystem.FakeBatchSystemAdapter.get_allocation`
 
@@ -19,7 +19,7 @@ Fake Batch System Adapter
     implements a batch system adapter that mocks the response of hypothetical batch system.
     It can be used for testing purposes and as a demonstrator in workshops and tutorials.
 
-    The mocked response to the |FakeBatchSystemAdapter.get_allocation|, |FakeBatchSystemAdapter.get_utilization| and
+    The mocked response to the |FakeBatchSystemAdapter.get_allocation|, |FakeBatchSystemAdapter.get_utilisation| and
     |FakeBatchSystemAdapter.get_machine_status| API calls is configurable statically in the adapter configuration.
 
 Available configuration options
@@ -34,7 +34,7 @@ Available configuration options
     +----------------+---------------------------------------------------------------------+-----------------+
     | allocation     | Mocked response to |FakeBatchSystemAdapter.get_allocation| call     |  **Required**   |
     +----------------+---------------------------------------------------------------------+-----------------+
-    | utilization    | Mocked response to |FakeBatchSystemAdapter.get_utilization| call    |  **Required**   |
+    | utilisation    | Mocked response to |FakeBatchSystemAdapter.get_utilisation| call    |  **Required**   |
     +----------------+---------------------------------------------------------------------+-----------------+
     | machine_status | Mocked response to |FakeBatchSystemAdapter.get_machine_status| call |  **Required**   |
     +----------------+---------------------------------------------------------------------+-----------------+
@@ -48,7 +48,7 @@ Available configuration options
         BatchSystem:
             adapter: FakeBatchSystem
             allocation: 1.0
-            utilization: 1.0
+            utilisation: 1.0
             machine_status: Available
 
 HTCondor Batch System Adapter
@@ -56,7 +56,7 @@ HTCondor Batch System Adapter
 
 .. content-tabs:: left-col
 
-    .. |HTCondorAdapter.get_utilization| replace:: :py:meth:`~tardis.adapters.batchsystems.htcondor.HTCondorAdapter.get_utilization`
+    .. |HTCondorAdapter.get_utilisation| replace:: :py:meth:`~tardis.adapters.batchsystems.htcondor.HTCondorAdapter.get_utilisation`
 
     .. |HTCondorAdapter.get_allocation| replace:: :py:meth:`~tardis.adapters.batchsystems.htcondor.HTCondorAdapter.get_allocation`
 
@@ -65,7 +65,7 @@ HTCondor Batch System Adapter
     The :py:class:`~tardis.adapters.batchsystems.htcondor.HTCondorAdapter` implements the TARDIS interface to dynamically
     integrate and manage opportunistic resources with the HTCondor batch system.
 
-    Information provider for the API calls |HTCondorAdapter.get_utilization|, |HTCondorAdapter.get_allocation| and
+    Information provider for the API calls |HTCondorAdapter.get_utilisation|, |HTCondorAdapter.get_allocation| and
     |HTCondorAdapter.get_machine_status| is the HTCondor ``condor_status`` command, which is called asynchronously and its
     output is cached for a configurable time ``max_age``.
 
@@ -73,7 +73,7 @@ HTCondor Batch System Adapter
     ClassAds ``State`` and ``Activity``. It can take the states ``Available``, ``Draining``, ``Drained`` and
     ``NotAvailable``.
 
-    The allocation and utilization of a worker node is defined as maximum and minimum of the relative ratio of requested
+    The allocation and utilisation of a worker node is defined as maximum and minimum of the relative ratio of requested
     over total resources such as CPU, Memory, Disk, respectively. Which resource ratios to take into account can be
     configured via the ``ratios`` option. Any valid HTCondor expression that returns a floating point number is accepted.
 
@@ -104,7 +104,7 @@ Available configuration options
     +----------------+-------------------------------------------------------------------------+-----------------+
     | max_age        | Maximum age of the cached ``condor_status`` information in minutes      |  **Required**   |
     +----------------+-------------------------------------------------------------------------+-----------------+
-    | ratios         | HTCondor expressions used to determine allocation and utilization       |  **Required**   |
+    | ratios         | HTCondor expressions used to determine allocation and utilisation       |  **Required**   |
     +----------------+-------------------------------------------------------------------------+-----------------+
     | options        | Additional command line options to add to the ``condor_status`` command |  **Optional**   |
     +----------------+-------------------------------------------------------------------------+-----------------+
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 8f7310a..7064d46 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -111,7 +111,7 @@ Configuration of TARDIS
         BatchSystem:
           adapter: FakeBatchSystem
           allocation: 1.0
-          utilization: !PeriodicValue
+          utilisation: !PeriodicValue
                        period: 3600
                        amplitude: 0.5
                        offset: 0.5
diff --git a/tardis/adapters/batchsystems/fakebatchsystem.py b/tardis/adapters/batchsystems/fakebatchsystem.py
index 736b5f2..6eb49b1 100644
--- a/tardis/adapters/batchsystems/fakebatchsystem.py
+++ b/tardis/adapters/batchsystems/fakebatchsystem.py
@@ -10,7 +10,7 @@ class FakeBatchSystemAdapter(BatchSystemAdapter):
     batch system. It can be used for testing purposes and as a demonstrator
     in workshops and tutorials.
 
-    The mocked response to the :py:meth:`~.get_utilization`, :py:meth:`~.get_allocation`
+    The mocked response to the :py:meth:`~.get_utilisation`, :py:meth:`~.get_allocation`
     and :py:meth:`~.get_machine_status` API calls is configurable statically.
     """
 
@@ -81,19 +81,19 @@ class FakeBatchSystemAdapter(BatchSystemAdapter):
         else:
             return machine_status
 
-    async def get_utilization(self, drone_uuid: str) -> float:
+    async def get_utilisation(self, drone_uuid: str) -> float:
         """
-        Returns the fake utilization according to the configuration of the
+        Returns the fake utilisation according to the configuration of the
         FakeBatchSystem
 
         :param drone_uuid: Unique identifier of the drone
         :type drone_uuid: str
-        :return: Utilization value specified in the FakeBatchSystem configuration
+        :return: utilisation value specified in the FakeBatchSystem configuration
         :rtype: float
         """
         try:
-            utilization = self.fake_config.utilization.get_value()
+            utilisation = self.fake_config.utilisation.get_value()
         except AttributeError:
-            return self.fake_config.utilization
+            return self.fake_config.utilisation
         else:
-            return utilization
+            return utilisation
diff --git a/tardis/adapters/batchsystems/htcondor.py b/tardis/adapters/batchsystems/htcondor.py
index f74897b..1e0e72c 100644
--- a/tardis/adapters/batchsystems/htcondor.py
+++ b/tardis/adapters/batchsystems/htcondor.py
@@ -220,16 +220,16 @@ class HTCondorAdapter(BatchSystemAdapter):
                 MachineStatus.NotAvailable,
             )
 
-    async def get_utilization(self, drone_uuid: str) -> float:
+    async def get_utilisation(self, drone_uuid: str) -> float:
         """
-        Get the utilization of a worker node in HTCondor, which is defined as
+        Get the utilisation of a worker node in HTCondor, which is defined as
         minimum of the ratios of requested over total resources
         (CPU, Memory, Disk, etc.).
 
         :param drone_uuid: Uuid of the worker node, for some sites corresponding
             to the host name of the drone.
         :type drone_uuid: str
-        :return: The utilization of a worker node as described above.
+        :return: The utilisation of a worker node as described above.
         :rtype: float
         """
         return min(await self.get_resource_ratios(drone_uuid), default=0.0)
diff --git a/tardis/agents/batchsystemagent.py b/tardis/agents/batchsystemagent.py
index ffdb526..9204ed9 100644
--- a/tardis/agents/batchsystemagent.py
+++ b/tardis/agents/batchsystemagent.py
@@ -21,5 +21,5 @@ class BatchSystemAgent(BatchSystemAdapter):
     async def get_machine_status(self, drone_uuid: str) -> MachineStatus:
         return await self._batch_system_adapter.get_machine_status(drone_uuid)
 
-    async def get_utilization(self, drone_uuid: str) -> float:
-        return await self._batch_system_adapter.get_utilization(drone_uuid)
+    async def get_utilisation(self, drone_uuid: str) -> float:
+        return await self._batch_system_adapter.get_utilisation(drone_uuid)
diff --git a/tardis/interfaces/batchsystemadapter.py b/tardis/interfaces/batchsystemadapter.py
index 3ed70e8..d474959 100644
--- a/tardis/interfaces/batchsystemadapter.py
+++ b/tardis/interfaces/batchsystemadapter.py
@@ -32,5 +32,5 @@ class BatchSystemAdapter(metaclass=ABCMeta):
         return NotImplemented
 
     @abstractmethod
-    async def get_utilization(self, drone_uuid: str) -> float:
+    async def get_utilisation(self, drone_uuid: str) -> float:
         return NotImplemented
diff --git a/tardis/resources/dronestates.py b/tardis/resources/dronestates.py
index b752335..800acbe 100644
--- a/tardis/resources/dronestates.py
+++ b/tardis/resources/dronestates.py
@@ -150,7 +150,7 @@ class AvailableState(State):
             drone._allocation = await drone.batch_system_agent.get_allocation(
                 drone_uuid=drone.resource_attributes["drone_uuid"]
             )
-            drone._utilisation = await drone.batch_system_agent.get_utilization(
+            drone._utilisation = await drone.batch_system_agent.get_utilisation(
                 drone_uuid=drone.resource_attributes["drone_uuid"]
             )
             drone._supply = drone.maximum_demand


Test patch:
diff --git a/tests/adapters_t/batchsystems_t/test_fakebatchsystem.py b/tests/adapters_t/batchsystems_t/test_fakebatchsystem.py
index 98bf451..cc981b5 100644
--- a/tests/adapters_t/batchsystems_t/test_fakebatchsystem.py
+++ b/tests/adapters_t/batchsystems_t/test_fakebatchsystem.py
@@ -25,7 +25,7 @@ class TestFakeBatchSystemAdapter(TestCase):
     def setUp(self):
         self.config = self.mock_config.return_value
         self.config.BatchSystem.allocation = 1.0
-        self.config.BatchSystem.utilization = 1.0
+        self.config.BatchSystem.utilisation = 1.0
         self.config.BatchSystem.machine_status = "Available"
 
         self.fake_adapter = FakeBatchSystemAdapter()
@@ -58,9 +58,9 @@ class TestFakeBatchSystemAdapter(TestCase):
             MachineStatus.Drained,
         )
 
-    def test_get_utilization(self):
-        self.assertEqual(run_async(self.fake_adapter.get_utilization, "test-123"), 1.0)
+    def test_get_utilisation(self):
+        self.assertEqual(run_async(self.fake_adapter.get_utilisation, "test-123"), 1.0)
 
-        self.config.BatchSystem.utilization = AttributeDict(get_value=lambda: 0.9)
+        self.config.BatchSystem.utilisation = AttributeDict(get_value=lambda: 0.9)
         self.fake_adapter = FakeBatchSystemAdapter()
-        self.assertEqual(run_async(self.fake_adapter.get_utilization, "test-123"), 0.9)
+        self.assertEqual(run_async(self.fake_adapter.get_utilisation, "test-123"), 0.9)
diff --git a/tests/adapters_t/batchsystems_t/test_htcondor.py b/tests/adapters_t/batchsystems_t/test_htcondor.py
index 0c668f0..11b0d90 100644
--- a/tests/adapters_t/batchsystems_t/test_htcondor.py
+++ b/tests/adapters_t/batchsystems_t/test_htcondor.py
@@ -226,9 +226,9 @@ class TestHTCondorAdapter(TestCase):
                 self.mock_async_run_command.assert_called_with(self.command)
         self.mock_async_run_command.side_effect = None
 
-    def test_get_utilization(self):
+    def test_get_utilisation(self):
         self.assertEqual(
-            run_async(self.htcondor_adapter.get_utilization, drone_uuid="test"),
+            run_async(self.htcondor_adapter.get_utilisation, drone_uuid="test"),
             min([self.cpu_ratio, self.memory_ratio]),
         )
         self.mock_async_run_command.assert_called_with(self.command)
diff --git a/tests/agents_t/test_batchsystemagent.py b/tests/agents_t/test_batchsystemagent.py
index 7a66102..cd3465d 100644
--- a/tests/agents_t/test_batchsystemagent.py
+++ b/tests/agents_t/test_batchsystemagent.py
@@ -37,7 +37,7 @@ class TestBatchSystemAgent(TestCase):
         run_async(self.batch_system_agent.get_machine_status, drone_uuid="test")
         self.batch_system_adapter.get_machine_status.assert_called_with("test")
 
-    def test_get_utilization(self):
-        self.batch_system_adapter.get_utilization.side_effect = async_return
-        run_async(self.batch_system_agent.get_utilization, drone_uuid="test")
-        self.batch_system_adapter.get_utilization.assert_called_with("test")
+    def test_get_utilisation(self):
+        self.batch_system_adapter.get_utilisation.side_effect = async_return
+        run_async(self.batch_system_agent.get_utilisation, drone_uuid="test")
+        self.batch_system_adapter.get_utilisation.assert_called_with("test")
diff --git a/tests/resources_t/test_dronestates.py b/tests/resources_t/test_dronestates.py
index 2afb777..876a6d7 100644
--- a/tests/resources_t/test_dronestates.py
+++ b/tests/resources_t/test_dronestates.py
@@ -80,7 +80,7 @@ class TestDroneStates(TestCase):
         self.drone.batch_system_agent.get_allocation.return_value = async_return(
             return_value=None
         )
-        self.drone.batch_system_agent.get_utilization.return_value = async_return(
+        self.drone.batch_system_agent.get_utilisation.return_value = async_return(
             return_value=None
         )