sparsify.schemas package

Submodules

sparsify.schemas.errors module

Schemas for anything related to errors occurring in the flask app

class sparsify.schemas.errors. ErrorSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Error schema to return in the event of an error encountered while running the app

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>

sparsify.schemas.helpers module

Helper values and classes for marshmallow schemas

class sparsify.schemas.helpers. EnumField ( enum_class : Any , * args , ** kwargs ) [source]

Bases: marshmallow.fields.String

Custom schema field for handling serializing and deserializing enums

Parameters
  • enum_class – the enum class to use for deserializing

  • args – args to pass to the field

  • kwargs – the kwargs to pass to the field

deserialize ( value : Any , attr : Optional [ str ] = None , data : Optional [ Mapping [ str , Any ] ] = None , ** kwargs ) [source]

Deserialize value .

Parameters
  • value – The value to deserialize.

  • attr – The attribute/key in data to deserialize.

  • data – The raw input data passed to Schema.load .

  • kwargs – Field-specific keyword arguments.

Raises

ValidationError – If an invalid value is passed or if a required value is missing.

sparsify.schemas.helpers. data_dump_and_validation ( schema : marshmallow.schema.Schema , data : Any ) Dict [source]

Use a marshmallow schema to dump and validate input data

Parameters
  • schema – the schema to use to dump an object and validate it

  • data – the data to dump and validate

Returns

the resulting dumped data from marshmallow

sparsify.schemas.jobs module

Schemas for anything related to job routes, database models, and workers

class sparsify.schemas.jobs. JobProgressSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for the progress of a Job object, used in the workers to report progress

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.jobs. JobSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for a job object as stored in the DB and returned in the server routes

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.jobs. ResponseJobSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for returning a response with a single job

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.jobs. ResponseJobsSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for returning a response with multiple jobs

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.jobs. SearchJobsSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Expected schema to use for querying jobs

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>

sparsify.schemas.model_repo module

Schemas for anything related to model repo routes, database models, and

class sparsify.schemas.model_repo. ModelRepoArchitectureSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for a model repo architecture

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.model_repo. ModelRepoDatasetSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for a model repo dataset

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.model_repo. ModelRepoDomainSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for a model repo domain

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.model_repo. ModelRepoModelDescSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for a model repo desc

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.model_repo. ModelRepoModelMetricSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for reporting a metric for a model repo model

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.model_repo. ModelRepoModelPerfSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for reporting the performance for a model repo model

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.model_repo. ModelRepoModelSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for a model repo model

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.model_repo. ResponseModelRepoModels ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for the response for searching for models in the model repo

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.model_repo. SearchModelRepoModels ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for searching and filtering models in the model repo

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>

sparsify.schemas.projects module

Schemas for anything related to project routes, database models, and workers

class sparsify.schemas.projects. CreateUpdateProjectSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Expected schema to use for creating or updating a project

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects. DeleteProjectSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Expected schema to use for deleting a project

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects. ProjectExtSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: sparsify.schemas.projects.ProjectSchema

Schema for a project object including model and data as stored in the DB and returned in the server routes

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects. ProjectSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for a project object as stored in the DB and returned in the server routes

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects. ResponseProjectDeletedSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for returning a response after deleting a project

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects. ResponseProjectExtSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for returning a response with a single project and its associated model and data

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects. ResponseProjectSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for returning a response with a single project

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects. ResponseProjectsSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for returning a response with multiple project

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects. SearchProjectsSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Expected schema to use for querying projects

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>

sparsify.schemas.projects_benchmarks module

Schemas for anything related to project benchmark routes, database models, and workers

class sparsify.schemas.projects_benchmarks. CreateProjectBenchmarkSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Expected schema to use for creating a project benchmark

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_benchmarks. ProjectBenchmarkResultSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for a project benchmark object’s metadata as stored in the DB

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_benchmarks. ProjectBenchmarkResultsSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for a project benchmark object’s measured results as stored in the DB

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_benchmarks. ProjectBenchmarkSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for a project benchmark object (metadata and result) as stored in the DB and returned in the server routes

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_benchmarks. ResponseProjectBenchmarkDeletedSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Expected schema to use for deleting a project benchmark

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_benchmarks. ResponseProjectBenchmarkSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for returning a response containing a benchmark project

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_benchmarks. ResponseProjectBenchmarksSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for returning a response containing multiple benchmark projects

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_benchmarks. SearchProjectBenchmarksSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema to use for querying project benchmarks

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>

sparsify.schemas.projects_data module

Schemas for anything related to project data routes, database models, and workers

class sparsify.schemas.projects_data. CreateUpdateProjectDataSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for creating a data file for a project

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_data. ProjectDataSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for a project data object as stored in the DB and returned in the server routes

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_data. ResponseProjectDataDeletedSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for returning a response after deleting a project’s data object and file

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_data. ResponseProjectDataSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for returning a response with all of the project’s data objects

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_data. ResponseProjectDataSingleSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for returning a response with a project’s data object

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_data. SearchProjectDataSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema to use for querying project data

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_data. SetProjectDataFromSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Expected schema to use for setting a project’s data for upload from path or upload from url

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>

sparsify.schemas.projects_model module

Schemas for anything related to project model routes and database

class sparsify.schemas.projects_model. CreateUpdateProjectModelSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for creating a model for a project

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_model. DeleteProjectModelSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for deleting a project’s model

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_model. ProjectModelAnalysisSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for the analysis of a project’s model and all the nodes contained

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_model. ProjectModelSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for a project model object as stored in the DB an returned in server routes

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_model. ResponseProjectModelAnalysisSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for returning a response with a project model’s analysis

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_model. ResponseProjectModelDeletedSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for returning a response on deletion of a project’s model

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_model. ResponseProjectModelSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for returning a response with a single project model

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_model. SetProjectModelFromSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for setting a project’s model from some loadable uri

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>

sparsify.schemas.projects_optimizations module

Schemas for anything related to project optims routes, database models, and workers

class sparsify.schemas.projects_optimizations. CreateProjectOptimizationSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: sparsify.schemas.projects_optimizations.GetProjectOptimizationBestEstimatedResultsSchema

Schema to use for creating a project optimization

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. CreateUpdateProjectOptimizationModifiersLRScheduleSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema to use for creating or updating a project optimization lr schedule modifier

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. CreateUpdateProjectOptimizationModifiersPruningSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema to use for creating or updating a project optimization pruning modifier

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. CreateUpdateProjectOptimizationModifiersQuantizationSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema to use for creating or updating a project optimization quantization modifier

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. CreateUpdateProjectOptimizationModifiersTrainableSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema to use for creating or updating a project optimization trainable modifier

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. GetProjectOptimizationBestEstimatedResultsSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema to use for getting a projects best estimated optimization results

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. ProjectAvailableModelModificationsSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for the available modifiers for a project

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. ProjectOptimizationModifierLRExponentialArgsSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for the args for an exponential LR modifier

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. ProjectOptimizationModifierLRMultiStepArgsSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for the args for a multi step LR modifier

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. ProjectOptimizationModifierLRScheduleSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for an LR schedule modifier including metadata and settings

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. ProjectOptimizationModifierLRSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for an LR modifier

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. ProjectOptimizationModifierLRSetArgsSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for the args for a set LR modifier

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. ProjectOptimizationModifierLRStepArgsSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for the args for a step LR modifier

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. ProjectOptimizationModifierPruningNodeSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: sparsify.schemas.projects_optimizations.ProjectOptimizationModifierPruningNodeMetadataSchema , sparsify.schemas.projects_optimizations.ProjectOptimizationModifierEstimationsSchema

Schema for a pruning node containing metadata and estimated values

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. ProjectOptimizationModifierPruningSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: sparsify.schemas.projects_optimizations.ProjectOptimizationModifierEstimationsSchema

Schema for a pruning modifier including metadata, settings, and estimated values

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. ProjectOptimizationModifierQuantizationNodeSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for a quantization node containing metadata

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. ProjectOptimizationModifierQuantizationSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for a quantization modifier including metadata, settings, and estimated values

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>
class sparsify.schemas.projects_optimizations. ProjectOptimizationModifierTrainableNodeSchema ( * , only : Optional [ Union [ Sequence [ str ] , Set [ str ] ] ] = None , exclude : Union [ Sequence [ str ] , Set [ str ] ] = () , many : bool = False , context : Optional [ Dict ] = None , load_only : Union [ Sequence [ str ] , Set [ str ] ] = () , dump_only : Union [ Sequence [ str ] , Set [ str ] ] = () , partial : Union [ bool , Sequence [ str ] , Set [ str ] ] = False , unknown : Optional [ str ] = None ) [source]

Bases: marshmallow.schema.Schema

Schema for a trainable node containing metadata

opts : SchemaOpts = <marshmallow.schema.SchemaOpts object>