Skip to content

Commit

Permalink
Merge pull request #7 from mrakitin/hex-germ-handlers
Browse files Browse the repository at this point in the history
HEX GeRM detector handlers
  • Loading branch information
mrakitin authored Dec 22, 2023
2 parents 86b8367 + 813632f commit 38d4496
Show file tree
Hide file tree
Showing 19 changed files with 485 additions and 287 deletions.
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# show coverage in CI status, not as a comment.
# show coverage in CI status, not as a comment.
comment: off
coverage:
status:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: pre-commit

on:
push:
pull_request:
workflow_dispatch:

jobs:
lint:
# pull requests are a duplicate of a branch push if within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository

name: Check code style
runs-on: ubuntu-latest
strategy:
fail-fast: false
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4

- name: Install dev dependencies
run: |
set -vxeuo pipefail
python -m pip install -r requirements-dev.txt
python -m pip list
- name: Run pre-commit
run: pre-commit run --all-files
4 changes: 4 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[settings]
line_length = 115
multi_line_output = 3
include_trailing_comma = True
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/ambv/black
rev: 23.12.0
hooks:
- id: black
language_version: python3.10
- id: black-jupyter
language_version: python3.10
exclude: ^(.*\.py)
args: [--line-length=88]
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,3 @@ Before you submit a pull request, check that it meets these guidelines:
3. The pull request should work for Python 2.7, 3.3, 3.4, 3.5 and for PyPy. Check
https://travis-ci.org/bluesky/nsls2-detector-handlers/pull_requests
and make sure that the tests pass for all supported Python versions.

95 changes: 54 additions & 41 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.githubpages',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'IPython.sphinxext.ipython_directive',
'IPython.sphinxext.ipython_console_highlighting',
'matplotlib.sphinxext.plot_directive',
'numpydoc',
'sphinx_copybutton',
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.githubpages",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"IPython.sphinxext.ipython_directive",
"IPython.sphinxext.ipython_console_highlighting",
"matplotlib.sphinxext.plot_directive",
"numpydoc",
"sphinx_copybutton",
]

# Configuration options for plot_directive. See:
Expand All @@ -55,27 +55,28 @@
numpydoc_show_class_members = False

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = 'nsls2-detector-handlers'
copyright = '2020, Brookhaven National Laboratory'
author = 'Brookhaven National Laboratory'
project = "nsls2-detector-handlers"
copyright = "2020, Brookhaven National Laboratory"
author = "Brookhaven National Laboratory"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
import nsls2_detector_handlers

# The short X.Y version.
version = nsls2_detector_handlers.__version__
# The full version, including alpha/beta/rc tags.
Expand All @@ -94,7 +95,7 @@
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
Expand All @@ -105,8 +106,9 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"
import sphinx_rtd_theme

html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Theme options are theme-specific and customize the look and feel of a theme
Expand All @@ -118,25 +120,25 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
"**": [
"relations.html", # needs 'show_related': True theme option to display
"searchbox.html",
]
}


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'nsls2-detector-handlers'
htmlhelp_basename = "nsls2-detector-handlers"


# -- Options for LaTeX output ---------------------------------------------
Expand All @@ -145,15 +147,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -163,8 +162,13 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'nsls2-detector-handlers.tex', 'nsls2-detector-handlers Documentation',
'Contributors', 'manual'),
(
master_doc,
"nsls2-detector-handlers.tex",
"nsls2-detector-handlers Documentation",
"Contributors",
"manual",
),
]


Expand All @@ -173,8 +177,13 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'nsls2-detector-handlers', 'nsls2-detector-handlers Documentation',
[author], 1)
(
master_doc,
"nsls2-detector-handlers",
"nsls2-detector-handlers Documentation",
[author],
1,
)
]


Expand All @@ -184,19 +193,23 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'nsls2-detector-handlers', 'nsls2-detector-handlers Documentation',
author, 'nsls2-detector-handlers', 'Staging repo for handlers specific to NSLS-II',
'Miscellaneous'),
(
master_doc,
"nsls2-detector-handlers",
"nsls2-detector-handlers Documentation",
author,
"nsls2-detector-handlers",
"Staging repo for handlers specific to NSLS-II",
"Miscellaneous",
),
]




# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'numpy': ('https://docs.scipy.org/doc/numpy/', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
'matplotlib': ('https://matplotlib.org', None),
"python": ("https://docs.python.org/3/", None),
"numpy": ("https://docs.scipy.org/doc/numpy/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
"matplotlib": ("https://matplotlib.org", None),
}
2 changes: 1 addition & 1 deletion nsls2_detector_handlers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from ._version import get_versions

__version__ = get_versions()['version']
__version__ = get_versions()["version"]
del get_versions


Expand Down
Loading

0 comments on commit 38d4496

Please sign in to comment.