コード例 #1
0
ファイル: manifest.py プロジェクト: haje01/wzdat
    def __init__(self, check_depends=True, explicit_nbpath=None):
        super(Manifest, self).__init__()

        if explicit_nbpath is None:
            nbdir = get_notebook_dir()
            logging.debug(u"nbdir {}".format(nbdir))
            nbrpath = get_notebook_rpath()
            logging.debug(u"nbrpath {}".format(nbrpath))
            self._nbapath = os.path.join(nbdir, nbrpath)
            self._path = os.path.join(nbdir,
                                      get_notebook_manifest_path(nbrpath))
        else:
            logging.debug(u"explicit_nbpath {}".format(explicit_nbpath))
            self._nbapath = explicit_nbpath
            self._path = get_notebook_manifest_path(explicit_nbpath)

        logging.debug(u"find manifest {}".format(self._path))
        if not os.path.isfile(self._path.encode('utf8')):
            raise ManifestNotExist()
        self._init_checksum(check_depends)
        logging.debug("Manifest __init__ done")
コード例 #2
0
ファイル: ipython_startup.py プロジェクト: haje01/wzdat
import os
import sys
sys.path.append('/solution')
import matplotlib
import matplotlib as mlp
mlp.rcParams['font.family'] = u'NanumGothic'
mlp.rcParams['font.size'] = 10

import pandas as pd
pd.set_option('io.hdf.default_format', 'table')  # default hdf format 'table'

from pandas import Series, DataFrame
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('darkgrid', {'font.family': [u'NanumGothic']})

from wzdat.util import hdf_path, hdf_exists, get_notebook_rpath, get_notebook_dir
from wzdat.notebook_runner import NoDataFound

from wzdat.manifest import Manifest, ManifestNotExist
try:
    nbrpath = __nbpath__ if '__nbpath__' in globals() else\
        get_notebook_rpath(False)
    nbapath = os.path.join(get_notebook_dir(), nbrpath)
    manifest_ = Manifest(True, nbapath)
except ManifestNotExist:
    manifest_ = None
import os