Skip to content

Commit

Permalink
Merge branch 'master' into redcorner
Browse files Browse the repository at this point in the history
  • Loading branch information
abhisrkckl committed Dec 19, 2024
2 parents 8666aef + 91be315 commit 985404a
Show file tree
Hide file tree
Showing 77 changed files with 2,594 additions and 677 deletions.
67 changes: 58 additions & 9 deletions .github/workflows/ci_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,40 @@ jobs:
matrix:
include:
- os: ubuntu-latest
python: '3.12'
python: '3.13'
tox_env: 'ephemeris_connection'
- os: ubuntu-latest
python: '3.12'
python: '3.13'
tox_env: 'black'
- os: ubuntu-latest
python: '3.12'
tox_env: 'py312-test-cov'
python: '3.13'
tox_env: 'py313-test-cov'
- os: ubuntu-latest
python: '3.12'
python: '3.13'
tox_env: 'notebooks'
# - os: ubuntu-latest
# python: '3.8'
# tox_env: 'docs'
# - os: ubuntu-latest
# python: '3.10'
# tox_env: 'py310-test-alldeps-cov'
- os: macos-12
python: '3.12'
tox_env: 'py312-test'
# - os: macos-12
# python: '3.13'
# tox_env: 'py313-test'
# - os: windows-latest
# python: '3.8'
# tox_env: 'py38-test'
- os: ubuntu-latest
python: '3.8'
python: '3.9'
tox_env: 'oldestdeps'
# - os: ubuntu-latest
# python: '3.8'
# tox_env: 'codestyle'
# uncomment this if needed to run a single test quickly
# can specify OS and python versions
# - os: macos-12
# python: '3.12'
# tox_env: 'singletest'

steps:
- name: Check out repository
Expand Down Expand Up @@ -89,3 +94,47 @@ jobs:
# with:
# name: documentation
# path: .tox/docs_out/
macos-latest-py313:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set-Up Python Env
uses: mamba-org/setup-micromamba@v1
with:
init-shell: bash
environment-name: pint
cache-environment: true
cache-downloads: true
create-args: >-
--platform osx-64
-c conda-forge
python=3.13
astropy
git
- name: Install base dependencies
shell: bash -el {0}
run: |
python -m pip install --upgrade pip
python -m pip install tox pytest hypothesis numdifftools pathos setuptools
- name: Print OS, machine info
shell: bash -el {0}
run: |
python -c "import os; print(f'os {os.uname()}')"
python -c "import platform; print(f'processor {platform.processor()}')"
python -c "import numpy as np; print(f'eps: {np.finfo(np.longdouble).eps}')"
- name: Print Python, pip, and tox versions
shell: bash -el {0}
run: |
python -c "import sys; print(f'Python {sys.version}')"
python -c "import pip; print(f'pip {pip.__version__}')"
python -c "import tox; print(f'tox {tox.__version__}')"
- name: Install PINT and requirements
shell: bash -el {0}
run: |
python -m pip install -r requirements.txt
python -m pip install -r requirements_dev.txt
python -m pip install --force-reinstall --no-deps .
- name: Run tests
shell: bash -el {0}
run: pytest -v --pyargs tests --reruns 5

2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ repos:
- id: check-merge-conflict
- id: check-symlinks
- repo: https://github.com/psf/black
rev: 24.2.0
rev: 24.10.0
hooks:
- id: black
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Active developers are indicated by (*). Authors of the PINT paper are indicated
* Bastian Beranek
* Deven Bhakta (*)
* Chloe Champagne (#)
* Colin Clark
* Jonathan Colen (#)
* H Thankful Cromartie
* Christoph Deil
Expand Down
26 changes: 0 additions & 26 deletions CHANGELOG-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,10 @@ the released changes.

## Unreleased
### Changed
- Moved the events -> TOAs and photon weights code into the function `load_events_weights` within `event_optimize`.
- Updated the `maxMJD` argument in `event_optimize` to default to the current mjd
- `maskParameter.__repr__()` output now includes the frozen attribute.
- Changed default value of `FDJUMPLOG` to `Y`
- Bumped `black` version to 24.x
### Added
- arXiv link of PINT noise paper in README
- Type hints in `pint.derived_quantities`, `pint.modelutils`, `pint.binaryconvert`, `pint.config`,
`pint.erfautils`, `pint.fits_utils`, `pint.logging` and `pint.residuals`
- Doing `model.par = something` will try to assign to `par.quantity` or `par.value` but will give warning
- `plrednoise_from_wavex()` and `pldmnoise_from_dmwavex()` functions now compute `TNRedFLow` and `TNDMFLow`
- `powerlaw_corner` function
- `TNREDFLOW` and `TNREDCORNER` parameters in `PLRedNoise`
- `TNDMFLOW` and `TNDMCORNER` parameters in `PLDMNoise`
- `PLChromNoise` component to model chromatic red noise with a power law spectrum
- Fourier series representation of chromatic noise (`CMWaveX`)
- `pint.utils.cmwavex_setup` and `pint.utils.plchromnoise_from_cmwavex` functions
- More validation for correlated noise components in `TimingModel.validate_component_types()`
### Fixed
- Bug in `DMWaveX.get_indices()` function
- Explicit type conversion in `woodbury_dot()` function
- Documentation: Fixed empty descriptions in the timing model components table
- BIC implementation
- `event_optimize`: Fixed a bug that was causing the results.txt file to be written without the median values.
- SWX model now has SWXP_0001 frozen by default, and new segments should also have SWXP frozen
- Can now properly use local files for ephemeris
- Typos in `explanation.rst` regarding local ephemeris.
### Removed
- Removed the argument `--usepickle` in `event_optimize` as the `load_events_weights` function checks the events file type to see if the
file is a pickle file.
- Removed obsolete code, such as manually tracking the progress of the MCMC run within `event_optimize`
- Unnecessary default arguments from the `powerlaw()` function.
- `download_data.sh` script and `de432s.bsp` ephemeris file
67 changes: 67 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,73 @@ and this project, at least loosely, adheres to [Semantic Versioning](https://sem
This file contains the released changes to the codebase. See CHANGELOG-unreleased.md for
the unreleased changes. This file should only be changed while tagging a new version.

## [1.1.1] 2024-012-18
### Changed
- Command line scripts now automatically do `allow_tcb` and `allow_T2` while reading par files.
- Updated the `plot_chains` function in `event_optimize` so that the subplots are a fixed size to prevent the subplots from being condensed in the case of many fit parameters.
### Added
- Time derivatives of NE_SW in `SolarWindDispersion`
- New prefix pattern for `split_prefixed_name` to handle derivatives of NE_SW
- Added an option `nbin` to `photonphase` to decide how many phase bins to use for the phaseogram
- Added an option `linearize_model` to speed up the photon phases calculation within `event_optimize` through the designmatrix.
- Added AIC and BIC calculation to be written in the post fit parfile from `event_optimize`
- When TCB->TDB conversion info is missing, will print parameter name
- Piecewise-constant model for chromatic variations (CMX)
- `add_param` returns the name of the parameter (useful for numbered parameters)
- Rerun intermittent failures in CI
- micromamba CI environment for testing macOS-latest, without tox
- models now have metadata dictionary
### Fixed
- Changed WAVE_OM units from 1/d to rad/d.
- When EQUAD is created from TNEQ, has proper TCB->TDB conversion info
- TOA selection masks will work when only TOA is the first one
- Condense code in Glitch model and add test coverage.
- `find_empty_masks` will now search through `CMX` parameters
- Fixed some docstrings for binary models.
### Removed
- macOS 12 CI

## [1.1] 2024-11-05
### Changed
* Bump oldest python to 3.9
* Change oldest dependencies: `numpy` 1.18.5 to 1.23.0; `astropy` 4.0 to 5.0.5; `scipy` 1.4.1 to 1.9.0; `matplotlib` 3.2.0 to 3.4.3
* Update CI testing to use python 3.13

## [1.0.2] 2024-10-18
### Changed
- Moved the events -> TOAs and photon weights code into the function `load_events_weights` within `event_optimize`.
- Updated the `maxMJD` argument in `event_optimize` to default to the current mjd
- `maskParameter.__repr__()` output now includes the frozen attribute.
- Changed default value of `FDJUMPLOG` to `Y`
- Bumped `black` version to 24.x
- Moved all custom exceptions and warnings to a single module `pint.exceptions`
- Changed from `setup.cfg` to `pyproject.toml`
### Added
- arXiv link of PINT noise paper in README
- Type hints in `pint.derived_quantities`, `pint.modelutils`, `pint.binaryconvert`, `pint.config`,
`pint.erfautils`, `pint.fits_utils`, `pint.logging` and `pint.residuals`
- Doing `model.par = something` will try to assign to `par.quantity` or `par.value` but will give warning
- `PLChromNoise` component to model chromatic red noise with a power law spectrum
- Fourier series representation of chromatic noise (`CMWaveX`)
- `pint.utils.cmwavex_setup` and `pint.utils.plchromnoise_from_cmwavex` functions
- More validation for correlated noise components in `TimingModel.validate_component_types()`
- ORBWAVEs model for modelling binary orbital period variations in the fourier domain
### Fixed
- Bug in `DMWaveX.get_indices()` function
- Explicit type conversion in `woodbury_dot()` function
- Documentation: Fixed empty descriptions in the timing model components table
- BIC implementation
- `event_optimize`: Fixed a bug that was causing the results.txt file to be written without the median values.
- SWX model now has SWXP_0001 frozen by default, and new segments should also have SWXP frozen
- Can now properly use local files for ephemeris
- Typos in `explanation.rst` regarding local ephemeris.
- DD/ELL1 models will check for valid SINI and raise exception if it strays, which will tell the fitter to try elsewhere
- Don't try to print AIC for wideband data in `pintk` (it's not yet implemented)
### Removed
- Removed the argument `--usepickle` in `event_optimize` as the `load_events_weights` function checks the events file type to see if the file is a pickle file.
- Removed obsolete code, such as manually tracking the progress of the MCMC run within `event_optimize`
- `download_data.sh` script and `de432s.bsp` ephemeris file

## [1.0.1] 2024-07-01
### Changed
- Avoided unnecessary creation of `SkyCoord` objects in `AstrometryEquatorial` and `AstrometryEcliptic`.
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ email [email protected] or one of the people below:
* Scott Ransom ([email protected])
* Paul Ray ([email protected])
* David Kaplan ([email protected])
* Abhimanyu Susobhanan ([email protected])

Want to do something new? Submit a github `issue <https://github.com/nanograv/PINT/issues>`_.

Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ is more complicated (but not too much).
Prerequisites
-------------

PINT requires Python 3.8+ [1]_
PINT requires Python 3.9+ [1]_

Your Python must have the package installation tool pip_ installed. Also make sure your ``setuptools`` are up to date (e.g. ``pip install -U setuptools``).

Expand Down
144 changes: 144 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
[build-system]
requires = ["setuptools>=61.2", "versioneer"]
build-backend = "setuptools.build_meta"

[project]
name = "pint-pulsar"
description = "A Pulsar Timing Package, written in Python from scratch"
authors = [
{name = "Luo Jing", email = "[email protected]"},
{name = "Scott Ransom"},
{name = "Paul Demorest"},
{name = "Paul Ray"},
{name = "et al."},
]
license = {text = "License :: OSI Approved :: BSD License"}
classifiers = [
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Astronomy",
"Topic :: Software Development :: Libraries :: Python Modules",
]
requires-python = ">=3.9"
dependencies = [
"numpy>=1.23.0",
"astropy>=5.0.5",
"pyerfa",
"scipy>=1.9.0",
"jplephem>=2.6",
"matplotlib>=3.4.3",
"emcee>=3.0.1",
"corner>=2.0.1",
"uncertainties",
"loguru",
"nestle>=0.2.0",
"numdifftools",
]
dynamic = ["version"]

[project.readme]
file = "README.rst"
content-type = "text/x-rst"

[project.urls]
Homepage = "https://github.com/nanograv/PINT"
Documentation = "https://nanograv-pint.readthedocs.io/"

[project.entry-points]
# See the docstring in versioneer.py for instructions. Note that you must
# re-run 'versioneer.py setup' after changing this section, and commit the
# resulting files.

[project.scripts]
photonphase = "pint.scripts.photonphase:main"
event_optimize = "pint.scripts.event_optimize:main"
event_optimize_multiple = "pint.scripts.event_optimize_multiple:main"
pintempo = "pint.scripts.pintempo:main"
zima = "pint.scripts.zima:main"
pintbary = "pint.scripts.pintbary:main"
fermiphase = "pint.scripts.fermiphase:main"
pintk = "pint.scripts.pintk:main"
convert_parfile = "pint.scripts.convert_parfile:main"
compare_parfiles = "pint.scripts.compare_parfiles:main"
tcb2tdb = "pint.scripts.tcb2tdb:main"
t2binary2pint = "pint.scripts.t2binary2pint:main"
pintpublish = "pint.scripts.pintpublish:main"

[tool.setuptools]
zip-safe = false
package-dir = {"" = "src"}
include-package-data = true
# These should match requirements.txt

[tool.setuptools.packages.find]
where = ["src"]
namespaces = false

[tool.setuptools.package-data]
"*" = ["*.*"]

[tool.versioneer]
VCS = "git"
style = "pep440"
versionfile_source = "src/pint/extern/_version.py"
versionfile_build = "pint/extern/_version.py"
tag_prefix = "''"
parentdir_prefix = "'pint-'"

[tool.distutils.bdist_wheel]
universal = 0

[tool.aliases]
test = "pytest"

[tool.flake8]
max-line-length = "100"
# This is an inappropriate non-error for slicing
extend-ignore = """
E203,
E265
# __init__ doesn't need a docstring, should be in the class
D107
# Other magic methods don't necessarily need docstings, what they do is well-defined
D105
# Style issues, suppress these for a full flake8 run
# E111,E114,E115,E116,E122,E123,E124,E125,E126,E127,E128,E129,E131
# E201,E202,E203,E221,E222,E225,E226,E227,E228,E231,E241,E251,E261,E262,E265,E266,E271,E272
# E301,E302,E303,E305,E306
# E401,E501,E502
# E701,E702,E703,E704,E741
# W291,W293,W391,W503,W504
# D100,D101,D102,D103,D104,D105
# D200,D202,D204,D205,D207,D208,D209,D210
# D300
# D400,D401,D402,D403,D412,D413
# RST201,RST202,RST203,RST210,RST212,RST299
# RST301,RST304,RST306
# Ugh people want to break these rules
N802 # Function names should be lowercase
N803 # argument name should be lowercase
N806 # variable should be lowercase"""
statistics = "True"
exclude = """
docs/conf.py
versioneer.py
pint/mcmc_fitter.py"""
rst-roles = """
class,
module,
func,"""

[tool.isort]
multi_line_output = 3
line_length = 88
skip_glob = ["src/pint/extern/*"]
include_trailing_comma = true
combine_as_imports = true
Loading

0 comments on commit 985404a

Please sign in to comment.