Skip to content

Commit

Permalink
Autoformatting (#99)
Browse files Browse the repository at this point in the history
Adds automatic formatting and CI checks.

* Autoformatting

* Autoformat

* Add precommit

* Add dev deps

* M2

* Fix file

* Fixes

* Add CI options

* Pre-commit fix

* Clean up

* Readme

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add pre-commit-ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
AlecThomson and pre-commit-ci[bot] authored Nov 29, 2023
1 parent 0755c39 commit b91d7de
Show file tree
Hide file tree
Showing 63 changed files with 10,431 additions and 7,855 deletions.
28 changes: 28 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile=black"]
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ include RMtools_1D/cats/*
include RMtools_1D/data/*
include RMtools_1D/README.txt
include RMtools_3D/README.txt

74 changes: 46 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![Tests](https://github.com/CIRADA-Tools/RM-tools/actions/workflows/python-package.yml/badge.svg) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/CIRADA-Tools/RM-Tools/master.svg)](https://results.pre-commit.ci/latest/github/CIRADA-Tools/RM-Tools/master)

# RM-Tools

RM-synthesis, RM-clean and QU-fitting on polarised radio spectra
Expand All @@ -6,48 +8,64 @@ RM-synthesis, RM-clean and QU-fitting on polarised radio spectra
polarised radio spectra.


Initial version by Cormac R. Purcell
Initial version by Cormac R. Purcell
Currently hosted by CIRADA and maintained by Cameron Van Eck

Version 1.2 is now released! Check the wiki for new functionality.

## Installation / Usage
Installation, usage instructions and detailed algorithm information can be found in the [wiki](https://github.com/CIRADA-Tools/RM-Tools/wiki).

Structure:
RMtools_1D ... Toolkit to produce Faraday spectra of single pixels.
RMtools_3D ... Toolkit to produce Faraday depth cubes.
RMutils ... Utilities for interacting with polarized data and Faraday depth

This will make the following modules importable in Python: RMtools_1D, RMtools_3D, RMutil
## Structure:
- RMtools_1D ... Toolkit to produce Faraday spectra of single pixels.
- RMtools_3D ... Toolkit to produce Faraday depth cubes.
- RMutils ... Utilities for interacting with polarized data and Faraday depth

![RM-Tools component diagram](https://github.com/CIRADA-Tools/RM-Tools/wiki/diagram.png)

Five terminal commands are added to invoke the main tools:
rmsynth1d
rmclean1d
rmsynth3d
rmclean3d
qufit
Five terminal commands are added to invoke the main tools:
- `rmsynth1d`
- `rmclean1d`
- `rmsynth3d`
- `rmclean3d`
- `qufit`

Use these commands with a -h flag to get information on the usage of each. Full documentation is on the [wiki](https://github.com/CIRADA-Tools/RM-Tools/wiki).

The following terminal commands are available to access the [additional tools](https://github.com/CIRADA-Tools/RM-Tools/wiki/Tools):
rmtools_freqfile
rmtools_calcRMSF
rmtools_testdata1D
rmtools_createchunks
rmtools_assemblechunks
rmtools_fitIcube
rmtools_peakfitcube
rmtools_testdata3D
rmtools_extractregion

The following terminal commands are available to access the [additional tools](https://github.com/CIRADA-Tools/RM-Tools/wiki/Tools):
- `rmtools_freqfile`
- `rmtools_calcRMSF`
- `rmtools_testdata1D`
- `rmtools_createchunks`
- `rmtools_assemblechunks`
- `rmtools_fitIcube`
- `rmtools_peakfitcube`
- `rmtools_testdata3D`
- `rmtools_extractregion`

If you use this package in a publication, please cite the [ASCL entry](https://ui.adsabs.harvard.edu/abs/2020ascl.soft05003P/abstract) for the time being.
A paper with a full description of the package is being prepared but is not available yet.

Questions, bug reports, and feature requests can be posted to the GitHub issues page or sent to Cameron Van Eck, cameron.vaneck (at) anu.edu.au.
## Citing
If you use this package in a publication, please cite the [ASCL entry](https://ui.adsabs.harvard.edu/abs/2020ascl.soft05003P/abstract) for the time being. A paper with a full description of the package is being prepared but is not available yet.

More information on the Canadian Initiative for Radio Astronomy Data Analysis (CIRADA) can be found at cirada.ca.

![Tests](https://github.com/CIRADA-Tools/RM-tools/actions/workflows/python-package.yml/badge.svg)
RM-Tools is open source under an MIT License.

## Contributing
Contributions are welcome. Questions, bug reports, and feature requests can be posted to the GitHub issues page or sent to Cameron Van Eck, cameron.vaneck (at) anu.edu.au.

The development dependencies can be installed via `pip` from PyPI:
```bash
pip install "RM-Tools[dev]"
```
or for a local clone:
```bash
cd RM-Tools
pip install ".[dev]"
```

Code formatting and style is handled by `black` and `isort`, with tests run by `pytest`. A `pre-commit` hook is available to handle the autoformatting. After installing the `dev` dependencies, you can install the hooks by running:
```bash
cd RM-Tools
pre-commit install
```
1 change: 0 additions & 1 deletion RMtools_1D/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@
./do_QUfit_1D_mnest.py data/Source1.dat -m 1 -p
./do_QUfit_1D_mnest.py data/Source2.dat -m 3 -p
./do_QUfit_1D_mnest.py data/Source3.dat -m 3 -p

3 changes: 2 additions & 1 deletion RMtools_1D/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import pkg_resources
__version__ = pkg_resources.get_distribution("RM-Tools").version

__version__ = pkg_resources.get_distribution("RM-Tools").version
Loading

0 comments on commit b91d7de

Please sign in to comment.