Skip to content

Commit 4f7acd5

Browse files
author
Jon
committed
Fix the broken test and add a test_settings.py that is useful for running the tests locally without redis
1 parent 7b6602a commit 4f7acd5

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

datalab/datalab_session/analysis/raw_data.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from datalab.datalab_session.file_utils import get_hdu
55
from fits2image.scaling import extract_samples, calc_zscale_min_max
66

7+
# TODO: This analysis endpoint assumes the image to be of 16 bitdepth. We should make this agnositc to bit depth in the future
8+
79
def raw_data(input: dict):
810
fits_path = get_fits(input['basename'], input.get('source', 'archive'))
911

@@ -15,8 +17,8 @@ def raw_data(input: dict):
1517
median = np.median(samples)
1618
_, zmax, _ = calc_zscale_min_max(samples, contrast=0.1, iterations=1)
1719

18-
# resize the image to max. 500 pixels on an axis
19-
max_size = input.get('max_size', 800)
20+
# resize the image to max. 500 pixels on an axis by default for the UI
21+
max_size = input.get('max_size', 500)
2022
image = Image.fromarray(image_data)
2123
newImage = image.resize((max_size, max_size), Image.LANCZOS)
2224
scaled_array = np.asarray(newImage).astype(np.float16)
Binary file not shown.

test_settings.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from datalab.settings import *
2+
3+
CACHES = {
4+
'default': {
5+
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
6+
'LOCATION': 'unique-snowflake'
7+
},
8+
}

0 commit comments

Comments
 (0)