-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from mruffalo/python3
Support Python 2.7, 3.4, 3.5, 3.6
- Loading branch information
Showing
27 changed files
with
83 additions
and
73 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__pycache__/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,9 @@ language: python | |
# python versioning | ||
python: | ||
- 2.7 | ||
- 3.4 | ||
- 3.5 | ||
- 3.6 | ||
|
||
# requirements | ||
install: | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from clue_api_client import * | ||
from pandasGEXpress import * | ||
from set_io import * | ||
from .clue_api_client import * | ||
from .pandasGEXpress import * | ||
from .set_io import * |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import logging | ||
import setup_logger | ||
from . import setup_logger | ||
|
||
__authors__ = "David L. Lahr" | ||
__email__ = "[email protected]" | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import requests | ||
import logging | ||
import setup_logger | ||
from . import setup_logger | ||
import json | ||
import copy | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import logging | ||
import setup_logger | ||
from . import setup_logger | ||
|
||
__authors__ = "David L. Lahr" | ||
__email__ = "[email protected]" | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import logging | ||
import setup_logger | ||
from . import setup_logger | ||
|
||
__authors__ = "David L. Lahr" | ||
__email__ = "[email protected]" | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import logging | ||
import setup_logger | ||
import clue_api_client | ||
from . import setup_logger | ||
from . import clue_api_client | ||
|
||
__authors__ = "David L. Lahr" | ||
__email__ = "[email protected]" | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import logging | ||
import setup_logger | ||
from . import setup_logger | ||
|
||
__authors__ = "David L. Lahr" | ||
__email__ = "[email protected]" | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,10 @@ | |
import logging | ||
from cmapPy.clue_api_client import clue_api_client as clue_api_client | ||
import os.path | ||
import ConfigParser | ||
import collections | ||
|
||
from six.moves import configparser | ||
|
||
__authors__ = "David L. Lahr" | ||
__email__ = "[email protected]" | ||
|
||
|
@@ -120,7 +121,7 @@ def test_run_put(self): | |
|
||
|
||
def build_clue_api_client_from_default_test_config(): | ||
cfg = ConfigParser.RawConfigParser() | ||
cfg = configparser.RawConfigParser() | ||
cfg.read(config_filepath) | ||
cao = clue_api_client.ClueApiClient(base_url=cfg.get(config_section, "clue_api_url"), | ||
user_key=cfg.get(config_section, "clue_api_user_key")) | ||
|
This file contains 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 contains 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 contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,14 +36,16 @@ | |
import sys | ||
import glob | ||
import logging | ||
import setup_GCToo_logger as setup_logger | ||
import pandas as pd | ||
|
||
import numpy | ||
import pandas as pd | ||
from six.moves import range | ||
|
||
import GCToo | ||
import parse | ||
import write_gct | ||
import write_gctx | ||
from . import GCToo | ||
from . import parse | ||
from . import setup_GCToo_logger as setup_logger | ||
from . import write_gct | ||
from . import write_gctx | ||
|
||
__author__ = "Lev Litichevskiy" | ||
__email__ = "[email protected]" | ||
|
@@ -371,7 +373,7 @@ def build_mismatched_common_meta_report(common_meta_df_shapes, sources, all_meta | |
expanded_sources = [] | ||
for (i, shape) in enumerate(common_meta_df_shapes): | ||
src = sources[i] | ||
expanded_sources.extend([src for i in xrange(shape[0])]) | ||
expanded_sources.extend([src for i in range(shape[0])]) | ||
expanded_sources = numpy.array(expanded_sources) | ||
logger.debug("len(expanded_sources): {}".format(len(expanded_sources))) | ||
|
||
|
@@ -386,8 +388,8 @@ def build_mismatched_common_meta_report(common_meta_df_shapes, sources, all_meta | |
for unique_dup_id in unique_duplicate_ids: | ||
rows = duplicate_ids_meta_df.loc[unique_dup_id] | ||
|
||
matching_row_locs = numpy.array([False for i in xrange(all_meta_df_with_dups.shape[0])]) | ||
for i in xrange(rows.shape[0]): | ||
matching_row_locs = numpy.array([False for i in range(all_meta_df_with_dups.shape[0])]) | ||
for i in range(rows.shape[0]): | ||
r = rows.iloc[i] | ||
row_comparison = r == all_meta_df_with_dups | ||
matching_row_locs = matching_row_locs | row_comparison.all(axis=1).values | ||
|
@@ -399,7 +401,7 @@ def build_mismatched_common_meta_report(common_meta_df_shapes, sources, all_meta | |
|
||
all_report_df = pd.concat(report_df_list, axis=0) | ||
all_report_df["orig_rid"] = all_report_df.index | ||
all_report_df.index = pd.Index(xrange(all_report_df.shape[0]), name="index") | ||
all_report_df.index = pd.Index(range(all_report_df.shape[0]), name="index") | ||
logger.debug("all_report_df.shape: {}".format(all_report_df.shape)) | ||
logger.debug("all_report_df.index: {}".format(all_report_df.index)) | ||
logger.debug("all_report_df.columns: {}".format(all_report_df.columns)) | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,11 @@ | |
""" | ||
|
||
import logging | ||
import setup_GCToo_logger as setup_logger | ||
from . import setup_GCToo_logger as setup_logger | ||
import argparse | ||
import sys | ||
import parse_gct | ||
import write_gctx | ||
from . import parse_gct | ||
from . import write_gctx | ||
|
||
__author__ = "Oana Enache" | ||
__email__ = "[email protected]" | ||
|
This file contains 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 contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,10 @@ | |
""" | ||
|
||
import logging | ||
import setup_GCToo_logger as setup_logger | ||
from . import setup_GCToo_logger as setup_logger | ||
import pandas | ||
import numpy | ||
import GCToo | ||
from . import GCToo | ||
|
||
__author__ = 'Oana Enache' | ||
__email__ = '[email protected]' | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,9 @@ | |
""" | ||
|
||
import logging | ||
import setup_GCToo_logger as setup_logger | ||
import parse_gct | ||
import parse_gctx | ||
from . import setup_GCToo_logger as setup_logger | ||
from . import parse_gct | ||
from . import parse_gctx | ||
|
||
__author__ = "Oana Enache" | ||
__email__ = "[email protected]" | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,11 +60,11 @@ | |
""" | ||
|
||
import logging | ||
import setup_GCToo_logger as setup_logger | ||
from . import setup_GCToo_logger as setup_logger | ||
import pandas as pd | ||
import numpy as np | ||
import numpy as np | ||
import os.path | ||
import GCToo | ||
from . import GCToo | ||
|
||
__author__ = "Lev Litichevskiy, Oana Enache" | ||
__email__ = "[email protected]" | ||
|
@@ -115,7 +115,7 @@ def parse(file_path, convert_neg_666=True, row_meta_only=False, col_meta_only=Fa | |
if not os.path.exists(file_path): | ||
err_msg = "The given path to the gct file cannot be found. gct_path: {}" | ||
logger.error(err_msg.format(file_path)) | ||
raise(Exception(err_msg.format(file_path))) | ||
raise Exception(err_msg.format(file_path)) | ||
logger.info("Reading GCT: {}".format(file_path)) | ||
|
||
# Read version and dimensions | ||
|
@@ -150,7 +150,7 @@ def read_version_and_dims(file_path): | |
err_msg = ("Only GCT1.2 and 1.3 are supported. The first row of the GCT " + | ||
"file must simply be (without quotes) '#1.3' or '#1.2'") | ||
logger.error(err_msg.format(version)) | ||
raise(Exception(err_msg.format(version))) | ||
raise Exception(err_msg.format(version)) | ||
|
||
# Convert version to a string | ||
version_as_string = "GCT" + str(version) | ||
|
@@ -165,11 +165,11 @@ def read_version_and_dims(file_path): | |
if version == "1.2" and len(dims) != 2: | ||
error_msg = "GCT1.2 should have 2 dimension-related entries in row 2. dims: {}" | ||
logger.error(error_msg.format(dims)) | ||
raise(Exception(error_msg.format(dims))) | ||
elif version == "1.3" and len(dims) != 4: | ||
raise Exception(error_msg.format(dims)) | ||
elif version == "1.3" and len(dims) != 4: | ||
error_msg = "GCT1.3 should have 4 dimension-related entries in row 2. dims: {}" | ||
logger.error(error_msg.format(dims)) | ||
raise(Exception(error_msg.format(dims))) | ||
raise Exception(error_msg.format(dims)) | ||
|
||
# Explicitly define each dimension | ||
num_data_rows = int(dims[0]) | ||
|
@@ -286,7 +286,7 @@ def assemble_data(full_df, num_col_metadata, num_data_rows, num_row_metadata, nu | |
"data.loc['{}', '{}'] = '{}'\nAdd to nan_values if you wish " + | ||
"for this value to be considered NaN.").format(bad_row_label, col, val) | ||
logger.error(err_msg) | ||
raise(Exception(err_msg)) | ||
raise Exception(err_msg) | ||
|
||
# Rename the index name and columns name | ||
data.index.name = row_index_name | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import logging | ||
import setup_GCToo_logger as setup_logger | ||
from . import setup_GCToo_logger as setup_logger | ||
import os | ||
import numpy as np | ||
import pandas as pd | ||
import h5py | ||
import GCToo | ||
from . import GCToo | ||
|
||
__author__ = "Oana Enache" | ||
__email__ = "[email protected]" | ||
|
@@ -58,7 +58,7 @@ def parse(gctx_file_path, convert_neg_666=True, rid=None, cid=None, | |
if not os.path.exists(full_path): | ||
err_msg = "The given path to the gctx file cannot be found. full_path: {}" | ||
logger.error(err_msg.format(full_path)) | ||
raise (Exception(err_msg.format(full_path))) | ||
raise Exception(err_msg.format(full_path)) | ||
logger.info("Reading GCTX: {}".format(full_path)) | ||
|
||
# open file | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,9 @@ | |
Slices a random subset of a GCToo instance of a user-specified size. | ||
""" | ||
import logging | ||
import setup_GCToo_logger as setup_logger | ||
from . import setup_GCToo_logger as setup_logger | ||
import numpy | ||
import GCToo | ||
from . import GCToo | ||
|
||
__author__ = "Oana Enache" | ||
__email__ = "[email protected]" | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,10 @@ | |
import pandas as pd | ||
import re | ||
|
||
import setup_GCToo_logger as setup_logger | ||
import GCToo | ||
import parse_gct as pg | ||
import write_gct as wg | ||
from . import setup_GCToo_logger as setup_logger | ||
from . import GCToo | ||
from . import parse_gct as pg | ||
from . import write_gct as wg | ||
|
||
__author__ = "Lev Litichevskiy" | ||
__email__ = "[email protected]" | ||
|
@@ -190,4 +190,4 @@ def slice_gctoo(gctoo, row_bool=None, col_bool=None, rid=None, cid=None, exclude | |
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
main() |
This file contains 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
Oops, something went wrong.