Skip to content

Commit

Permalink
Merge pull request NSLS-II#43 from awalter-bnl/add-travis-yml
Browse files Browse the repository at this point in the history
Adding .yml file and enc file for Travis integration and doc creation
  • Loading branch information
danielballan authored Oct 17, 2018
2 parents ba0c350 + 24cb55e commit 67833bf
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 16 deletions.
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
language: python
python:
- 3.6
cache:
directories:
- $HOME/.cache/pip
- $HOME/.ccache # https://github.com/travis-ci/travis-ci/issues/5853

install:
# Install this package and the packages listed in requirements.txt.
- pip install .
# Install extra requirements for running tests and building docs.
- pip install -r requirements-dev.txt

env:
global:
# Doctr deploy key for NSLS-II/nslsii
- secure: "FhNkkbod0Wc/zUf9cTvwziAYHcjfte2POf+hoVSmC+v/RcYKCNCo+mGGMhF9F4KyC2nzvulfzow7YXoswZqav4+TEEu+mpuPaGlf9aqp8V61eij8MVTwonzQEYmHAy3KatwXxyvvhQpfj3gOuDVolfOg2MtNZi6QERES4E1sjOn714fx2HkVxqH2Y8/PF/FzzGeJaRlVaVci0EdIJ5Ss5c5SjO6JGgxj4hzhTPHjTaLjdLHlVhuB9Yatl80zbhGriljLcDQTHmoSODwBpAh5YLDUZq6B9vomaNB9Hb3e0D5gItjOdj53v6AsHU8LkncZMvsgJgh2sZZqMO6nkpHcYPwJgbPbKd3RtVlk6Kg/tvKQk0rMcxl5fFFeD2i9POnANg/xJsKN6yAEY3kaRwQtajQmlcicSa/wdwv9NhUTtBmA/mnyzxHbQXrB0bEc2P2QVu7U8en6dWaOAqc1VCMrWIhp2ADNWb7JZhYj70TgmExIU3UH8qlMb6dyx50SJUE9waJj3fiiZVkjh+E568ZRSMvL9n+bLlFt4uDT4AysSby6cj+zjfNViKFstTAqjyd5VJEvCoUu73vNzWEiWFtEvKKVL1P3pbLN/G3aSSJMa5fc1o+2lRUwdwNNOOdH6iKBDZGNpE8nGDlTP2b2dhFyEt8nICKJhbgU208jhyyH8Vk="

script:
- coverage run -m pytest # Run the tests and check for test coverage.
- coverage report -m # Generate test coverage report.
- codecov # Upload the report to codecov.
- flake8 --max-line-length=79
- set -e # Stop here if anything fails above
#commenting out the lines below until there are docs to build.
# - make -C docs html # Build the documentation
# - pip install doctr
# - doctr deploy --built-docs docs/build/html . # Publish the documentation
1 change: 1 addition & 0 deletions github_deploy_key_nsls_ii_nslsii.enc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gAAAAABbxz01GnyDC8lnHpPlT8i32N3mm2qpw6kSutu50zS_DzikWfBA2IdZtNwROhcddRSgExw8Mr0u254TMM_2jgN_c4GnMar40MjLD_sogS0ZF82vB0p_UTJqzAwimo1euMPalDqBvkoNasnRBz5mCIsrNsbE2QF3zuXqNM0EzTfgcie4f6xGo6C3PfNrxaZUqmlvt4GV5nle4wm7pD58BGiFwkXBqYB8uC6YC4NvkR-iR7jJonldxvcuspM6VZRlPAV7oIG2XTgouY0N3vIRaDpc595xqQwqooHGN9b-dWKWPU7q1dLbrz9SNuqJNtZaP0Q3md5eXdw_6rw9Lbq5GjEsSqhi1PRT8lQFByPNBnfZWGcNkMubjaMwq9psOQwl3dXdLHH-tGBnyB2DSRDdiyZ4nWgVt9SmHvnmvcapZUOjEStLjHkSjQBVb3lfIs7HamuU2TUMPJAUIRmvzKpmVX8m98A1seFlapJSU-6f23nJjAabHBnpJjSvw8ifuR2qWaNgBlVZrNs2neMpP7DgYdNAK-iE-inoDx3KsHb2ZidebxTLsS74ZifCWNA_Oz0QJLOuym2yYrKfdIde3VKnP20lHVYXyqcaBWcgOS70G33C-_vpm6fMnXx5uuRpnDi8bAoZI8IEd7Dq709VJ0YKVV32PYPfr6bjUdE64rdXn2Txl-7dtgV3OweivHqH63AoQ87-bl-uqFj81tVRmix-4WoHyEGMwhOW7ZkJcuDa0FwnS6Wg7NMBY2AbhcIDIq5p7wl-0oAtP9YCOG0gjPIn_L2SHWzFR_iNDbKvlHcucLjwczQOnWm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AcNCZ3xtqyPO1Rf3sh53elsXW7gwhgzbPLe0opjexYDAC0OMiH_YJOZ4QVhu69SLc_jjfBH3D55qEg6r_AVETCCnNfF3iZwagkj75_aT24kr-W9vBVOctn3RngoKGsCYQvqZDTPSHjRpbsXe2pd7-a8tMRMXFaar7rBiXkeRjMkUxQuA5uxDKG1Fh-fpLmJU9haNmOL3xSysFu2Ep6eNbGYZ3djHKoHOL2kQYPEBIZ17R1tcO5DWgIxo0AQN4WOW5JkJh1s4CMtQAmDa7yRhDI49nQ8UByC1BIKgP1NJ99kD4wxS0IUHZ90zPcDq59UhtI1Xkr8J99Enp6u5Y1Qnhaf0l1WBo8O4qvHkRQl9oP8KfUz642S46w==
6 changes: 4 additions & 2 deletions nslsii/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
from IPython import get_ipython
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions


def import_star(module, ns):
public = lambda name: not name.startswith('_')
def public(name):
return not name.startswith('_')
ns.update({name: getattr(module, name)
for name in dir(module) if public(name)})
for name in dir(module) if public(name)})


def configure_base(user_ns, broker_name, *,
Expand Down
12 changes: 6 additions & 6 deletions nslsii/common/ipynb/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import platform
from IPython.display import HTML


def get_sys_info():
"""Display info on system and output as nice HTML"""
spacer = "<tr><td>&nbsp;</td><td>&nbsp;</td></tr>"

html = '<h3>System Information for {}</h3>'.format(platform.node())
html += '<table>'

Expand All @@ -31,6 +30,7 @@ def get_sys_info():
html += '</table>'
return HTML(html)


def show_kernels():
"""Show all IPython Kernels on System"""

Expand All @@ -56,12 +56,12 @@ def show_kernels():
p = psutil.Process(pinfo['pid']).cpu_percent(0.1)
html += '<td>{}%</td>'.format(p)
html += '<td>{:.4} Mb</td>'.format(pinfo['memory_info'].vms /
1024**3)
html += '<td>{:.3}%</td>'.format(100 *pinfo['memory_info'].vms /
total_mem)
1024**3)
html += '<td>{:.3}%</td>'.format(100 *
pinfo['memory_info'].vms /
total_mem)
html += '<td>{}</td>'.format(pinfo['status'])
html += '</tr>'

html += '</table>'
return HTML(html)

5 changes: 3 additions & 2 deletions nslsii/detectors/trigger_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def trigger_external(self):
self._status._finished()
# TODO this timestamp is inaccurate!
if self.mode_settings.scan_type.get() != 'fly':
# Don't dispatch images for fly-scans - they are bulk read at the end
# Don't dispatch images for fly-scans-they are bulk read at the end
self.dispatch(self._image_name, ttime.time())
return self._status

Expand All @@ -173,7 +173,8 @@ def _reset_data(self):
def bulk_read(self, timestamps):
image_name = self.image_name

uids = [self.generate_datum(self.image_name, ts, {}) for ts in timestamps]
uids = [self.generate_datum(self.image_name, ts, {})
for ts in timestamps]

# clear so unstage will not save the images twice:
self._reset_data()
Expand Down
1 change: 0 additions & 1 deletion nslsii/detectors/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import print_function
import os
from ophyd import Signal


def makedirs(path, mode=0o777):
Expand Down
3 changes: 1 addition & 2 deletions nslsii/detectors/xspress3.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import time
import time as ttime
import logging
import uuid

from pathlib import PurePath
from .utils import makedirs
Expand Down Expand Up @@ -95,7 +94,7 @@ def read(self):
timestamp = time.time()

uids = [self._reg.register_datum(
self._filestore_res, {'frame': self.parent._abs_trigger_count -1,
self._filestore_res, {'frame': self.parent._abs_trigger_count - 1,
'channel': chan})
for chan in self.channels]

Expand Down
11 changes: 11 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# These are required for developing the package (running the tests, building
# the documentation) but not necessarily required for _using_ it.
codecov
coverage
flake8
ipython
matplotlib
numpydoc
pytest
sphinx
sphinx_rtd_theme
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
requirements = f.read().splitlines()

setuptools.setup(
name='nslsii',
name='nslsii',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
cmdclass=versioneer.get_cmdclass(),
license="BSD (3-clause)",
packages=setuptools.find_packages(),
description='Tools for data collection and analysis at NSLS-II',
author='Stuart B. Wilkins',
author='Stuart B. Wilkins',
author_email='[email protected]',
install_requires=requirements,
)

0 comments on commit 67833bf

Please sign in to comment.