Skip to content

Commit

Permalink
Merge pull request #346 from HERA-Team/fix-for-release
Browse files Browse the repository at this point in the history
maint: use pypi version of hera-calibration
  • Loading branch information
steven-murray authored Jan 13, 2025
2 parents 1e8f8cf + cdef7e7 commit 83237c5
Show file tree
Hide file tree
Showing 102 changed files with 245 additions and 324 deletions.
52 changes: 0 additions & 52 deletions .flake8

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
build-n-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@main
with:
Expand All @@ -32,6 +34,3 @@ jobs:
- name: Publish to PyPI
if: startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.12.3
with:
user: __token__
password: ${{ secrets.pypi_password }}
11 changes: 0 additions & 11 deletions .isort.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ repos:
hooks:
- id: rst-backticks

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.7.0
hooks:
- id: setup-cfg-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.6
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

20 changes: 10 additions & 10 deletions docs/tutorials/end_to_end_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@
}
],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from pathlib import Path\n",
"from astropy import units, constants\n",
"\n",
"import hera_sim\n",
"from hera_sim import Simulator, DATA_PATH\n",
"from hera_sim.visibilities import MatVis, ModelData, VisibilitySimulation\n",
"import pyuvsim\n",
"import matplotlib.pyplot as plt\n",
"import matvis\n",
"import numpy as np\n",
"import pyradiosky\n",
"import pyuvdata\n",
"import pyuvsim\n",
"import uvtools\n",
"from astropy import constants, units\n",
"from astropy.coordinates import Latitude, Longitude\n",
"\n",
"import pyradiosky\n",
"import matvis\n",
"from astropy.coordinates import Latitude, Longitude"
"import hera_sim\n",
"from hera_sim import DATA_PATH, Simulator\n",
"from hera_sim.visibilities import MatVis, ModelData, VisibilitySimulation"
]
},
{
Expand Down
7 changes: 3 additions & 4 deletions docs/tutorials/hera_sim_defaults.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"import numpy as np\n",
"import uvtools\n",
"\n",
"import hera_sim\n",
"from hera_sim import Simulator\n",
"from hera_sim import DATA_PATH\n",
"from hera_sim import DATA_PATH, Simulator\n",
"from hera_sim.config import CONFIG_PATH\n",
"\n",
"%matplotlib inline"
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/hera_sim_simulator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from astropy import units\n",
"from uvtools.plot import labeled_waterfall\n",
"\n",
"import hera_sim\n",
"from hera_sim import Simulator, DATA_PATH, utils\n",
"from uvtools.plot import labeled_waterfall"
"from hera_sim import DATA_PATH, Simulator, utils"
]
},
{
Expand Down
6 changes: 4 additions & 2 deletions docs/tutorials/hera_sim_tour.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
"outputs": [],
"source": [
"%matplotlib inline\n",
"import uvtools\n",
"import numpy as np\n",
"import pylab as plt\n",
"import uvtools\n",
"from astropy.units import sday\n",
"\n",
"from hera_sim import DATA_PATH\n",
"\n",
"plt.rcParams[\"figure.figsize\"] = [14, 8]"
]
},
Expand All @@ -35,7 +37,7 @@
"metadata": {},
"outputs": [],
"source": [
"from hera_sim import foregrounds, noise, sigchain, rfi, defaults"
"from hera_sim import defaults, foregrounds, noise, rfi, sigchain"
]
},
{
Expand Down
5 changes: 3 additions & 2 deletions docs/tutorials/mutual_coupling_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@
}
],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import hera_sim\n",
"import numpy as np\n",
"import uvtools\n",
"from astropy import constants, units\n",
"from pyuvdata import UniformBeam\n",
"\n",
"import hera_sim\n",
"\n",
"%matplotlib inline"
]
},
Expand Down
13 changes: 7 additions & 6 deletions docs/tutorials/polybeam_simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@
}
],
"source": [
"from hera_sim.visibilities import VisibilitySimulation, ModelData, MatVis\n",
"from hera_sim.beams import PerturbedPolyBeam\n",
"from hera_sim import io\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from astropy.coordinates.angles import Latitude, Longitude\n",
"import numpy as np\n",
"from astropy import units as un\n",
"from pyradiosky import SkyModel"
"from astropy.coordinates.angles import Latitude, Longitude\n",
"from pyradiosky import SkyModel\n",
"\n",
"from hera_sim import io\n",
"from hera_sim.beams import PerturbedPolyBeam\n",
"from hera_sim.visibilities import MatVis, ModelData, VisibilitySimulation"
]
},
{
Expand Down
7 changes: 3 additions & 4 deletions docs/tutorials/visibility_simulator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
"from hera_sim import DATA_PATH\n",
"from hera_sim.visibilities import MatVis, ModelData, VisibilitySimulation\n",
"\n",
"\n",
"# Path to the example pyuvsim configuration files.\n",
"# These can be found in `hera_sim.DATA_PATH` to follow along.\n",
"config_file = (\n",
Expand Down Expand Up @@ -310,8 +309,8 @@
}
],
"source": [
"from pyuvsim.simsetup import initialize_uvdata_from_params, _complete_uvdata\n",
"from pyradiosky import SkyModel\n",
"from pyuvsim.simsetup import _complete_uvdata, initialize_uvdata_from_params\n",
"\n",
"# Here, the configuration file uses the `PolyBeam` defined in hera_sim directly in the\n",
"# pyuvsim configuration file, as the format accepts custom beams.\n",
Expand Down Expand Up @@ -391,9 +390,9 @@
}
],
"source": [
"from pyradiosky import SkyModel\n",
"from astropy.coordinates import Longitude, Latitude\n",
"from astropy import units as u\n",
"from astropy.coordinates import Latitude, Longitude\n",
"from pyradiosky import SkyModel\n",
"\n",
"# Point Soruce Model ##\n",
"component_type = \"point\"\n",
Expand Down
113 changes: 96 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,103 @@
[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[tool.black]
line-length = 88
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''
[project]
name = "hera_sim"
description = "A collection of simulation routines describing the HERA instrument."
readme = "README.rst"
authors = [
{name="HERA Team"},
{name="Steven Murray", email="murray.steveng@gmail.com"}
]
license = {text="MIT"}
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering :: Astronomy",
"Topic :: Scientific/Engineering :: Physics",
]
dynamic=["version"]
requires-python = ">=3.10"

dependencies = [
"astropy",
"astropy-healpix",
"cached-property",
"deprecation",
"hera-cli-utils>=0.1.0",
"numpy>=2",
"pyuvdata>=3.1.2",
"pyuvsim>=1.4",
"pyyaml>=5.1",
"rich",
"scipy",
"typing-extensions;python_version<'3.11'",
]

[project.optional-dependencies]
all = [
"hera-sim[vis,bda,cal,gpu]",
]
bda = [
"bda"
]
cal = [
"hera-calibration>3.6.1"
]
dev = [
"hera-sim[docs,tests]",
]
docs = [
"fftvis",
"furo",
"ipython",
"matvis>=1.3.0",
"nbsphinx",
"numpydoc>=0.8",
"pyradiosky>=0.1.2",
"sphinx>=1.8,<7.2",
"sphinx-autorun",
]
tests = [
"coverage>=4.5.1",
"hera-sim[bda,cal,vis]",
"matplotlib>=3.4.2",
"pre-commit",
"pytest>=3.5.1",
"pytest-cov>=2.5.1",
"uvtools",
]
vis = [
"fftvis>=0.1.0",
"line-profiler",
"matvis>=1.2.1",
"mpi4py",
"pyradiosky>=0.1.2",
]

[project.urls]
Documentation = "https://hera_sim.readthedocs.org"
Repository = "https://github.com/HERA-Team/hera_sim"

[tool.setuptools]
script-files = ["scripts/hera-sim-simulate.py", "scripts/hera-sim-vis.py"]

[tool.pytest.ini_options]
addopts = "--cov hera_sim --cov-config=.coveragerc --cov-report xml:./coverage.xml --durations=25 --verbose"
norecursedirs = [
"dist",
"build",
".tox",
]
testpaths = "hera_sim/tests"

[tool.ruff]
line-length = 88
Expand All @@ -35,6 +113,7 @@ select = [
"E", # pycodestyle
"W", # pycodestyle warning
"NPY", # numpy-specific rules
"I", # isort
]

ignore = [
Expand Down
3 changes: 2 additions & 1 deletion scripts/hera-sim-simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

import argparse
import copy
import numpy as np
import os
import sys

import numpy as np
import yaml
from astropy import units
from astropy.coordinates import Angle
Expand Down
Loading

0 comments on commit 83237c5

Please sign in to comment.