Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre commit #359

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ omit = */tests/*

[report]
omit = */tests/*

38 changes: 38 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[flake8]
ignore =
E203 # No space before colon
W503
C408 # Ignore using dict() function.
D107 # Missing docstring in __init__ (we do it in the class)
D401 # "First line should be in imperative mood" -- this doesn't work for properties, see https://github.com/PyCQA/pydocstyle/issues/301
A003 # allow method names to be the same as python builtins
RST210 # inline strong start-string without end-string. This is OK in the case of **kwargs in parameters.
D # TODO: add doc checks back in by removing this line!
E501 # TODO: add this back in to ensure lines aren't too long!
T001 # Allow print statements (eventually should use logging instead...)
B008 # allow function calls in argument defaults.
A002 # allow arguments to shadow python builtins
max-line-length = 88
# TODO: max-complexity should be 18!
max-complexity = 75
per-file-ignores =
docs/conf.py:D,A
*/__init__.py:F401
scripts/*:T001,T201
rst-roles =
class
func
mod
data
const
meth
attr
exc
obj
rst-directives =
note
warning
versionadded
versionchanged
deprecated
seealso
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ eggs/
*egg-info
*GIT_INFO
*ipynb_checkpoints
hera_pspec/_version.py
.vscode/
45 changes: 45 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
exclude: 'setup.py|hera_pspec/data/|pipelines/web_ui/w3.css'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: check-ast
- id: check-json
# - id: check-merge-conflict
- id: check-xml
- id: check-yaml
args: ['--unsafe'] # Only check syntax rather than try to load.
- id: debug-statements
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: mixed-line-ending
args: ['--fix=no']

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1 # pick a git hash / tag to point to
hooks:
- id: flake8
additional_dependencies:
- flake8-rst-docstrings
- flake8-docstrings
- flake8-builtins
- flake8-logging-format
- flake8-rst-docstrings
- flake8-rst
- flake8-markdown
- flake8-bugbear
- flake8-comprehensions
- flake8-print

- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
- id: rst-backticks
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
v0.2.0 (2019-08-09)
* Python 3 compatibility.
* Allow cross-polarization spectra to be calculated as long as they
* Allow cross-polarization spectra to be calculated as long as they
aren't beam-normalized; polarizations now specified as polpairs.
* Time-dependent noise power spectra capability in generate_noise.
* Methods to fetch redundant baselines/blpairs from UVPSpec objects.
* Exact normalization mode (Saurabh Singh) with optimization (Ronan
* Exact normalization mode (Saurabh Singh) with optimization (Ronan
Legin).
* Updated covariance handling, incl. averaging and analytic variance
* Updated covariance handling, incl. averaging and analytic variance
(Jianrong Tan).
* New 'lazy covariance' weighting mode (Aaron Ewall-Wice).
* Fix bug where little_h was passed incorrectly (Zachary Martinot).
Expand All @@ -15,6 +15,6 @@ v0.2.0 (2019-08-09)
* Various minor interface changes and improved tests.

v0.1.0 (2018-07-18)
* Initial release; implements core functionality,
* Initial release; implements core functionality,
documentation, and tests.
* Includes basic pipeline run scripts.
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
[![codecov](https://codecov.io/gh/HERA-Team/hera_pspec/branch/master/graph/badge.svg)](https://codecov.io/gh/HERA-Team/hera_pspec)
[![Documentation](https://readthedocs.org/projects/hera-pspec/badge/?version=latest)](https://readthedocs.org/projects/hera-pspec/badge/?version=latest)

The ``hera_pspec`` library provides all of the tools and data structures needed to perform a delay
spectrum analysis on interferometric data. The input data can be in any format supported by ``pyuvdata``,
The ``hera_pspec`` library provides all of the tools and data structures needed to perform a delay
spectrum analysis on interferometric data. The input data can be in any format supported by ``pyuvdata``,
and the output data are stored in HDF5 containers.

For usage examples and documentation, see http://hera-pspec.readthedocs.io/en/latest/.

## Installation
Preferred method of installation for users is simply `pip install .`
(or `pip install git+https://github.com/HERA-Team/hera_pspec`). This will install
(or `pip install git+https://github.com/HERA-Team/hera_pspec`). This will install
required dependencies. See below for manual dependency management.

### Dependencies
If you are using `conda`, you may wish to install the following dependencies manually
to avoid them being installed automatically by `pip`::

$ conda install -c conda-forge "numpy>=1.15" "astropy>=2.0" h5py pyuvdata scipy matplotlib pyyaml

### Developing
If you are developing `hera_pspec`, it is preferred that you do so in a fresh `conda`
environment. The following commands will install all relevant development packages::
Expand All @@ -30,9 +30,9 @@ environment. The following commands will install all relevant development packag
$ conda create -n hera_pspec python=3
$ conda activate hera_pspec
$ conda env update -n hera_pspec -f ci/hera_pspec_tests.yml
$ pip install -e .
$ pip install -e .

This will install extra dependencies required for testing/development as well as the
This will install extra dependencies required for testing/development as well as the
standard ones.

### Running Tests
Expand All @@ -42,10 +42,10 @@ From the source `hera_pspec` directory run: `pytest`.

## Running `hera_pspec`

See the documentation for an
[overview and examples](http://hera-pspec.readthedocs.io/en/latest/pspec.html)
of how to run `hera_pspec`. There are also some example Jupyter notebooks,
including [`examples/PS_estimation_examples.ipynb`](examples/PS_estimation_example.ipynb)
(a brief tutorial on how to create delay spectra), and
[`examples/PSpecBeam_tutorial.ipynb`](examples/PSpecBeam_tutorial.ipynb) (a brief
See the documentation for an
[overview and examples](http://hera-pspec.readthedocs.io/en/latest/pspec.html)
of how to run `hera_pspec`. There are also some example Jupyter notebooks,
including [`examples/PS_estimation_examples.ipynb`](examples/PS_estimation_example.ipynb)
(a brief tutorial on how to create delay spectra), and
[`examples/PSpecBeam_tutorial.ipynb`](examples/PSpecBeam_tutorial.ipynb) (a brief
tutorial on handling beam objects).
1 change: 0 additions & 1 deletion ci/hera_pspec_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ dependencies:
- git+https://github.com/RadioAstronomySoftwareGroup/pyuvdata
- git+https://github.com/HERA-Team/uvtools
- git+https://github.com/HERA-Team/hera_cal

2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Loading