提交 9815d88b authored 作者: Frederic Bastien's avatar Frederic Bastien

Print more compact theano config in travis

上级 2b90f5da
...@@ -65,7 +65,7 @@ script: ...@@ -65,7 +65,7 @@ script:
- cd $(python -c 'import theano; import os; print(os.path.split(theano.__file__)[0])') - cd $(python -c 'import theano; import os; print(os.path.split(theano.__file__)[0])')
- echo "$PART" - echo "$PART"
- cd -; cd Theano - cd -; cd Theano
- python -c 'import theano; print(theano.config)' - python -c 'import theano; print theano.config.__str__(print_doc=False)'
- python -c 'import theano; assert(theano.config.blas.ldflags != "")' - python -c 'import theano; assert(theano.config.blas.ldflags != "")'
- theano-nose -v $PART - theano-nose -v $PART
- if [[ $DOC == "1" ]]; then python doc/scripts/docgen.py --nopdf --check; fi - if [[ $DOC == "1" ]]; then python doc/scripts/docgen.py --nopdf --check; fi
......
...@@ -165,10 +165,11 @@ def fetch_val_for_key(key, delete_key=False): ...@@ -165,10 +165,11 @@ def fetch_val_for_key(key, delete_key=False):
_config_var_list = [] _config_var_list = []
def _config_print(thing, buf): def _config_print(thing, buf, print_doc=True):
for cv in _config_var_list: for cv in _config_var_list:
print(cv, file=buf) print(cv, file=buf)
print(" Doc: ", cv.doc, file=buf) if print_doc:
print(" Doc: ", cv.doc, file=buf)
print(" Value: ", cv.__get__(True, None), file=buf) print(" Value: ", cv.__get__(True, None), file=buf)
print("", file=buf) print("", file=buf)
...@@ -191,9 +192,9 @@ class TheanoConfigParser(object): ...@@ -191,9 +192,9 @@ class TheanoConfigParser(object):
# properties are installed by AddConfigVar # properties are installed by AddConfigVar
_i_am_a_config_class = True _i_am_a_config_class = True
def __str__(self): def __str__(self, print_doc=True):
sio = StringIO() sio = StringIO()
_config_print(self.__class__, sio) _config_print(self.__class__, sio, print_doc=print_doc)
return sio.getvalue() return sio.getvalue()
# N.B. all instances of TheanoConfigParser give access to the same properties. # N.B. all instances of TheanoConfigParser give access to the same properties.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论