Skip to content

Commit

Permalink
Merge pull request #39 from klauer/mnt_migrate
Browse files Browse the repository at this point in the history
MNT/FIX: migrate to latest standards and fix documentation building
  • Loading branch information
amandashack authored Jul 18, 2023
2 parents a2c389f + 00e27a5 commit 55a62be
Show file tree
Hide file tree
Showing 68 changed files with 813 additions and 3,278 deletions.
6 changes: 3 additions & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ source =
jet_tracking
[report]
omit =
#tests
*/tests/*
*test*
#versioning
.*version.*
*_version.py
#tests
*test*
jet_tracking/tests/*
23 changes: 23 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[flake8]
exclude = .git,__pycache__,build,dist,jet_tracking/_version.py
max-line-length = 88
select = C,E,F,W,B,B950
extend-ignore = E203, E501, E226, W503, W504

# Explanation section:
# B950
# This takes into account max-line-length but only triggers when the value
# has been exceeded by more than 10% (96 characters).
# E203: Whitespace before ':'
# This is recommended by black in relation to slice formatting.
# E501: Line too long (82 > 79 characters)
# Our line length limit is 88 (above 79 defined in E501). Ignore it.
# E226: Missing whitespace around arithmetic operator
# This is a stylistic choice which you'll find everywhere in pcdsdevices, for
# example. Formulas can be easier to read when operators and operands
# have no whitespace between them.
#
# W503: Line break occurred before a binary operator
# W504: Line break occurred after a binary operator
# flake8 wants us to choose one of the above two. Our choice
# is to make no decision.
4 changes: 4 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
jet_tracking/_version.py export-subst
.git_archival.txt export-subst
24 changes: 24 additions & 0 deletions .github/workflows/standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: PCDS Standard Testing

on:
push:
pull_request:
release:
types:
- published

jobs:
standard:
uses: pcdshub/pcds-ci-helpers/.github/workflows/python-standard.yml@master
with:
# The workflow needs to know the package name. This can be determined
# automatically if the repository name is the same as the import name.
package-name: "jet_tracking"
# Extras that will be installed for both conda/pip:
testing-extras: ""
# Extras to be installed only for conda-based testing:
conda-testing-extras: ""
# Extras to be installed only for pip-based testing:
pip-testing-extras: "PyQt5"
# Set if using setuptools-scm for the conda-build workflow
use-setuptools-scm: true
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "jet_tracking/pyqt-stylesheets"]
path = jet_tracking/pyqt_stylesheets
url = https://github.com/sommerc/pyqt-stylesheets/
11 changes: 8 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: |
(?x)^(
jet_tracking/_version.py|
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
rev: v4.4.0
hooks:
- id: no-commit-to-branch
- id: trailing-whitespace
Expand All @@ -18,11 +23,11 @@ repos:
- id: debug-statements

- repo: https://github.com/pycqa/flake8.git
rev: 3.8.4
rev: 6.0.0
hooks:
- id: flake8

- repo: https://github.com/timothycrosley/isort
rev: 5.6.4
rev: 5.12.0
hooks:
- id: isort
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

13 changes: 13 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
=======
Credits
=======

Maintainer
----------

* SLAC National Accelerator Laboratory <>

Contributors
------------

Interested? See: `CONTRIBUTING.rst <CONTRIBUTING.rst>`_
103 changes: 103 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
============
Contributing
============

Contributions are welcome, and they are greatly appreciated! Every little bit
helps, and credit will always be given.

You can contribute in many ways:

Types of Contributions
----------------------

Report Bugs
~~~~~~~~~~~

Report bugs at https://github.com/pcdshub/jet_tracking/issues.

If you are reporting a bug, please include:

* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.

Fix Bugs
~~~~~~~~

Look through the GitHub issues for bugs. Anything tagged with "bug"
is open to whoever wants to implement it.

Implement Features
~~~~~~~~~~~~~~~~~~

Look through the GitHub issues for features. Anything tagged with "feature"
is open to whoever wants to implement it.

Write Documentation
~~~~~~~~~~~~~~~~~~~

jet_tracking could always use more documentation, whether
as part of the official jet_tracking docs, in docstrings,
or even on the web in blog posts, articles, and such.

Submit Feedback
~~~~~~~~~~~~~~~

The best way to send feedback is to file an issue at https://github.com/pcdshub/jet_tracking/issues.

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)

Get Started!
------------

Ready to contribute? Here's how to set up `jet_tracking` for local development.

1. Fork the `jet_tracking` repo on GitHub.
2. Clone your fork locally::

$ git clone [email protected]:your_name_here/jet_tracking.git

3. Install your local copy into a new conda environment. Assuming you have conda installed, this is how you set up your fork for local development::

$ conda create -n jet_tracking python=3.9 pip
$ cd jet_tracking/
$ pip install -e .

4. Create a branch for local development::

$ git checkout -b name-of-your-bugfix-or-feature

Now you can make your changes locally.

5. Install and enable ``pre-commit`` for this repository::

$ pip install pre-commit
$ pre-commit install

6. Add new tests for any additional functionality or bugs you may have discovered. And, of course, be sure that all previous tests still pass by running::

$ pytest -v

7. Commit your changes and push your branch to GitHub::

$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature

8. Submit a pull request through the GitHub website.

Pull Request Guidelines
-----------------------

Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put your
new functionality into a function with a docstring, and add the feature to
the list in README.rst.
3. The pull request should work for Python 3.9 and up. Check the GitHub Actions status
and make sure that the tests pass for all supported Python versions.
40 changes: 34 additions & 6 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,39 @@
Copyright (c) 2022, The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Copyright (c) 2023, The Board of Trustees of the Leland Stanford Junior
University, through SLAC National Accelerator Laboratory (subject to receipt
of any required approvals from the U.S. Dept. of Energy). All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

(1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
(1) Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

(2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
(2) Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

(3) Neither the name of the Leland Stanford Junior University, SLAC National Accelerator Laboratory, U.S. Dept. of Energy nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
(3) Neither the name of the Leland Stanford Junior University, SLAC National
Accelerator Laboratory, U.S. Dept. of Energy nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER, THE UNITED STATES GOVERNMENT, OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER, THE UNITED STATES GOVERNMENT,
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.

You are under no obligation whatsoever to provide any bug fixes, patches, or upgrades to the features, functionality or performance of the source code ("Enhancements") to anyone; however, if you choose to make your Enhancements available either publicly, or directly to SLAC National Accelerator Laboratory, without imposing a separate written license agreement for such Enhancements, then you hereby grant the following license: a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, distribute, and sublicense such Enhancements or derivative works thereof, in binary and source code form.
You are under no obligation whatsoever to provide any bug fixes, patches, or
upgrades to the features, functionality or performance of the source code
("Enhancements") to anyone; however, if you choose to make your Enhancements
available either publicly, or directly to SLAC National Accelerator Laboratory,
without imposing a separate written license agreement for such Enhancements,
then you hereby grant the following license: a non-exclusive, royalty-free
perpetual license to install, use, modify, prepare derivative works, incorporate
into other computer software, distribute, and sublicense such Enhancements or
derivative works thereof, in binary and source code form.
1 change: 0 additions & 1 deletion conda-recipe/build.sh

This file was deleted.

46 changes: 28 additions & 18 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,45 @@
{% set data = load_setup_py_data() %}
{% set package_name = "jet_tracking" %}
{% set import_name = "jet_tracking" %}
{% set version = load_file_regex(load_file=os.path.join(import_name, "_version.py"), regex_pattern=".*version = '(\S+)'").group(1) %}

package:
name: jet_tracking
version : {{ data.get('version') }}
name: {{ package_name }}
version: {{ version }}

source:
path: ..

build:
number: 1
number: 0
noarch: python
script: {{ PYTHON }} -m pip install . -vv

requirements:
build:
- python {{PY_VER}}*,>=3.6
- setuptools

- python {{PY_VER}}*,>=3.9
- setuptools_scm
- pip
run:
- python {{PY_VER}}*,>=3.6
- pcdsdevices >=2.6.0
- matplotlib
- numpy
- ophyd >=1.5.0
- bluesky >=1.6.0
- opencv
- pandas
- scikit-image
- scipy
- python {{PY_VER}}*,>=3.9
- bluesky >=1.6.0
- matplotlib
- numpy
- opencv
- ophyd >=1.5.0
- pandas
- pcdsdevices >=2.6.0
- qimage2ndarray
- scikit-image
- scipy

test:
imports:
- jet_tracking
- jet_tracking
requires:
- pytest
- pytest-cov
- pytest-qt
- pyqt

about:
home: https://github.com/pcdshub/jet_tracking
Expand Down
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# These are required for developing the package (e.g. running the tests) but
# not necessarily required for _using_ it.
coverage
flake8
pytest
pytest-cov
pytest-qt
6 changes: 3 additions & 3 deletions docs-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ ipython
matplotlib
numpydoc
sphinx
sphinx_rtd_theme
doctr
doctr-versions-menu
sphinx_rtd_theme>=1.2.0
docs-versions-menu
sphinxcontrib-jquery
Loading

0 comments on commit 55a62be

Please sign in to comment.