https://github.com/RadioAstronomySoftwareGroup/pyuvdata
Revision 1518f24a08eb8f1bca54b8b2c4972d021d64d1f2 authored by Bryna Hazelton on 27 September 2021, 15:21:50 UTC, committed by Matthew Kolopanis on 28 September 2021, 15:48:23 UTC
1 parent d5993c2
Raw File
Tip revision: 1518f24a08eb8f1bca54b8b2c4972d021d64d1f2 authored by Bryna Hazelton on 27 September 2021, 15:21:50 UTC
Warn rather than error if the integration time is missing in uvfits
Tip revision: 1518f24
branch_scheme.py
# -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2020 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License

"""Define branch_scheme for versioning."""


def branch_scheme(version):  # pragma: nocover
    """
    Local version scheme that adds the branch name for absolute reproducibility.

    If and when this is added to setuptools_scm this function and file can be removed.
    """
    if version.exact or version.node is None:
        return version.format_choice("", "+d{time:{time_format}}", time_format="%Y%m%d")
    else:
        if version.branch == "main":
            return version.format_choice("+{node}", "+{node}.dirty")
        else:
            return version.format_choice("+{node}.{branch}", "+{node}.{branch}.dirty")
back to top