<commit_before># -*- mode: python; coding: utf-8 -*-
# Copyright 2016 the HERA Collaboration
# Licensed under the 2-clause BSD license.

"""M&C logging of the parts and the connections between them.

"""

from __future__ import absolute_import, division, print_function

import six
from tabulate import tabulate
from astropy.time import Time
from sqlalchemy import (BigInteger, Column, Float, ForeignKey,
                        ForeignKeyConstraint, Integer, String, Text, func)

from . import MCDeclarativeBase, NotNull
from . import mc, cm_utils

no_connection_designator = '-X-'
# This lists the fully complete signal paths
epoch_checking_order = ['parts_hera', 'parts_paper', 'parts_rfi', 'parts_test']
full_connection_path = {'parts_paper': ['station', 'antenna', 'feed', 'front-end',
                                        'cable-feed75', 'cable-post-amp(in)',
                                        'post-amp', 'cable-post-amp(out)',
                                        'cable-receiverator', 'cable-container',
                                        'f-engine'],
                        'parts_hera': ['station', 'antenna', 'feed', 'front-end',
                                       'cable-rfof', 'post-amp', 'snap', 'node'],
                        'parts_test': ['vapor']
                        }
epoch_corr_huind = {'parts_hera': 5, 'parts_paper': 9, 'parts_rfi': 3}  # index where the correlator is downstream
both_pols = ['e', 'n']


class Parts(MCDeclarativeBase):
    """
    A table logging parts within the HERA system
    Stations will be considered parts of type='station'
    Note that ideally install_date would also be a primary key, but that
    screws up ForeignKey in connections

    hpn: HERA part number for each part; part of the primary key.
    hpn_rev: A revision letter of sequences of hpn - starts with A. . Part of the primary_key
    hptype: A part-dependent string, i.e. feed, frontend, ...
    manufacturer_number: A part number/serial number as specified by manufacturer
    start_gpstime: The date when the part was installed (or otherwise assigned by project).
    stop_gpstime: The date when the part was removed (or otherwise de-assigned by project).
    """
    __tablename__ = 'parts'

    hpn = Column(String(64), primary_key=True)<commit_msg>added connection path back in...<commit_after># -*- mode: python; coding: utf-8 -*-
# Copyright 2016 the HERA Collaboration
# Licensed under the 2-clause BSD license.

"""M&C logging of the parts and the connections between them.

"""

from __future__ import absolute_import, division, print_function

import six
from tabulate import tabulate
from astropy.time import Time
from sqlalchemy import (BigInteger, Column, Float, ForeignKey,
                        ForeignKeyConstraint, Integer, String, Text, func)

from . import MCDeclarativeBase, NotNull
from . import mc, cm_utils

no_connection_designator = '-X-'
# This lists the fully complete signal paths
epoch_checking_order = ['parts_hera', 'parts_paper', 'parts_rfi', 'parts_test']
full_connection_path = {'parts_paper': ['station', 'antenna', 'feed', 'front-end',
                                        'cable-feed75', 'cable-post-amp(in)',
                                        'post-amp', 'cable-post-amp(out)',
                                        'cable-receiverator', 'cable-container',
                                        'f-engine'],
                        'parts_hera': ['station', 'antenna', 'feed', 'front-end',
                                       'cable-rfof', 'post-amp', 'snap', 'node'],
                        'parts_rfi': ['station', 'antenna', 'feed', 'temp-cable', 'snap', 'node'],
                        'parts_test': ['vapor']
                        }
epoch_corr_huind = {'parts_hera': 5, 'parts_paper': 9, 'parts_rfi': 3}  # index where the correlator is downstream
both_pols = ['e', 'n']


class Parts(MCDeclarativeBase):
    """
    A table logging parts within the HERA system
    Stations will be considered parts of type='station'
    Note that ideally install_date would also be a primary key, but that
    screws up ForeignKey in connections

    hpn: HERA part number for each part; part of the primary key.
    hpn_rev: A revision letter of sequences of hpn - starts with A. . Part of the primary_key
    hptype: A part-dependent string, i.e. feed, frontend, ...
    manufacturer_number: A part number/serial number as specified by manufacturer
    start_gpstime: The date when the part was installed (or otherwise assigned by project).
    stop_gpstime: The date when the part was removed (or otherwise de-assigned by project).
    """
    __tablename__ = 'parts'

    hpn = Column(String(64), primary_key=True)
{'fraction_non_alphanumeric': 0.10373355960967331, 'fraction_numerical': 0.005515485787017395, 'mean_word_length': 2.5344827586206895, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '320087', 'n_tokens_mistral': 1331, 'n_tokens_neox': 1276, 'n_words': 458}