Published May-13-2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is an example config file for cartesian style printers. | |
# One may copy and edit this file to configure a new cartesian | |
# printer. | |
# DO NOT COPY THIS FILE WITHOUT CAREFULLY READING AND UPDATING IT | |
# FIRST. Incorrectly configured parameters may cause damage. | |
# See docs/Config_Reference.md for a description of parameters. | |
[stepper_x] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:trusty | |
# Ubuntu packages | |
RUN apt-get update && \ | |
apt-get install -y python-pip python-dev curl build-essential pwgen libffi-dev sudo git-core wget \ | |
# Postgres client | |
libpq-dev \ | |
# Additional packages required for data sources: | |
libssl-dev libmysqlclient-dev freetds-dev libsasl2-dev && \ | |
apt-get clean && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_discretizer_sql(discr_df, table_name, other_cols=[]): | |
from bciutils.beta_v2.transform.sampling import na_filler | |
sql_string = "SELECT {other_columns}".format(other_columns=", ".join(other_cols)) | |
if len(other_cols) > 0: | |
sql_string += ',\n' | |
columns = list(discr_df["feature_name"].unique()) | |
for column in columns: | |
sql_string += "CASE " | |
col_df = discr_df[discr_df["feature_name"] == column] | |
categories = list(col_df["category"].fillna('NA').unique()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import json | |
import logging | |
from redash.query_runner import * | |
from redash.utils import JSONEncoder | |
logger = logging.getLogger(__name__) | |
types_map = { |