Example #1
0
class CheckinSchemaIn(AuthenticatedMessageSchema):
    """Checking Input schema"""
    event_id = fields.Integer()
    user_latitude = fields.Float()
    user_longitude = fields.Float()
Example #2
0
class NursingHomeVaccinationsSchema(pl.BaseSchema):
    job_code = 'nursing_homes'
    #survey_id_ = fields.Integer(load_from='SURVEY_ID_'.lower(), dump_to='survey_id_')
    facility_n = fields.String(load_from='FACILITY_N'.lower(),
                               dump_to='facility_name')
    facility_i = fields.String(load_from='FACILITY_I'.lower(),
                               dump_to='facility_id')
    all_beds = fields.Integer(load_from='ALL_BEDS'.lower(),
                              dump_to='all_beds',
                              allow_none=True)
    current_census = fields.Integer(load_from='CURRENT_CENSUS'.lower(),
                                    dump_to='current_census',
                                    allow_none=True)
    resident_cases_to_display = fields.String(
        load_from='Resident_Cases_to_Display'.lower(),
        dump_to='resident_cases',
        allow_none=True)
    resident_deaths_to_display = fields.String(
        load_from='Resident_Deaths_to_Display'.lower(),
        dump_to='resident_deaths',
        allow_none=True)
    staff_cases_to_display = fields.String(
        load_from='Staff_Cases_to_Display'.lower(),
        dump_to='staff_cases',
        allow_none=True)
    federal_pharmacy_partner = fields.String(
        load_from='Federal Pharmacy Partner'.lower(),
        dump_to='federal_pharmacy_partner',
        allow_none=True)
    facility_name_fpp = fields.String(load_from='Facility Name FPP'.lower(),
                                      dump_to='fpp_facility_name',
                                      allow_none=True)
    first_clinic_date = fields.Date(load_from='First Clinic Date '.lower(),
                                    dump_to='first_clinic_date',
                                    allow_none=True)
    second_clinic_date = fields.Date(load_from='Second Clinic Date'.lower(),
                                     dump_to='second_clinic_date',
                                     allow_none=True)
    third_clinic_date = fields.Date(load_from='Third Clinic Date'.lower(),
                                    dump_to='third_clinic_date',
                                    allow_none=True)
    fourth_clinic_date = fields.Date(load_from='Fourth Clinic Date'.lower(),
                                     dump_to='fourth_clinic_date',
                                     allow_none=True)
    fifth_clinic_date = fields.Date(load_from='Fifth Clinic Date'.lower(),
                                    dump_to='fifth_clinic_date',
                                    allow_none=True)
    sixth_clinic_date = fields.Date(load_from='Sixth Clinic Date'.lower(),
                                    dump_to='sixth_clinic_date',
                                    allow_none=True)
    seventh_clinic_date = fields.Date(load_from='Seventh Clinic Date'.lower(),
                                      dump_to='seventh_clinic_date',
                                      allow_none=True)
    eighth_clinic_date = fields.Date(load_from='Eighth Clinic Date'.lower(),
                                     dump_to='eighth_clinic_date',
                                     allow_none=True)
    ninth_clinic_date = fields.Date(load_from='Ninth Clinic Date'.lower(),
                                    dump_to='ninth_clinic_date',
                                    allow_none=True)
    tenth_clinic_date = fields.Date(load_from='Tenth Clinic Date'.lower(),
                                    dump_to='tenth_clinic_date',
                                    allow_none=True)
    total_doses_administered = fields.Integer(
        load_from='Total Doses Administered'.lower(),
        dump_to='total_doses_administered',
        allow_none=True)
    first_doses_administered = fields.Integer(
        load_from='First Doses Administered'.lower(),
        dump_to='first_doses_administered',
        allow_none=True)
    second_doses_adminstered = fields.Integer(
        load_from='Second Doses Adminstered'.lower(),
        dump_to='second_doses_adminstered',
        allow_none=True)
    total_resident_doses_administered = fields.Integer(
        load_from='Total Resident Doses Administered'.lower(),
        dump_to='total_resident_doses_administered',
        allow_none=True)
    total_staff_doses_administered = fields.Integer(
        load_from='Total Staff Doses Administered'.lower(),
        dump_to='total_staff_doses_administered',
        allow_none=True)

    street = fields.String(load_from='STREET'.lower(), dump_to='street')
    city_or_bo = fields.String(load_from='CITY_OR_BO'.lower(), dump_to='city')
    zip_code = fields.String(load_from='ZIP_CODE'.lower(), dump_to='zip_code')
    #zip_code_e = fields.String(load_from='ZIP_CODE_E'.lower(), dump_to='zip_code_e')
    latitude = fields.Float(load_from='LATITUDE'.lower(), dump_to='latitude')
    longitude = fields.Float(load_from='LONGITUDE'.lower(),
                             dump_to='longitude')
    facility_u = fields.String(load_from='FACILITY_U'.lower(),
                               dump_to='facility_url')
    #geocoding_ = fields.Integer(load_from='GEOCODING_'.lower(), dump_to='geocoding_')
    area_code = fields.String(load_from='AREA_CODE'.lower(),
                              dump_to='area_code')
    telephone_ = fields.String(load_from='TELEPHONE_'.lower(),
                               dump_to='telephone')
    contact_na = fields.String(load_from='CONTACT_NA'.lower(),
                               dump_to='contact_name')
    contact_nu = fields.String(load_from='CONTACT_NU'.lower(),
                               dump_to='contact_phone')
    contact_fa = fields.String(load_from='CONTACT_FA'.lower(),
                               dump_to='contact_fax')
    #contact_em = fields.String(load_from='CONTACT_EM'.lower(), dump_to='contact_em')
    #lat = fields.Float(load_from='LAT'.lower(), dump_to='lat')
    #lng = fields.Float(load_from='LNG'.lower(), dump_to='long')
    doh_data_last_updated = fields.Date(
        load_from='DOH_Data_Last_Updated'.lower(),
        dump_to='doh_data_last_updated',
        allow_none=True)

    ####
    #fpp_data_last_updated = fields.String(load_from='FPP_Data_Last_Updated'.lower(), dump_to='fpp_data_last_updated')

    class Meta:
        ordered = True
Example #3
0
class NormalDistributionConfiguration(Schema):
    mean = fields.Float(default=0.0, missing=0.0)
    std = fields.Float(default=0.0, missing=0.001)
class CartSchema(Schema):
    id = fields.String(required=True)
    total_price = fields.Float(required=True, default=0)
    products = fields.List(fields.Nested(ProductSchema),
                           required=True,
                           default=[])
Example #5
0
class ProductSchema(ma.Schema):
    product_id = fields.Integer(required=True)
    product_price = fields.Float(required=True)
    product_name = fields.String(required=True)
    size = fields.Integer(required=True)
Example #6
0
class BaseGoodSchema(Schema):
    id = fields.Int(dump_only=True)
    name = fields.Str()
    initprice = fields.Float()
    price = fields.Float()
    time = fields.DateTime()
Example #7
0
class ChartDataBoxplotOptionsSchema(
        ChartDataPostProcessingOperationOptionsSchema):
    """
    Boxplot operation config.
    """

    groupby = fields.List(
        fields.String(description="Columns by which to group the query.", ),
        allow_none=True,
    )

    metrics = fields.List(
        fields.Raw(),
        description="Aggregate expressions. Metrics can be passed as both "
        "references to datasource metrics (strings), or ad-hoc metrics"
        "which are defined only within the query object. See "
        "`ChartDataAdhocMetricSchema` for the structure of ad-hoc metrics.",
    )

    whisker_type = fields.String(
        description="Whisker type. Any numpy function will work.",
        validate=validate.OneOf(
            choices=([val.value for val in PostProcessingBoxplotWhiskerType])),
        required=True,
        example="tukey",
    )

    percentiles = fields.Tuple(
        (
            fields.Float(
                description="Lower percentile",
                validate=[
                    Range(
                        min=0,
                        max=100,
                        min_inclusive=False,
                        max_inclusive=False,
                        error=_(
                            "lower percentile must be greater than 0 and less "
                            "than 100. Must be lower than upper percentile."),
                    ),
                ],
            ),
            fields.Float(
                description="Upper percentile",
                validate=[
                    Range(
                        min=0,
                        max=100,
                        min_inclusive=False,
                        max_inclusive=False,
                        error=_(
                            "upper percentile must be greater than 0 and less "
                            "than 100. Must be higher than lower percentile."),
                    ),
                ],
            ),
        ),
        description="Upper and lower percentiles for percentile whisker type.",
        example=[1, 99],
    )
Example #8
0
class LocationSchema(Schema):
    country = fields.Str()
    city = fields.Str()
    latitude = fields.Float()
    longitude = fields.Float()
Example #9
0
class GeoAssessments(pl.BaseSchema):
    parid = fields.String(dump_to="PARID", allow_none=True)
    propertyhousenum = fields.String(dump_to="PROPERTYHOUSENUM",
                                     allow_none=True)
    propertyfraction = fields.String(dump_to="PROPERTYFRACTION",
                                     allow_none=True)
    propertyaddress = fields.String(dump_to="PROPERTYADDRESS", allow_none=True)
    propertycity = fields.String(dump_to="PROPERTYCITY", allow_none=True)
    propertystate = fields.String(dump_to="PROPERTYSTATE", allow_none=True)
    propertyunit = fields.String(dump_to="PROPERTYUNIT", allow_none=True)
    propertyzip = fields.String(dump_to="PROPERTYZIP", allow_none=True)
    municode = fields.String(dump_to="MUNICODE", allow_none=True)
    munidesc = fields.String(dump_to="MUNIDESC", allow_none=True)
    schoolcode = fields.String(dump_to="SCHOOLCODE", allow_none=True)
    schooldesc = fields.String(dump_to="SCHOOLDESC", allow_none=True)
    legal1 = fields.String(dump_to="LEGAL1", allow_none=True)
    legal2 = fields.String(dump_to="LEGAL2", allow_none=True)
    legal3 = fields.String(dump_to="LEGAL3", allow_none=True)
    neighcode = fields.String(dump_to="NEIGHCODE", allow_none=True)
    neighdesc = fields.String(dump_to="NEIGHDESC", allow_none=True)
    taxcode = fields.String(dump_to="TAXCODE", allow_none=True)
    taxdesc = fields.String(dump_to="TAXDESC", allow_none=True)
    taxsubcode = fields.String(dump_to="TAXSUBCODE", allow_none=True)
    taxsubcode_desc = fields.String(dump_to="TAXSUBCODE_DESC", allow_none=True)
    ownercode = fields.String(dump_to="OWNERCODE", allow_none=True)
    ownerdesc = fields.String(dump_to="OWNERDESC", allow_none=True)
    _class = fields.String(dump_to="CLASS", load_from='class', allow_none=True)
    classdesc = fields.String(dump_to="CLASSDESC", allow_none=True)
    usecode = fields.String(dump_to="USECODE", allow_none=True)
    usedesc = fields.String(dump_to="USEDESC", allow_none=True)
    lotarea = fields.Float(dump_to="LOTAREA", allow_none=True)
    homesteadflag = fields.String(dump_to="HOMESTEADFLAG", allow_none=True)
    cleangreen = fields.String(dump_to="CLEANGREEN", allow_none=True)
    farmsteadflag = fields.String(dump_to="FARMSTEADFLAG", allow_none=True)
    abatementflag = fields.String(dump_to="ABATEMENTFLAG", allow_none=True)
    recorddate = fields.String(dump_to="RECORDDATE", allow_none=True)
    saledate = fields.String(dump_to="SALEDATE", allow_none=True)
    saleprice = fields.Float(dump_to="SALEPRICE", allow_none=True)
    salecode = fields.String(dump_to="SALECODE", allow_none=True)
    saledesc = fields.String(dump_to="SALEDESC", allow_none=True)
    deedbook = fields.String(dump_to="DEEDBOOK", allow_none=True)
    deedpage = fields.String(dump_to="DEEDPAGE", allow_none=True)
    prevsaledate = fields.String(dump_to="PREVSALEDATE", allow_none=True)
    prevsaleprice = fields.Float(dump_to="PREVSALEPRICE", allow_none=True)
    prevsaledate2 = fields.String(dump_to="PREVSALEDATE2", allow_none=True)
    prevsaleprice2 = fields.Float(dump_to="PREVSALEPRICE2", allow_none=True)
    changenoticeaddress1 = fields.String(dump_to="CHANGENOTICEADDRESS1",
                                         allow_none=True)
    changenoticeaddress2 = fields.String(dump_to="CHANGENOTICEADDRESS2",
                                         allow_none=True)
    changenoticeaddress3 = fields.String(dump_to="CHANGENOTICEADDRESS3",
                                         allow_none=True)
    changenoticeaddress4 = fields.String(dump_to="CHANGENOTICEADDRESS4",
                                         allow_none=True)
    countybuilding = fields.Float(dump_to="COUNTYBUILDING", allow_none=True)
    countyland = fields.Float(dump_to="COUNTYLAND", allow_none=True)
    countytotal = fields.Float(dump_to="COUNTYTOTAL", allow_none=True)
    countyexemptbldg = fields.Float(dump_to="COUNTYEXEMPTBLDG",
                                    allow_none=True)
    localbuilding = fields.Float(dump_to="LOCALBUILDING", allow_none=True)
    localland = fields.Float(dump_to="LOCALLAND", allow_none=True)
    localtotal = fields.Float(dump_to="LOCALTOTAL", allow_none=True)
    fairmarketbuilding = fields.Float(dump_to="FAIRMARKETBUILDING",
                                      allow_none=True)
    fairmarketland = fields.Float(dump_to="FAIRMARKETLAND", allow_none=True)
    fairmarkettotal = fields.Float(dump_to="FAIRMARKETTOTAL", allow_none=True)
    style = fields.String(dump_to="STYLE", allow_none=True)
    styledesc = fields.String(dump_to="STYLEDESC", allow_none=True)
    stories = fields.String(dump_to="STORIES", allow_none=True)
    yearblt = fields.Float(dump_to="YEARBLT", allow_none=True)
    exteriorfinish = fields.String(dump_to="EXTERIORFINISH", allow_none=True)
    extfinish_desc = fields.String(dump_to="EXTFINISH_DESC", allow_none=True)
    roof = fields.String(dump_to="ROOF", allow_none=True)
    roofdesc = fields.String(dump_to="ROOFDESC", allow_none=True)
    basement = fields.String(dump_to="BASEMENT", allow_none=True)
    basementdesc = fields.String(dump_to="BASEMENTDESC", allow_none=True)
    grade = fields.String(dump_to="GRADE", allow_none=True)
    gradedesc = fields.String(dump_to="GRADEDESC", allow_none=True)
    condition = fields.String(dump_to="CONDITION", allow_none=True)
    conditiondesc = fields.String(dump_to="CONDITIONDESC", allow_none=True)
    cdu = fields.String(dump_to="CDU", allow_none=True)
    cdudesc = fields.String(dump_to="CDUDESC", allow_none=True)
    totalrooms = fields.Float(dump_to="TOTALROOMS", allow_none=True)
    bedrooms = fields.Float(dump_to="BEDROOMS", allow_none=True)
    fullbaths = fields.Float(dump_to="FULLBATHS", allow_none=True)
    halfbaths = fields.Float(dump_to="HALFBATHS", allow_none=True)
    heatingcooling = fields.String(dump_to="HEATINGCOOLING", allow_none=True)
    heatingcoolingdesc = fields.String(dump_to="HEATINGCOOLINGDESC",
                                       allow_none=True)
    fireplaces = fields.Float(dump_to="FIREPLACES", allow_none=True)
    bsmtgarage = fields.String(dump_to="BSMTGARAGE", allow_none=True)
    finishedlivingarea = fields.Float(dump_to="FINISHEDLIVINGAREA",
                                      allow_none=True)
    cardnumber = fields.Float(dump_to="CARDNUMBER", allow_none=True)
    alt_id = fields.String(dump_to="ALT_ID", allow_none=True)
    taxyear = fields.Float(dump_to="TAXYEAR", allow_none=True)
    asofdate = fields.Date(dump_to="ASOFDATE", allow_none=True)

    # municipality = fields.String(dump_to="MUNICIPALITY", allow_none=True)
    # neighborhood = fields.String(dump_to="NEIGHBORHOOD", allow_none=True)
    # pgh_council_district = fields.String(dump_to="PGH_COUNCIL_DISTRICT",
    #                                      allow_none=True)
    # pgh_ward = fields.String(dump_to="PGH_WARD", allow_none=True)
    # pgh_public_works_division = fields.String(
    #     dump_to="PGH_PUBLIC_WORKS_DIVISION", allow_none=True)
    # pgh_police_zone = fields.String(dump_to="PGH_POLICE_ZONE", allow_none=True)
    # pgh_fire_zone = fields.String(dump_to="PGH_FIRE_ZONE", allow_none=True)
    # tract = fields.String(dump_to="TRACT", allow_none=True)
    # block_group = fields.String(dump_to="BLOCK_GROUP", allow_none=True)

    latitude = fields.Float(allow_none=True)
    longitude = fields.Float(allow_none=True)

    class Meta:
        ordered = True

    @pre_load
    def fix_dates(self, data):
        if data['asofdate']:
            data['asofdate'] = datetime.strptime(
                data['asofdate'], "%d-%b-%y").date().isoformat()

    @pre_load
    def clear_whitespace(self, data):
        items = [
            'changenoticeaddress1', 'changenoticeaddress2',
            'changenoticeaddress3', 'changenoticeaddress4', 'legal1', 'legal2',
            'legal3'
        ]

        for item in items:
            if data[item] is not None:
                data[item] = re.sub(r'\s+', ' ', data[item])
Example #10
0
class Invoice_Shchema(Schema):
    product = fields.Nested(BrandsSchema())
    customer = fields.Nested(UserShchema())
    date = fields.Date()
    value = fields.Float()
Example #11
0
class Invoice_RFM_Shchema(Schema):
    id = fields.Integer()
    product_id = fields.Integer()
    customer_id = fields.Integer()
    date = fields.Date()
    value = fields.Float()
Example #12
0
class ItemSchema(Schema):
    _id = fields.Str(required=True)
    name = fields.Str()
    price = fields.Float()
Example #13
0
class ResearchSourceSchema(Schema):
    source_id = fields.UUID(allow_none=True)
    case_population = fields.Float(allow_none=True, allow_nan=True)
    deaths_population = fields.Float(allow_none=True, allow_nan=True)
    age_max = fields.Float(allow_none=True, allow_nan=True)
    age_min = fields.Float(allow_none=True, allow_nan=True)
    age_variation = fields.Str(allow_none=True)
    age_variation_measure = fields.Str(allow_none=True)
    average_age = fields.Str(allow_none=True)
    case_count_neg14 = fields.Float(allow_none=True, allow_nan=True)
    case_count_neg9 = fields.Float(allow_none=True, allow_nan=True)
    case_count_0 = fields.Float(allow_none=True, allow_nan=True)
    death_count_plus11 = fields.Float(allow_none=True, allow_nan=True)
    death_count_plus4 = fields.Float(allow_none=True, allow_nan=True)
    include_in_srma = fields.Boolean(allow_none=True)
    sensspec_from_manufacturer = fields.Boolean(allow_none=True)
    ind_eval_lab = fields.Str(allow_none=True)
    ind_eval_link = fields.Str(allow_none=True)
    ind_se = fields.Float(allow_none=True, allow_nan=True)
    ind_se_n = fields.Float(allow_none=True, allow_nan=True)
    ind_sp = fields.Float(allow_none=True, allow_nan=True)
    ind_sp_n = fields.Float(allow_none=True, allow_nan=True)
    jbi_1 = fields.Str(allow_none=True)
    jbi_2 = fields.Str(allow_none=True)
    jbi_3 = fields.Str(allow_none=True)
    jbi_4 = fields.Str(allow_none=True)
    jbi_5 = fields.Str(allow_none=True)
    jbi_6 = fields.Str(allow_none=True)
    jbi_7 = fields.Str(allow_none=True)
    jbi_8 = fields.Str(allow_none=True)
    jbi_9 = fields.Str(allow_none=True)
    measure_of_age = fields.Str(allow_none=True)
    sample_frame_info = fields.Str(allow_none=True)
    number_of_females = fields.Float(allow_none=True, allow_nan=True)
    number_of_males = fields.Float(allow_none=True, allow_nan=True)
    numerator_value = fields.Float(allow_none=True, allow_nan=True)
    estimate_name = fields.Str(allow_none=True)
    test_not_linked_reason = fields.Str(allow_none=True)
    se_n = fields.Float(allow_none=True, allow_nan=True)
    seroprev_95_ci_lower = fields.Float(allow_none=True, allow_nan=True)
    seroprev_95_ci_upper = fields.Float(allow_none=True, allow_nan=True)
    sp_n = fields.Float(allow_none=True, allow_nan=True)
    subgroup_var = fields.Str(allow_none=True)
    subgroup_cat = fields.Str(allow_none=True)
    superceded = fields.Boolean(allow_none=True)
    test_linked_uid = fields.Str(allow_none=True)
    test_name = fields.Str(allow_none=True)
    test_validation = fields.Str(allow_none=True)
    zotero_citation_key = fields.Str(allow_none=True)
    superseder_name = fields.Str(allow_none=True)
    study_exclusion_criteria = fields.Str(allow_none=True)
Example #14
0
class EventQueryByLocationSchema(AuthenticatedMessageSchema):
    """Event marshmallow schema"""
    latitude_northeast = fields.Float()
    longitude_northeast = fields.Float()
    latitude_southwest = fields.Float()
    longitude_southwest = fields.Float()
Example #15
0
class UserSchema(Schema):
    id = fields.Int(dump_only=True)
    name = fields.Str()
    balance = fields.Float()
Example #16
0
class StudentSchema(Schema):
    name = fields.Str()
    major = fields.Str()
    gpa = fields.Float()
    is_on_probation = fields.Boolean()
Example #17
0
class ProducableSchema(Schema):
    id = fields.Int(dump_only=True)
    name = fields.Str()
    price = fields.Float()
    time = fields.Int()
Example #18
0
class MeterMessage(BaseMessage):
    """Power consumption measurement event"""

    #: Power consumed, in watts
    value = fields.Float(required=True)
Example #19
0
class ChartDataProphetOptionsSchema(
        ChartDataPostProcessingOperationOptionsSchema):
    """
    Prophet operation config.
    """

    time_grain = fields.String(
        description=
        "Time grain used to specify time period increments in prediction. "
        "Supports [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) "
        "durations.",
        validate=validate.OneOf(choices=[
            i for i in {
                **builtin_time_grains,
                **config["TIME_GRAIN_ADDONS"]
            }.keys() if i
        ]),
        example="P1D",
        required=True,
    )
    periods = fields.Integer(
        descrption=
        "Time periods (in units of `time_grain`) to predict into the future",
        min=1,
        example=7,
        required=True,
    )
    confidence_interval = fields.Float(
        description="Width of predicted confidence interval",
        validate=[
            Range(
                min=0,
                max=1,
                min_inclusive=False,
                max_inclusive=False,
                error=_(
                    "`confidence_interval` must be between 0 and 1 (exclusive)"
                ),
            )
        ],
        example=0.8,
        required=True,
    )
    yearly_seasonality = fields.Raw(
        # TODO: add correct union type once supported by Marshmallow
        description="Should yearly seasonality be applied. "
        "An integer value will specify Fourier order of seasonality, `None` will "
        "automatically detect seasonality.",
        example=False,
    )
    weekly_seasonality = fields.Raw(
        # TODO: add correct union type once supported by Marshmallow
        description="Should weekly seasonality be applied. "
        "An integer value will specify Fourier order of seasonality, `None` will "
        "automatically detect seasonality.",
        example=False,
    )
    monthly_seasonality = fields.Raw(
        # TODO: add correct union type once supported by Marshmallow
        description="Should monthly seasonality be applied. "
        "An integer value will specify Fourier order of seasonality, `None` will "
        "automatically detect seasonality.",
        example=False,
    )
Example #20
0
class AddressSchema(FlaskSchema):
    lon = fields.Float()
    lat = fields.Float()
    addr = fields.Str()
Example #21
0
class AnnotationLayerSchema(Schema):
    annotationType = fields.String(
        description="Type of annotation layer",
        validate=validate.OneOf(choices=[ann.value for ann in AnnotationType]),
    )
    color = fields.String(
        description="Layer color",
        allow_none=True,
    )
    descriptionColumns = fields.List(
        fields.String(),
        description="Columns to use as the description. If none are provided, "
        "all will be shown.",
    )
    hideLine = fields.Boolean(
        description="Should line be hidden. Only applies to line annotations",
        allow_none=True,
    )
    intervalEndColumn = fields.String(
        description=(
            "Column containing end of interval. Only applies to interval layers"
        ),
        allow_none=True,
    )
    name = fields.String(description="Name of layer", required=True)
    opacity = fields.String(
        description="Opacity of layer",
        validate=validate.OneOf(choices=("", "opacityLow", "opacityMedium",
                                         "opacityHigh"), ),
        allow_none=True,
        required=False,
    )
    overrides = fields.Dict(
        keys=fields.String(
            desciption="Name of property to be overridden",
            validate=validate.OneOf(choices=("granularity", "time_grain_sqla",
                                             "time_range", "time_shift"), ),
        ),
        values=fields.Raw(allow_none=True),
        description="which properties should be overridable",
        allow_none=True,
    )
    show = fields.Boolean(description="Should the layer be shown",
                          required=True)
    showMarkers = fields.Boolean(
        description=
        "Should markers be shown. Only applies to line annotations.",
        required=True,
    )
    sourceType = fields.String(
        description="Type of source for annotation data",
        validate=validate.OneOf(choices=(
            "",
            "line",
            "NATIVE",
            "table",
        )),
    )
    style = fields.String(
        description="Line style. Only applies to time-series annotations",
        validate=validate.OneOf(choices=(
            "dashed",
            "dotted",
            "solid",
            "longDashed",
        )),
    )
    timeColumn = fields.String(
        description="Column with event date or interval start date",
        allow_none=True,
    )
    titleColumn = fields.String(
        description="Column with title",
        allow_none=True,
    )
    width = fields.Float(
        description="Width of annotation line",
        validate=[
            Range(
                min=0,
                min_inclusive=True,
                error=_("`width` must be greater or equal to 0"),
            )
        ],
    )
    value = fields.Raw(
        description="For formula annotations, this contains the formula. "
        "For other types, this is the primary key of the source object.",
        required=True,
    )
Example #22
0
class ParameterSchema(BaseSchema):
    initial = fields.Float(required=True)
    bounds = fields.List(fields.Float(),
                         validate=validate.Length(equal=2),
                         missing=(-sys.float_info.max, sys.float_info.max))
class ProductSchema(Schema):
    id = fields.String(dump_only=True, attribute='product_id')
    product_id = fields.String(required=True, load_only=True)
    amount = fields.Integer(required=True)
    price = fields.Float(dump_only=True)
Example #24
0
class TaxSchema(Schema):
    value = fields.Float(required=True)
    type = fields.Str(required=True,
                      allow_none=False,
                      validate=validate.OneOf(["C_GST", "S_GST", "VAT"]))
Example #25
0
class Sensor(Schema):
    x = fields.Float(as_string=False)
    y = fields.Float(as_string=False)
    z = fields.Float(as_string=False)
    t = fields.Int(as_string=False)
    ref = fields.Str()
class GeometrySchema(BaseSchema):
    type = fields.Str()
    coordinates = fields.List(fields.Float())
Example #27
0
class BeamLineSetupSchema(Schema):
    """Marshmallows schema class representing BeamLineSetup table"""

    beamLineSetupId = ma_fields.Integer()
    detectorId = ma_fields.Integer()
    synchrotronMode = ma_fields.String()
    undulatorType1 = ma_fields.String()
    undulatorType2 = ma_fields.String()
    undulatorType3 = ma_fields.String()
    focalSpotSizeAtSample = ma_fields.Float()
    focusingOptic = ma_fields.String()
    beamDivergenceHorizontal = ma_fields.Float()
    beamDivergenceVertical = ma_fields.Float()
    polarisation = ma_fields.Float()
    monochromatorType = ma_fields.String()
    setupDate = ma_fields.DateTime()
    synchrotronName = ma_fields.String()
    maxExpTimePerDataCollection = ma_fields.String()
    maxExposureTimePerImage = ma_fields.Float()
    minExposureTimePerImage = ma_fields.String()
    goniostatMaxOscillationSpeed = ma_fields.String()
    goniostatMaxOscillationWidth = ma_fields.String()
    goniostatMinOscillationWidth = ma_fields.String()
    maxTransmission = ma_fields.String()
    minTransmission = ma_fields.String()
    recordTimeStamp = ma_fields.DateTime()
    CS = ma_fields.Float()
    beamlineName = ma_fields.String()
    beamSizeXMin = ma_fields.Float()
    beamSizeXMax = ma_fields.Float()
    beamSizeYMin = ma_fields.Float()
    beamSizeYMax = ma_fields.Float()
    energyMin = ma_fields.Float()
    energyMax = ma_fields.Float()
    omegaMin = ma_fields.Float()
    omegaMax = ma_fields.Float()
    kappaMin = ma_fields.Float()
    kappaMax = ma_fields.Float()
    phiMin = ma_fields.Float()
    phiMax = ma_fields.Float()
    active = ma_fields.Integer()
    numberOfImagesMax = ma_fields.Integer()
    numberOfImagesMin = ma_fields.Integer()
    boxSizeXMin = ma_fields.String()
    boxSizeXMax = ma_fields.String()
    boxSizeYMin = ma_fields.String()
    boxSizeYMax = ma_fields.String()
    monoBandwidthMin = ma_fields.String()
    monoBandwidthMax = ma_fields.String()
Example #28
0
class BaseLossSchema(Schema):
    input_layer = Tensor(allow_none=True)
    output_layer = Tensor(allow_none=True)
    weights = fields.Float(default=1.0, missing=1.0)
    name = fields.Str(allow_none=True)
    collect = fields.Bool(default=True, missing=True)
Example #29
0
class BugPrediction(Schema):
    prob = fields.List(fields.Float())
    index = fields.Integer()
    suggestion = fields.Str()
    extra_data = fields.Dict()
class IntentSchema(Schema):
    name = fields.Str()
    confidence = fields.Float()