diff --git a/jwql/database/database_interface.py b/jwql/database/database_interface.py index d94532ef4..8ae993633 100644 --- a/jwql/database/database_interface.py +++ b/jwql/database/database_interface.py @@ -144,7 +144,7 @@ def load_connection(connection_string): # Import a global session. If running from readthedocs or GitHub Actions, # pass a dummy connection string -if 'build' and 'project' in socket.gethostname() or ON_GITHUB_ACTIONS: +if all(word in socket.gethostname() for word in ('build', 'project')) or ON_GITHUB_ACTIONS: dummy_connection_string = 'postgresql+psycopg2://account:password@hostname:0000/db_name' session, base, engine, meta = load_connection(dummy_connection_string) else: diff --git a/jwql/tests/test_calculations.py b/jwql/tests/test_calculations.py index 1c3fef2e5..dba2f8b9a 100644 --- a/jwql/tests/test_calculations.py +++ b/jwql/tests/test_calculations.py @@ -77,7 +77,7 @@ def test_mean_image(): cube[i, :, :] = 5. # Insert a few signal values that will be removed by sigma clipping. - # Make sure you "remove" and equal number of 4's and 5's from each + # Make sure you "remove" an equal number of 4's and 5's from each # pixel in order to keep the mean at 4.5 and dev at 0.5 cube[0, 0, 0] = 55. cube[1, 0, 0] = -78. diff --git a/jwql/utils/interactive_preview_image.py b/jwql/utils/interactive_preview_image.py index 1845e0d91..905f7a9bb 100644 --- a/jwql/utils/interactive_preview_image.py +++ b/jwql/utils/interactive_preview_image.py @@ -97,12 +97,12 @@ def __init__(self, filename, low_lim=None, high_lim=None, scaling='lin', contras if self.contrast is None: self.contrast = 0.25 if isinstance(group, list): - if len(group) > 2: + if len(group) != 2: raise ValueError( 'group must be an integer or 2-element list') self.group = group if isinstance(integ, list): - if len(integ) > 2: + if len(integ) != 2: raise ValueError( 'integ must be an integer or 2-element list') self.integ = integ