class BaseballSituation(ArgSchema): """A description of a baseball situation""" inning = fields.Int(required=True, description="inning (1-9)", validate=mm.validate.OneOf(range(1, 10))) bottom = fields.Bool(required=True, description="is it the bottom of the inning") score_home = fields.Int(required=True, description="home team score (non-negative)", validate=(lambda x: x >= 0)) score_away = fields.Int(required=True, description="away team score (non-negative)", validate=(lambda x: x >= 0)) outs = fields.Int(required=True, description="number of outs (0-2)", validate=mm.validate.OneOf([0, 1, 2])) balls = fields.Int(required=False, default=0, description="number of balls (0-4)", validate=mm.validate.OneOf([0, 1, 2, 3])) strikes = fields.Int(required=True, description="how many strikes (0-2)", validate=mm.validate.OneOf([0, 1, 2])) bases_occupied = fields.List(fields.Int, description="which bases are occupied", validate=mm.validate.ContainsOnly([1, 2, 3])) batter = fields.Nested(Player, required=True, description="who is batting") pitcher = fields.Nested(Player, required=True, description="who is pitching")
class MySchema(ArgSchema): boolean = fields.Boolean(required=True) date = fields.Date(required=True) datetime = fields.DateTime(required=True) decimal = fields.Decimal(requied=True) dict = fields.Dict(required=True) email = fields.Email(required=True) float = fields.Float(required=True) inputdir = fields.InputDir(required=True) inputfile = fields.InputFile(required=True) integer = fields.Int(required=True) list = fields.List(fields.Int, required=True, cli_as_single_argument=True) localdatetime = fields.LocalDateTime(required=True) nested = fields.Nested(MyNestedSchema, required=True) number = fields.Number(required=True) numpyarray = fields.NumpyArray(dtype="uint8", required=True) outputdir = fields.OutputDir(required=True) outputfile = fields.OutputFile(required=True) raw = fields.Raw(required=True) slice = fields.Slice(required=True) string = fields.Str(required=True) time = fields.Time(required=True) timedelta = fields.TimeDelta(required=True) url = fields.URL(required=True) uuid = fields.UUID(required=True)
class ClassifierArtifactsInputSchema(ArgSchema): # Input data locations. video_path = fields.InputFile( required=True, description="Path to motion corrected(+denoised) video.", ) roi_path = fields.InputFile( required=True, description="Path to json file containing detected ROIs", ) graph_path = fields.InputFile( required=True, description="Path to pickle file containing full movie graph.", ) # Output Artifact location. out_dir = fields.OutputDir( required=True, description="Output directory to put artifacts.", ) # Artifact generation settings. low_quantile = fields.Float( required=False, default=0.2, description="Low quantile to saturate/clip to.", ) high_quantile = fields.Float( required=False, default=0.99, description="High quantile to saturate/clip to.", ) cutout_size = fields.Int( required=False, default=128, description="Size of square cutout in pixels.", ) selected_rois = fields.List( fields.Int, required=False, allow_none=True, default=None, description="Specific subset of ROIs by ROI id in the experiment FOV " "to produce artifacts for. Only ROIs specified in this " "will have artifacts output.", )
class MyDeprecatedSchema(ArgSchema): list_deprecated = fields.List(fields.Int, required=True)