Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision d745e74710ab581d489e815095d0dd4ee91e9c35 authored by Bryna Hazelton on 15 September 2025, 18:00:43 UTC, committed by Jonathan Pober on 15 September 2025, 18:31:58 UTC
remove macos-13 from our CI matrix because it is deprecated
1 parent ea19da5
  • Files
  • Changes
  • 0617af3
  • /
  • tests
  • /
  • utils
  • /
  • test_phase_center_catalog.py
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:d745e74710ab581d489e815095d0dd4ee91e9c35
directory badge
swh:1:dir:44d91f34b75d4752e8467339185a98db104ff524
content badge
swh:1:cnt:214f60fb328e89ab891a9e9bbf20aae4047e16ba

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
test_phase_center_catalog.py
# Copyright (c) 2024 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""Tests for phase center catalog utility functions."""

import pytest

import pyuvdata.utils.phase_center_catalog as ps_cat_utils


def test_generate_new_phase_center_id_errs():
    with pytest.raises(ValueError, match="Cannot specify old_id if no catalog"):
        ps_cat_utils.generate_new_phase_center_id(old_id=1)

    with pytest.raises(ValueError, match="Provided cat_id was found in reserved_ids"):
        ps_cat_utils.generate_new_phase_center_id(cat_id=1, reserved_ids=[1, 2, 3])


@pytest.mark.filterwarnings("ignore:The uvw_array does not match the expected values")
def test_look_in_catalog_missing_entries(casa_uvfits):
    phase_cat = casa_uvfits.phase_center_catalog

    # Try that this works normally if we do nothing
    assert ps_cat_utils.look_in_catalog(
        phase_cat, cat_name=phase_cat[0]["cat_name"]
    ) == (0, 5)

    # Now delete some keys
    for value in phase_cat.values():
        if "cat_times" in value:
            del value["cat_times"]
    # Now re-run the above and verify things work as expected
    assert ps_cat_utils.look_in_catalog(
        phase_cat, cat_name=phase_cat[0]["cat_name"]
    ) == (0, 5)
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API