Skip to content

Commit

Permalink
Fix jupytext notebook load error. (#366)
Browse files Browse the repository at this point in the history
* Fix jupytext notebook load error.
* Update jupytext version in all the notebooks
* Set notebook interpreter to python3.7
 * Update start.sh and README
 * Remove incompatible notebook deps functools32 and futures
* Replace google.datalab with google.cloud for bigquery in notebooks
* Using google-cloud-bigquery because datalab in python3.7 yields syntax
   error (see googledatalab/pydatalab#711)
[ci skip]
  • Loading branch information
ksdkalluri authored Dec 27, 2019
1 parent 712f219 commit 743c86b
Show file tree
Hide file tree
Showing 25 changed files with 90 additions and 103 deletions.
8 changes: 4 additions & 4 deletions data_steward/analytics/cdr_ops/conformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.3
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 2
# display_name: Python 3
# language: python
# name: python2
# name: python3
# ---

# # Conformance
Expand Down
8 changes: 4 additions & 4 deletions data_steward/analytics/cdr_ops/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.3
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 2
# display_name: Python 3
# language: python
# name: python2
# name: python3
# ---

import warnings
Expand Down
8 changes: 4 additions & 4 deletions data_steward/analytics/cdr_ops/curation_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.3
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 2
# display_name: Python 3
# language: python
# name: python2
# name: python3
# ---

# +
Expand Down
2 changes: 1 addition & 1 deletion data_steward/analytics/cdr_ops/deid_race.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# + {}
# +
from notebooks import bq, render, parameters
import pandas as pd

Expand Down
8 changes: 4 additions & 4 deletions data_steward/analytics/cdr_ops/ehr_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.3
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 2
# display_name: Python 3
# language: python
# name: python2
# name: python3
# ---

# # EHR Operations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.3
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 2
# display_name: Python 3
# language: python
# name: python2
# name: python3
# ---

import google.datalab.bigquery as bq
Expand Down
10 changes: 4 additions & 6 deletions data_steward/analytics/table_metrics/Table_Metrics_part_1.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.1
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 2
# display_name: Python 3
# language: python
# name: python2
# name: python3
# ---

# +
Expand Down Expand Up @@ -1665,4 +1664,3 @@ def cstr(s, color='black'):
success_rate

success_rate.to_csv("data\\concept.csv")
# -
9 changes: 4 additions & 5 deletions data_steward/analytics/table_metrics/Table_Metrics_part_2.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.1
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 2
# display_name: Python 3
# language: python
# name: python2
# name: python3
# ---

# +
Expand Down
15 changes: 10 additions & 5 deletions data_steward/analytics/table_metrics/Table_Metrics_part_3.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# cell_metadata_json: true
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.1
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 2
# display_name: Python 3
# language: python
# name: python2
# name: python3
# ---

# + {"pycharm": {"name": "#%%\n"}}
Expand Down Expand Up @@ -222,6 +222,7 @@ def cstr(s, color='black'):
# + {"pycharm": {"name": "#%%\n"}}



# + {"pycharm": {"name": "#%%\n"}}
total_wrong = temporal_df['wrong_date_rows'].sum()
total_wrong
Expand Down Expand Up @@ -300,6 +301,7 @@ def cstr(s, color='black'):
# + {"pycharm": {"name": "#%%\n"}}



# + {"pycharm": {"name": "#%%\n"}}
total_wrong = temporal_df['wrong_date_rows'].sum()
total_wrong
Expand Down Expand Up @@ -1221,7 +1223,10 @@ def cstr(s, color='black'):
# + {"pycharm": {"name": "#%%\n"}}



# + {"pycharm": {"name": "#%%\n"}}



# + {"pycharm": {"name": "#%%\n"}}

7 changes: 2 additions & 5 deletions data_steward/analytics/table_metrics/Table_Metrics_part_4.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.3'
# jupytext_version: 1.0.5
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 3
# language: python
Expand Down Expand Up @@ -2329,10 +2328,8 @@ def cstr(s, color='black'):
40163765, 40165789, 19125668, 40165776, 40165769, 40171412, 19127398, 19013174, 40163759, 974169, 1310756, 40165755,
19129688, 40163763)

# +
drugs = antibiotics + ccb + diuretics + opioids + statins + msknaids + oralhypo + painnsaids + vaccine + aceinhibitor

# -

# ## Antibiotics

Expand Down
5 changes: 2 additions & 3 deletions data_steward/analytics/table_metrics/Table_Metrics_part_5.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.3'
# jupytext_version: 1.0.5
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 3
# language: python
Expand Down
5 changes: 2 additions & 3 deletions data_steward/analytics/table_metrics/Table_Metrics_part_6.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.3'
# jupytext_version: 1.0.5
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 3
# language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.4
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 2
# display_name: Python 3
# language: python
# name: python2
# name: python3
# ---

# NOTES:
Expand Down Expand Up @@ -414,4 +414,3 @@

img_name = name_of_interest + "_concept_success_line_graph.jpg"
# plt.savefig(img_name, bbox_extraartist=(lgd,), bbox_inches='tight')
# -
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.4
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 2
# display_name: Python 3
# language: python
# name: python2
# name: python3
# ---

# NOTES:
Expand Down Expand Up @@ -393,4 +393,3 @@

img_name = name_of_interest + "_data_after_death_line_graph.jpg"
# plt.savefig(img_name, bbox_extraartist=(lgd,), bbox_inches='tight')
# -
9 changes: 4 additions & 5 deletions data_steward/analytics/tools/duplicates_visualizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.4
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 2
# display_name: Python 3
# language: python
# name: python2
# name: python3
# ---

# NOTES:
Expand Down Expand Up @@ -387,4 +387,3 @@

img_name = name_of_interest + "_duplicates_line_graph.jpg"
# plt.savefig(img_name, bbox_extraartist=(lgd,), bbox_inches='tight')
# -
4 changes: 2 additions & 2 deletions data_steward/analytics/tools/email_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def print_error_info(error_dict, starting_msg, percent,
###########################################################################
# No longer defining functions #
# We are now doing everything that comes BEFORE we print the message #
###########################################################################
# ##########################################################################


# 1. Loading the files
Expand Down Expand Up @@ -372,7 +372,7 @@ def print_error_info(error_dict, starting_msg, percent,
# Now we are actually printing out the 'problem' information for the site #
# This is admittedly clunky but I decided to not implement a standard #
# function in order to allow the text feel more 'natural.' #
###########################################################################
# ##########################################################################


# same for all of the sites
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.4
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 2
# display_name: Python 3
# language: python
# name: python2
# name: python3
# ---

# NOTES:
Expand Down Expand Up @@ -363,4 +363,3 @@

img_name = name_of_interest + "_end_before_start_data_line_graph.jpg"
# plt.savefig(img_name, bbox_extraartist=(lgd,), bbox_inches='tight')
# -
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.4
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 2
# display_name: Python 3
# language: python
# name: python2
# name: python3
# ---

# NOTES:
Expand Down Expand Up @@ -432,4 +432,3 @@

img_name = name_of_interest + "_drug_integration_line_graph.jpg"
# plt.savefig(img_name, bbox_extraartist=(lgd,), bbox_inches='tight')
# -
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.4
# format_version: '1.5'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 2
# display_name: Python 3
# language: python
# name: python2
# name: python3
# ---

# NOTES:
Expand Down Expand Up @@ -401,4 +401,3 @@

img_name = name_of_interest + "_measurement_integration_line_graph.jpg"
# plt.savefig(img_name, bbox_extraartist=(lgd,), bbox_inches='tight')
# -
Loading

0 comments on commit 743c86b

Please sign in to comment.