Repository: ASFHyP3/hyp3-sdk

Issue:
_get_job_by_id shouldn't be private
https://github.com/ASFHyP3/hyp3-sdk/blob/develop/hyp3_sdk/hyp3.py#L72

Turns out it's pretty useful generally. 

Discussion:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 71619ef..d83763d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -35,6 +35,7 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
   submit one or more prepared job dictionaries.
 - `Job.download_files` and `Batch.download_files` will (optionally) create the
   download location if it doesn't exist
+- `Hyp3._get_job_by_id` has been made public and renamed to `Hyp3.get_job_by_id`
 
 ## [0.4.0](https://github.com/ASFHyP3/hyp3-sdk/compare/v0.3.3...v0.4.0)
 
diff --git a/hyp3_sdk/hyp3.py b/hyp3_sdk/hyp3.py
index 060aca6..6c0c8ef 100644
--- a/hyp3_sdk/hyp3.py
+++ b/hyp3_sdk/hyp3.py
@@ -71,12 +71,20 @@ class HyP3:
             warnings.warn('Found zero jobs', UserWarning)
         return Batch(jobs)
 
-    def _get_job_by_id(self, job_id):
+    def get_job_by_id(self, job_id: str) -> Job:
+        """Get job by job ID
+
+        Args:
+            job_id: A job ID
+
+        Returns:
+            A Job object
+        """
         try:
             response = self.session.get(urljoin(self.url, f'/jobs/{job_id}'))
             response.raise_for_status()
         except RequestException:
-            raise HyP3Error('Unable to get job by ID')
+            raise HyP3Error(f'Unable to get job by ID {job_id}')
         return Job.from_dict(response.json())
 
     @singledispatchmethod
@@ -150,7 +158,7 @@ class HyP3:
 
     @refresh.register
     def _refresh_job(self, job: Job):
-        return self._get_job_by_id(job.job_id)
+        return self.get_job_by_id(job.job_id)
 
     def submit_prepared_jobs(self, prepared_jobs: Union[dict, List[dict]]) -> Batch:
         """Submit a prepared job dictionary, or list of prepared job dictionaries


Test patch:
diff --git a/tests/test_hyp3.py b/tests/test_hyp3.py
index 743fbac..ced9e4c 100644
--- a/tests/test_hyp3.py
+++ b/tests/test_hyp3.py
@@ -52,7 +52,7 @@ def test_get_job_by_id(get_mock_job):
     job = get_mock_job()
     api = HyP3()
     responses.add(responses.GET, urljoin(api.url, f'/jobs/{job.job_id}'), json=job.to_dict())
-    response = api._get_job_by_id(job.job_id)
+    response = api.get_job_by_id(job.job_id)
     assert response == job