Skip to content

Commit

Permalink
Merge d7159f6 into 245903a
Browse files Browse the repository at this point in the history
  • Loading branch information
langmm committed Jul 19, 2018
2 parents 245903a + d7159f6 commit 22496e3
Show file tree
Hide file tree
Showing 23 changed files with 1,570 additions and 221 deletions.
4 changes: 1 addition & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ before_test:
- "flake8 cis_interface"

test_script:
# - "nosetests --nologcapture --with-coverage --cover-package=cis_interface -svx cis_interface/tests/test_runner.py"
- "nosetests -svx --nologcapture --with-coverage --cover-package=cis_interface cis_interface"

- "cistest --nologcapture --with-coverage --cover-package=cis_interface -svx"

after_test:
- "codecov"
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ before_script:
script:
- |
nosetests --nologcapture --with-coverage --cover-package=cis_interface -svx
cistest --nologcapture --with-coverage --cover-package=cis_interface -svx
after_success:
- coveralls
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include VERSION
include *.md
include *.png
include *.svg
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.3.1
188 changes: 69 additions & 119 deletions cis_interface/.cis_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@ comm:
as_array: &id001
required: false
type: boolean
field_names: &id002
dtype: &id002
required: false
type: string
field_names: &id003
required: false
schema:
type: string
type: list
field_units: &id003
field_units: &id004
required: false
schema:
type: string
type: list
format_str: &id004
format_str: &id005
required: false
type: string
name: &id005
name: &id006
required: true
type: string
stype: &id006
stype: &id007
required: false
type: integer
type: &id007
required: false
type: string
units: &id008
required: false
type: string
Expand All @@ -45,66 +45,7 @@ connection:
input_file:
excludes: input
required: true
schema:
append: &id009
required: false
type: boolean
as_array: *id001
comment: &id010
dependencies:
filetype:
- ascii
- table
required: false
type: string
delimiter: &id011
dependencies:
filetype:
- pandas
- table
required: false
type: string
field_names: *id002
field_units: *id003
filetype: &id012
allowed:
- ascii
- binary
- map
- obj
- pandas
- pickle
- ply
- table
default: binary
required: false
type: string
format_str: *id004
in_temp: &id013
required: false
type: boolean
is_series: &id014
required: false
type: boolean
name: *id005
newline: &id015
default: '
'
required: false
type: string
stype: *id006
type: *id007
units: *id008
use_astropy: &id016
dependencies:
filetype:
- table
required: false
type: boolean
working_dir: &id017
required: true
type: string
schema: file
type: dict
onexit:
required: false
Expand All @@ -120,24 +61,7 @@ connection:
output_file:
excludes: output
required: true
schema:
append: *id009
as_array: *id001
comment: *id010
delimiter: *id011
field_names: *id002
field_units: *id003
filetype: *id012
format_str: *id004
in_temp: *id013
is_series: *id014
name: *id005
newline: *id015
stype: *id006
type: *id007
units: *id008
use_astropy: *id016
working_dir: *id017
schema: file
type: dict
translator:
required: false
Expand Down Expand Up @@ -253,23 +177,65 @@ connection_schema_subtypes:
- RMQComm
- output
file:
append: *id009
append:
required: false
type: boolean
as_array: *id001
comment: *id010
delimiter: *id011
field_names: *id002
field_units: *id003
filetype: *id012
format_str: *id004
in_temp: *id013
is_series: *id014
name: *id005
newline: *id015
stype: *id006
type: *id007
comment:
dependencies:
filetype:
- ascii
- table
required: false
type: string
delimiter:
dependencies:
filetype:
- table
- pandas
required: false
type: string
dtype: *id002
field_names: *id003
field_units: *id004
filetype:
allowed:
- binary
- ply
- table
- pickle
- pandas
- map
- ascii
- obj
default: binary
required: false
type: string
format_str: *id005
in_temp:
required: false
type: boolean
is_series:
required: false
type: boolean
name: *id006
newline:
default: '
'
required: false
type: string
stype: *id007
units: *id008
use_astropy: *id016
working_dir: *id017
use_astropy:
dependencies:
filetype:
- table
required: false
type: boolean
working_dir:
required: true
type: string
file_schema_subtypes:
AsciiFileComm:
- ascii
Expand Down Expand Up @@ -326,15 +292,7 @@ model:
inputs:
required: false
schema:
schema:
as_array: *id001
field_names: *id002
field_units: *id003
format_str: *id004
name: *id005
stype: *id006
type: *id007
units: *id008
schema: comm
type: dict
type: list
is_server:
Expand Down Expand Up @@ -377,15 +335,7 @@ model:
outputs:
required: false
schema:
schema:
as_array: *id001
field_names: *id002
field_units: *id003
format_str: *id004
name: *id005
stype: *id006
type: *id007
units: *id008
schema: comm
type: dict
type: list
sourcedir:
Expand Down
54 changes: 41 additions & 13 deletions cis_interface/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
such that they can be run simultaneously, passing input back and forth."""
from cis_interface import platform
import os
import sys
import nose


if platform._is_win: # pragma: windows
Expand All @@ -10,20 +12,46 @@
os.environ['FOR_DISABLE_CONSOLE_CTRL_HANDLER'] = 'T'


# from cis_interface import backwards
# from cis_interface import platform
# from cis_interface import config
# from cis_interface import tools
# from cis_interface import interface
# from cis_interface import drivers
# from cis_interface import dataio
# from cis_interface import tests
# from cis_interface import examples
# from cis_interface import runner
def run_nose(verbose=False, nocapture=False, stop=False,
nologcapture=False, withcoverage=False): # pragma: debug
r"""Run nose tests for the package.
Args:
verbose (bool, optional): If True, set nose option '-v' which
increases the verbosity. Defaults to False.
nocapture (bool, optional): If True, set nose option '--nocapture'
which allows messages to be printed to stdout. Defaults to False.
stop (bool, optional): If True, set nose option '--stop' which
stops tests at the first failure. Defaults to False.
nologcapture (bool, optional): If True, set nose option '--nologcapture'
which allows logged messages to be printed. Defaults to False.
withcoverage (bool, optional): If True, set nose option '--with-coverage'
which invokes coverage. Defaults to False.
"""
error_code = 0
nose_argv = sys.argv
nose_argv += ['--detailed-errors', '--exe']
if verbose:
nose_argv.append('-v')
if nocapture:
nose_argv.append('--nocapture')
if stop:
nose_argv.append('--stop')
if nologcapture:
nose_argv.append('--nologcapture')
if withcoverage:
nose_argv.append('--with-coverage')
initial_dir = os.getcwd()
package_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(package_dir)
try:
nose.run(argv=nose_argv)
except BaseException:
error_code = -1
finally:
os.chdir(initial_dir)
return error_code

# __all__ = ['backwards', 'platform', 'config', 'tools',
# 'interface', 'drivers', 'dataio',
# 'tests', 'examples', 'runner']

__all__ = []
2 changes: 2 additions & 0 deletions cis_interface/backwards.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
file_type = types.FileType
bytes_type = str
unicode_type = str
string_type = str
np_dtype_str = 'S'
string_types = (str, unicode)
else: # pragma: Python 3
Expand All @@ -26,6 +27,7 @@
file_type = sio.IOBase
bytes_type = bytes
unicode_type = str
string_type = str
unicode = None
np_dtype_str = 'S'
string_types = (bytes, str)
Expand Down
2 changes: 1 addition & 1 deletion cis_interface/communication/CommBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class CommBase(tools.CisClass):
_commtype = 'default'
_schema_type = 'comm'
_schema = {'name': {'type': 'string', 'required': True},
'type': {'type': 'string', 'required': False}, # TODO: add values
'dtype': {'type': 'string', 'required': False}, # TODO: add values
'units': {'type': 'string', 'required': False}, # TODO: add values
'format_str': {'type': 'string', 'required': False},
'as_array': {'type': 'boolean', 'required': False},
Expand Down
Loading

0 comments on commit 22496e3

Please sign in to comment.