Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d3b6756
use pyproj.toml, src layout
bhazelton Apr 3, 2025
c85ccb7
fix mistaken change to ci postgres setup
bhazelton Sep 24, 2025
ec19ff6
fix some ci issues
bhazelton Sep 24, 2025
3582126
fix handling of version in cm_utils
bhazelton Sep 24, 2025
6257738
fix some issues with db url containing "+psycopg"
bhazelton Sep 24, 2025
15cbbdd
turn off branch coverage for now
bhazelton Sep 25, 2025
96c1fa1
test against python 3.13 because it's installed on site
bhazelton Sep 25, 2025
5f4c476
add some debugging for redis initialization
bhazelton Sep 25, 2025
a4fab59
fix debugging print
bhazelton Sep 25, 2025
45b3ed0
more debugging fixes
bhazelton Sep 25, 2025
18453f8
update codecov action arguments
mkolopanis Sep 26, 2025
f4d1ed5
add debugging stuff for codecov, remove redis debug stuff
bhazelton Sep 26, 2025
200e6d7
tweak .coveragerc
bhazelton Sep 26, 2025
3ce81e3
try another coverage tweak
bhazelton Sep 26, 2025
7246560
cleanup old check warnings stuff
bhazelton Sep 26, 2025
1e60d64
add redis to min_versions
bhazelton Sep 26, 2025
dfbe153
fix a min deps test error
bhazelton Sep 27, 2025
bd6ce2a
switch up install
bhazelton Sep 27, 2025
4401c43
run warnings tests on 3.11 until hera_corr_cm fixes are in
bhazelton Sep 27, 2025
6534e12
replace pkg_resources.parse_version with packaging.version.Version
bhazelton Mar 2, 2026
6767457
use context managers for sessions in setup and tear down fixture
bhazelton Mar 4, 2026
da8c4f4
full repo checkouts to avoid setuptools_scm warnings
bhazelton Mar 4, 2026
f5a3d9f
Increase minimum pyuvdata version to 2.3.0
bhazelton Mar 4, 2026
83d2cdc
use more context managers for session
bhazelton Mar 4, 2026
28eb44c
try setting PYTHONTRACEMALLOC to understand the CI warnings
bhazelton Mar 4, 2026
46cce80
use more context managers
bhazelton Mar 9, 2026
1e0835b
update resource warning filter
bhazelton Mar 9, 2026
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
22 changes: 20 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
[run]
omit = */tests/*
omit =
*/tests/*
*/docs/*
setup.py
source =
hera_mc

[report]
omit = */tests/*
omit =
*/tests/*
*/docs/*
setup.py

show_missing = true

[paths]
source =
src
*/site-packages
tests =
tests
*/tests
90 changes: 65 additions & 25 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
services:
postgres:
image: postgres:10.8
Expand All @@ -52,7 +52,7 @@ jobs:
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
fetch-depth: 0

- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
Expand All @@ -73,7 +73,7 @@ jobs:

- name: Install
run: |
pip install --no-deps .
pip install --no-deps -e .

- name: Setup postgres
run: |
Expand All @@ -100,7 +100,7 @@ jobs:
DOCKER_NAME=`/usr/bin/docker ps -a --filter="ancestor=redis" --format='{{.Names}}'`
/usr/bin/docker stop $DOCKER_NAME
sudo rm /data/dump.rdb
sudo cp hera_mc/data/test_data/dump.rdb /data
sudo cp src/hera_mc/data/test_data/dump.rdb /data
/usr/bin/docker start $DOCKER_NAME
DOCKER_IP=`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DOCKER_NAME`
echo "$DOCKER_IP redishost" | sudo tee -a /etc/hosts
Expand All @@ -111,16 +111,21 @@ jobs:
env:
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} # get randomly assigned published port

- uses: codecov/codecov-action@v1.5.2
if: matrix.os == 'ubuntu-latest' && success()
- name: check coverage report
run: |
ls
cat coverage.xml

- uses: codecov/codecov-action@v5
if: success()
with:
token: ${{secrets.CODECOV_TOKEN}} #required
file: ./coverage.xml #optional
files: ./coverage.xml #optional

min_deps:
env:
ENV_NAME: min_deps
PYTHON: "3.11"
PYTHON: "3.12"
WITH_SUDO: yes
# use localhost for the host here because we are running the job on the VM.
POSTGRES_HOST: localhost
Expand Down Expand Up @@ -152,7 +157,7 @@ jobs:
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
fetch-depth: 0

- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
Expand Down Expand Up @@ -194,18 +199,20 @@ jobs:

- name: Run Tests
run: |
mkdir -p empty
cd empty
pytest --pyargs hera_mc --cov=hera_mc --cov-config=../.coveragerc --cov-report xml:../coverage.xml --junitxml=../test-reports/xunit.xml
cd ..
python -m pytest --cov=hera_mc --cov-config=.coveragerc --cov-report xml:./coverage.xml --junitxml=test-reports/xunit.xml
env:
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} # get randomly assigned published port

- uses: codecov/codecov-action@v1.5.2
- name: check coverage report
run: |
ls
cat coverage.xml

- uses: codecov/codecov-action@v5
if: success()
with:
token: ${{secrets.CODECOV_TOKEN}} #required
file: ./coverage.xml #optional
files: ./coverage.xml #optional

min_versions:
env:
Expand Down Expand Up @@ -238,11 +245,18 @@ jobs:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis
env:
REDIS_HOST: redishost
ports:
- 6379:6379
options: --entrypoint redis-server --network-alias $REDIS_HOST -v /data:/data --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
fetch-depth: 0

- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
Expand Down Expand Up @@ -282,20 +296,35 @@ jobs:
env:
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} # get randomly assigned published port

- name: Initialize Redis
# Grab the name of the redis container with bash magic
# stop the container, replace the dump file with our save file
# add the IP to the hosts file to preserve some hardcoded defaults
run: |
DOCKER_NAME=`/usr/bin/docker ps -a --filter="ancestor=redis" --format='{{.Names}}'`
/usr/bin/docker stop $DOCKER_NAME
sudo rm /data/dump.rdb
sudo cp src/hera_mc/data/test_data/dump.rdb /data
/usr/bin/docker start $DOCKER_NAME
DOCKER_IP=`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DOCKER_NAME`
echo "$DOCKER_IP redishost" | sudo tee -a /etc/hosts

- name: Run Tests
run: |
mkdir -p empty
cd empty
pytest --pyargs hera_mc --cov=hera_mc --cov-config=../.coveragerc --cov-report xml:../coverage.xml --junitxml=../test-reports/xunit.xml
cd ..
python -m pytest --cov=hera_mc --cov-config=.coveragerc --cov-report xml:./coverage.xml --junitxml=test-reports/xunit.xml
env:
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} # get randomly assigned published port

- uses: codecov/codecov-action@v1.5.2
- name: check coverage report
run: |
ls
cat coverage.xml

- uses: codecov/codecov-action@v5
if: success()
with:
token: ${{secrets.CODECOV_TOKEN}} #required
file: ./coverage.xml #optional
files: ./coverage.xml #optional

warning_tests:
env:
Expand Down Expand Up @@ -360,7 +389,7 @@ jobs:

- name: Install
run: |
pip install --no-deps .
pip install --no-deps -e .

- name: Setup postgres
run: |
Expand All @@ -387,13 +416,24 @@ jobs:
DOCKER_NAME=`/usr/bin/docker ps -a --filter="ancestor=redis" --format='{{.Names}}'`
/usr/bin/docker stop $DOCKER_NAME
sudo rm /data/dump.rdb
sudo cp hera_mc/data/test_data/dump.rdb /data
sudo cp src/hera_mc/data/test_data/dump.rdb /data
/usr/bin/docker start $DOCKER_NAME
DOCKER_IP=`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DOCKER_NAME`
echo "$DOCKER_IP redishost" | sudo tee -a /etc/hosts

- name: Run Tests
run: |
python -m pytest -W error
python -m pytest -W error --cov=hera_mc --cov-config=.coveragerc --cov-report xml:./coverage.xml --junitxml=test-reports/xunit.xml
env:
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} # get randomly assigned published port

- name: check coverage report
run: |
ls
cat coverage.xml

- uses: codecov/codecov-action@v5
if: success()
with:
token: ${{secrets.CODECOV_TOKEN}} #required
files: ./coverage.xml #optional
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ target/
hera_mc/GIT_INFO
.pytest_cache

hera_mc/data/test_data/hera_mc_test.db
src/hera_mc/data/test_data/hera_mc_test.db
9 changes: 0 additions & 9 deletions MANIFEST.in

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
hera_mc
=======

![](https://github.com/HERA-Team/hera_mc/workflows/Run%20Tests/badge.svg?branch=master)
[![codecov](https://codecov.io/gh/HERA-Team/hera_mc/branch/master/graph/badge.svg)](https://codecov.io/gh/HERA-Team/hera_mc)
![](https://github.com/HERA-Team/hera_mc/actions/workflows/testsuite.yml/badge.svg?branch=main)
[![codecov](https://codecov.io/gh/HERA-Team/hera_mc/branch/main/graph/badge.svg)](https://codecov.io/gh/HERA-Team/hera_mc)

This is the main repository for HERA's monitor and control subsystems.

Expand Down Expand Up @@ -52,10 +52,10 @@ The required dependencies are:
- cartopy >=0.21
- numpy >= 1.23
- psycopg>=3.2.2
- pyuvdata >= 2.2.9
- pyuvdata >= 2.3.0
- pyyaml >= 5.4.1
- redis-py >= 4.3.4 (Note that this is called "redis" on pypi and "redis-py" on conda)
- setuptools_scm <7.0|>=7.0.3
- setuptools_scm >= 8.1
- sqlalchemy >= 2.0

the optional dependencies are:
Expand Down
1 change: 1 addition & 0 deletions alembic/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
db_data = config_data.get("databases")
db_data = db_data.get(db_name)
db_url = db_data.get("url")
# Add "+psycopg" to the url to ensure sqlalchemy uses the right psycopg package
if "postgresql" in db_url and "postgresql+psycopg" not in db_url:
db_url = db_url.replace("postgresql", "postgresql+psycopg")
config.set_main_option("sqlalchemy.url", db_url)
Expand Down
2 changes: 1 addition & 1 deletion ci/example_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"mode": "testing"
},
"sqlite_testing":{
"url": "sqlite:///~/hera_mc/data/test_data/hera_mc_test.db",
"url": "sqlite:///~/src/hera_mc/data/test_data/hera_mc_test.db",
"mode": "testing"
}
}
Expand Down
4 changes: 2 additions & 2 deletions ci/min_deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dependencies:
- psycopg>=3.2.2
- pytest>=6.2.5
- pytest-cov
- pyuvdata>=2.2.9
- pyuvdata>=2.3.0
- pyyaml>=5.4.1
- redis-py>=4.3.4
- setuptools_scm<7.0|>=7.0.3
- setuptools_scm>=8.1
- sqlalchemy>=2.0
4 changes: 2 additions & 2 deletions ci/min_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ dependencies:
- pytest==6.2.5
- pytest-cov
- python-dateutil==2.8.2
- pyuvdata==2.2.9
- pyuvdata==2.3.0
- pyyaml==5.4.1
- redis-py==4.3.4
- setuptools_scm<7.0
- setuptools_scm==8.1
- sqlalchemy==2.0.0
- tabulate==0.8.10
- pip:
Expand Down
4 changes: 2 additions & 2 deletions ci/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ dependencies:
- cartopy>=0.21.0
- numpy>=1.23.*
- psycopg>=3.2.2
- pyuvdata>=2.2.9
- pyuvdata>=2.3.0
- pyyaml>=5.4.1
- redis-py>=4.3.4
- setuptools_scm<7.0|>=7.0.3
- setuptools_scm>=8.1
- sqlalchemy>=2.0
- pip
- pip:
Expand Down
4 changes: 2 additions & 2 deletions ci/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ dependencies:
- pytest>=6.2.5
- pytest-cov
- python-dateutil>=2.8.2
- pyuvdata>=2.2.9
- pyuvdata>=2.3.0
- pyyaml>=5.4.1
- redis-py>=4.3.4
- setuptools_scm<7.0|>=7.0.3
- setuptools_scm>=8.1
- sqlalchemy>=2.0
- tabulate>=0.8.10
- tornado>=6.2
Expand Down
4 changes: 2 additions & 2 deletions environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ dependencies:
- pytest>=6.2.5
- pytest-cov
- python-dateutil>=2.8.2
- pyuvdata>=2.2.9
- pyuvdata>=2.3.0
- pyyaml>=5.4.1
- redis-py>=4.3.4
- setuptools_scm<7.0|>=7.0.3
- setuptools_scm>=8.1
- sqlalchemy>=1.4.0
- tabulate>=0.8.10
- tornado>=6.2
20 changes: 0 additions & 20 deletions hera_mc/branch_scheme.py

This file was deleted.

Loading
Loading