Skip to content

Commit

Permalink
Merge pull request #108 from ratt-ru/deps-update
Browse files Browse the repository at this point in the history
Dependancy and deployment update
  • Loading branch information
o-smirnov authored Mar 22, 2023
2 parents 4026ff4 + 736f616 commit 6fff2d2
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 73 deletions.
38 changes: 28 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,51 @@ name: Ubuntu CI

on: [push, pull_request]

env:
POETRY_VERSION: 1.4.0

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8"]

os: [ ubuntu-20.04, ubuntu-22.04 ]
python-version: ["3.8", "3.9", "3.10"]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Cache Installations
id: cache-installs
uses: actions/cache@v3
with:
path: ~/.local
key: install-${{ env.INSTALL_CACHE_HASH }}-2

- name: Install Poetry
if: steps.cache-installs.outputs.cache-hit != 'true'
run: |
curl -sSL https://install.python-poetry.org | python3 - --version ${{ env.POETRY_VERSION }}
- name: Test poetry
run: poetry --version

- name: Checkout source
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Install latest versions of pip, setuptools and wheel
run: python -m pip install -U pip setuptools wheel

- name: Install shadems
run: pip install -e .[testing]
run: poetry install --extras "testing"

- name: Test command
run: poetry run python bin/shadems --help

- name: Run testsuite
run: py.test shade_ms/
run: poetry run py.test -vvv shade_ms/

# deploy:
# needs: [test]
Expand Down Expand Up @@ -72,4 +90,4 @@ jobs:
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
# with:
# user: __token__
# password: ${{ secrets.pypi_token }}
# password: ${{ secrets.pypi_token }}
39 changes: 31 additions & 8 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
release:
types: [published]

env:
POETRY_VERSION: 1.4.0

jobs:
deploy:

Expand All @@ -12,17 +15,37 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies

- name: Cache Installations
id: cache-installs
uses: actions/cache@v3
with:
path: ~/.local
key: install-${{ env.INSTALL_CACHE_HASH }}-2

- name: Install Poetry
if: steps.cache-installs.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
curl -sSL https://install.python-poetry.org | python3 - --version ${{ env.POETRY_VERSION }}
- name: Test poetry
run: poetry --version

- name: Checkout source
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Install shadems
run: poetry install

- name: Build distribution
run: poetry build

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
45 changes: 45 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[tool.poetry]
name = "shadems"
version = "0.5.2"
description = "Rapid Measurement Set plotting with dask-ms and datashader"
authors = ["Ian Heywood & RATT <ian.heywood@physics.ox.ac.uk>"]
license = "GPL-2.0-only"
homepage = "https://github.com/ratt-ru/shadeMS"
repository = "https://github.com/ratt-ru/shadeMS"
readme = "README.md"
keywords = ["Astronomy", "Visualisation", "Packaging"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Astronomy"
]
packages = [
{ include = "shade_ms" },
]

[tool.poetry.scripts]
shadems = {reference = "bin/shadems", type = "file"}

[tool.poetry.dependencies]
python = "^3.8"
datashader = "^0.13.0"
dask-ms = { version = "^0.2.15", extras = ["xarray"] }
holoviews = "^1.14.9"
matplotlib = { version = "^3.6.0" }
cmasher = "^1.6.3"
future-fstrings = "^1.2.0"
requests = "^2.27.1"
numpy = "1.23.5" # Datashader installs the latest numpy which is in conflict with <=1.35.5 required by numba
dask = { extras = ["array"], version = "2022.9.1" } # Datashader installs the latest dask which is in conflict with <2023.0.0 required by dask-ms[array]
pytest = { version = "^7.2.2", optional=true }
pytest-flake8 = { version = "^1.1.1", optional=true }

[tool.poetry.extras]
testing = ["pytest", "pytest-flake8"]

[build-system]
requires = ["setuptools", "poetry-core"]
build-backend = "poetry.core.masonry.api"
53 changes: 0 additions & 53 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion shade_ms/data_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def get_plot_data(msinfo, group_cols, mytaql, chan_freqs,
freqs=freqs,
wavel=wavel,
rows=group.row,
baselines=baselines if baselines else np.array([baseline]))
baselines=baselines if [baselines] else np.array([baseline]))

nchan = len(group.chan)
if flag is not None:
Expand Down
37 changes: 36 additions & 1 deletion shade_ms/ms_info.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,46 @@
from MSUtils.msutils import STOKES_TYPES
from casacore.tables import table
import re
import daskms
import math
import numpy as np
from collections import OrderedDict

STOKES_TYPES = {
0 : "Undefined",
1 : "I",
2 : "Q",
3 : "U",
4 : "V",
5 : "RR",
6 : "RL",
7 : "LR",
8 : "LL",
9 : "XX",
10 : "XY",
11 : "YX",
12 : "YY",
13 : "RX",
14 : "RY",
15 : "LX",
16 : "LY",
17 : "XR",
18 : "XL",
19 : "YR",
20 : "YL",
21 : "PP",
22 : "PQ",
23 : "QP",
24 : "QQ",
25 : "RCircular",
26 : "LCircular",
27 : "Linear",
28 : "Ptotal",
29 : "Plinear",
30 : "PFtotal",
31 : "PFlinear",
32 : "Pangle",
}

class NamedList(object):
"""Holds a list of names (e.g. field names), and provides common indexing and subset operations"""

Expand Down

0 comments on commit 6fff2d2

Please sign in to comment.