Skip to content

Commit

Permalink
feat: remove environment setup from registry template
Browse files Browse the repository at this point in the history
  • Loading branch information
yolile committed Feb 21, 2024
1 parent e0f20f2 commit b7851d4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 133 deletions.
1 change: 0 additions & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"component_check_usability",
],
"template_usability_checks_registry": [
"component_environment",
"component_charts",
"component_download_data_from_registry",
"component_setup_cardinal",
Expand Down
133 changes: 1 addition & 132 deletions template_usability_checks_registry.ipynb
Original file line number Diff line number Diff line change
@@ -1,137 +1,5 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "sfg_SbQWBCmW"
},
"source": [
"## Setup\n",
"\n",
"*You must run the cells in this section each time you connect to a new runtime. For example, when you return to the notebook after an idle timeout, when the runtime crashes, or when you restart or factory reset the runtime.*"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "sowWi_Ve_Lm3"
},
"source": [
"Install requirements (*Note: ocdskingfishercolab installs google-colab, which expects specific versions of pandas and numpy*):\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "X4nmyvOa_Ls7"
},
"outputs": [],
"source": [
"! pip install --upgrade pip > pip.log\n",
"! pip install --upgrade 'ocdskingfishercolab<0.4' ipywidgets psycopg2-binary >> pip.log"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "L1mHB2p8ANfr"
},
"source": [
"Import packages and load extensions:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "tezDNj4uAOHq"
},
"outputs": [],
"source": [
"import json\n",
"import os\n",
"from collections import Counter\n",
"\n",
"import numpy as np\n",
"import pandas as pd\n",
"from google.colab.data_table import DataTable\n",
"from google.colab.files import download\n",
"from ipywidgets import widgets\n",
"from ocdskingfishercolab import (\n",
" authenticate_gspread,\n",
" calculate_coverage,\n",
" download_dataframe_as_csv,\n",
" format_thousands,\n",
" render_json,\n",
" save_dataframe_to_sheet,\n",
" save_dataframe_to_spreadsheet,\n",
" set_dark_mode,\n",
" set_light_mode,\n",
" set_spreadsheet_name,\n",
")\n",
"\n",
"# Load https://pypi.org/project/ipython-sql/\n",
"%load_ext sql\n",
"# Load https://colab.research.google.com/notebooks/data_table.ipynb\n",
"%load_ext google.colab.data_table"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "2MRnhij4pmZO"
},
"source": [
"Set the name of the spreadsheet to export results to, when using `save_dataframe_to_sheet()`:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "drokzszlphmK"
},
"outputs": [],
"source": [
"spreadsheet_name = \"feedback_results\"\n",
"\n",
"set_spreadsheet_name(spreadsheet_name)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "DZASSenGpprv"
},
"source": [
"Configure the notebook environment:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "--8vgOiP_58f"
},
"outputs": [],
"source": [
"# Increase max columns so that Pandas DataFrames with many columns are rendered as data tables.\n",
"DataTable.max_columns = 50\n",
"# Remove the index from data tables for easier copy-pasting to Google Docs.\n",
"DataTable.include_index = False\n",
"\n",
"# Return Pandas DataFrames instead of regular result sets.\n",
"%config SqlMagic.autopandas = True\n",
"# Don't print number of rows affected.\n",
"%config SqlMagic.feedback = False\n",
"\n",
"# If you set Tools > Settings > Site > Theme to dark, uncomment this line.\n",
"# set_dark_mode()\n",
"# If you are creating plots to copy-paste into reports, uncomment this line.\n",
"# set_light_mode()"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down Expand Up @@ -1407,6 +1275,7 @@
],
"metadata": {
"colab": {
"authorship_tag": "ABX9TyPcAYVVDyOnEVxw6WKYfB8l",
"name": "template_usability_checks_registry",
"provenance": []
},
Expand Down

0 comments on commit b7851d4

Please sign in to comment.