From ee316a1547292525b62db7214ffa24864063e961 Mon Sep 17 00:00:00 2001 From: Nan Li Date: Sun, 26 Feb 2023 20:26:04 -0600 Subject: [PATCH 1/3] read the 'pathologists' from flat_file.csv to assign users to collections. --- NCISlideUtil.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/NCISlideUtil.py b/NCISlideUtil.py index b33e17a..78fc370 100644 --- a/NCISlideUtil.py +++ b/NCISlideUtil.py @@ -150,10 +150,16 @@ def addSpecialty(data): for collection in collections: # add specialty pid = addSpecialty({'text': collection['specialty']}) + + # add users + users = [] + for user in collection['pathologists']: + users.append({'user': user}) + for sub in collection['subspecialties']: # add specialty cid = addSpecialty( - {'text': sub, 'pid': pid}) + {'text': sub, 'pid': pid, 'users': users}) # save the token id and collection id as map if cid is not None: subspecialties_map[sub.lower()] = cid @@ -163,7 +169,11 @@ def addSpecialty(data): with open(flat_file_path, 'r', encoding='utf-8-sig') as f: reader = csv.DictReader(f) for row in reader: - flat_map[row['tokenid'].lower()] = row + token = row['tokenid'] or row['token_id'] or None + if token: + flat_map[row['tokenid'].lower()] = row + else: + print('no token id in flat_file') # NCI DOE create a metadata dict END From d8274e0b30c5dd4ac8c8cc32ef80f4f12c6a644e Mon Sep 17 00:00:00 2001 From: Ryan Birmingham Date: Wed, 3 May 2023 13:56:48 -0400 Subject: [PATCH 2/3] update dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9b80f6b..2142b95 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM python:3-stretch +FROM python:3 WORKDIR /var/www RUN apt-get update RUN apt-get -q update --fix-missing -RUN apt-get -q install -y openslide-tools python-openslide vim +RUN apt-get -q install -y openslide-tools python3-openslide vim RUN apt-get -q install -y libvips libvips-dev RUN pip install pyvips From ed4637408c529df29fedb7900243135bd18c998d Mon Sep 17 00:00:00 2001 From: Ryan Birmingham Date: Wed, 3 May 2023 14:43:28 -0400 Subject: [PATCH 3/3] openssl update --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2142b95..d97ef8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM python:3 WORKDIR /var/www RUN apt-get update RUN apt-get -q update --fix-missing -RUN apt-get -q install -y openslide-tools python3-openslide vim +RUN apt-get -q install -y openslide-tools python3-openslide vim openssl RUN apt-get -q install -y libvips libvips-dev RUN pip install pyvips @@ -12,6 +12,8 @@ RUN pip install gunicorn RUN pip install greenlet RUN pip install gunicorn[eventlet] +run openssl version -a + ENV FLASK_ENV development RUN mkdir -p /images/uploading