Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hostname contents and list lengths #1036

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jwql/database/database_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion jwql/tests/test_calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions jwql/utils/interactive_preview_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading