Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

238 update xradio to use python casacore 361 #241

Merged
merged 9 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/python-testing-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.9","3.10","3.11"]
python-version: ["3.9","3.10","3.11","3.12"]
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-testing-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os: ["macos-latest"]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
Expand Down
950 changes: 524 additions & 426 deletions doc/image_tutorial.ipynb

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
[project]
name = "xradio"
version = "0.0.37"
version = "0.0.38"
description = " Xarray Radio Astronomy Data IO"
authors = [
{name = "Jan-Willem Steeb", email="jsteeb@nrao.edu"},
]
license = {file = "LICENSE.txt"}
readme = "README.md"
requires-python = ">= 3.9, < 3.12"
requires-python = ">= 3.9, < 3.13"

dependencies = [
'astropy',
'casadata',
'dask',
'distributed',
'graphviper',
Expand All @@ -28,7 +27,7 @@ dependencies = [
'xarray',
'zarr',
'pyarrow',
'python_casacore>=3.5.2; sys_platform != "darwin" ',
'python_casacore>=3.6.1; sys_platform != "darwin" ',
'typing_extensions; python_version < "3.10"',
'typeguard'
]
Expand Down
2 changes: 1 addition & 1 deletion src/xradio/vis/_vis_utils/_utils/xds_helper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from importlib_metadata import version
from importlib.metadata import version
import graphviper.utils.logger as logger, multiprocessing, psutil
from typing import Any, Dict, List, Tuple, Union

Expand Down
10 changes: 5 additions & 5 deletions tests/stakeholder/test_image_stakeholder.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@


def test_image():
if os.environ["USER"] == "runner":
casa_data_dir = (importlib.resources.files("casadata") / "__data__").as_posix()
rc_file = open(os.path.expanduser("~/.casarc"), "a+") # append mode
rc_file.write("\nmeasures.directory: " + casa_data_dir)
rc_file.close()
# if os.environ["USER"] == "runner":
# casa_data_dir = (importlib.resources.files("casadata") / "__data__").as_posix()
# rc_file = open(os.path.expanduser("~/.casarc"), "a+") # append mode
# rc_file.write("\nmeasures.directory: " + casa_data_dir)
# rc_file.close()

image_name = "demo_simulated.im"
download(image_name)
Expand Down
10 changes: 5 additions & 5 deletions tests/stakeholder/test_vis_stakeholder.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
def download_and_convert_msv2_to_processing_set(msv2_name, folder, partition_scheme):

# We can remove this once there is a new release of casacore
if os.environ["USER"] == "runner":
casa_data_dir = (importlib.resources.files("casadata") / "__data__").as_posix()
rc_file = open(os.path.expanduser("~/.casarc"), "a+") # append mode
rc_file.write("\nmeasures.directory: " + casa_data_dir)
rc_file.close()
# if os.environ["USER"] == "runner":
# casa_data_dir = (importlib.resources.files("casadata") / "__data__").as_posix()
# rc_file = open(os.path.expanduser("~/.casarc"), "a+") # append mode
# rc_file.write("\nmeasures.directory: " + casa_data_dir)
# rc_file.close()

_logger_name = "xradio"
if os.getenv("VIPER_LOGGER_NAME") != _logger_name:
Expand Down
18 changes: 9 additions & 9 deletions tests/unit/test_image.py → tests/unit/disable_test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,21 +198,21 @@ class xds_from_image_test(ImageBase):
_exp_attrs["user"] = {}
_exp_attrs["history"] = None

_ran_measures_code = False
# _ran_measures_code = False

_expec_uv = {}

@classmethod
def setUpClass(cls):
cls.maxDiff = None
if not cls._ran_measures_code and os.environ["USER"] == "runner":
casa_data_dir = (
importlib.resources.files("casadata") / "__data__"
).as_posix()
rc_file = open(os.path.expanduser("~/.casarc"), "a+") # append mode
rc_file.write("\nmeasures.directory: " + casa_data_dir)
rc_file.close()
cls._ran_measures_code = True
# if not cls._ran_measures_code and os.environ["USER"] == "runner":
# # casa_data_dir = (
# # importlib.resources.files("casadata") / "__data__"
# # ).as_posix()
# # rc_file = open(os.path.expanduser("~/.casarc"), "a+") # append mode
# # rc_file.write("\nmeasures.directory: " + casa_data_dir)
# # rc_file.close()
# cls._ran_measures_code = True
cls._make_image()

@classmethod
Expand Down
Loading