httpstan.schemas¶
Module Contents¶
Classes¶
Long-running operation. |
|
Error. |
|
Schema for request to build a Stan program. |
|
Base schema class with which to define schemas. |
|
Data for a Stan model. |
|
Schema for request to start sampling. |
|
Base schema class with which to define schemas. |
|
Base schema class with which to define schemas. |
|
Schema for single parameter. |
|
Messages from callback writers and loggers in |
|
Schema for log_prob request. |
|
Schema for log_prob_grad request. |
|
Schema for write_array request. |
|
Schema for transform_inits request. |
- class httpstan.schemas.Operation(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]¶
Bases:
marshmallow.SchemaLong-running operation.
Modeled on operations.proto, linked in https://cloud.google.com/apis/design/standard_methods
- name¶
- metadata¶
- done¶
- result¶
- class httpstan.schemas.Status(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]¶
Bases:
marshmallow.SchemaError.
Modeled on
google.rpc.Status. See https://cloud.google.com/apis/design/errors- code¶
- status¶
- message¶
- details¶
- class httpstan.schemas.CreateModelRequest(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]¶
Bases:
marshmallow.SchemaSchema for request to build a Stan program.
- program_code¶
- class httpstan.schemas.Model(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]¶
Bases:
marshmallow.SchemaBase schema class with which to define schemas.
Example usage:
import datetime as dt from dataclasses import dataclass from marshmallow import Schema, fields @dataclass class Album: title: str release_date: dt.date class AlbumSchema(Schema): title = fields.Str() release_date = fields.Date() album = Album("Beggars Banquet", dt.date(1968, 12, 6)) schema = AlbumSchema() data = schema.dump(album) data # {'release_date': '1968-12-06', 'title': 'Beggars Banquet'}
- Parameters:
only – Whitelist of the declared fields to select when instantiating the Schema. If None, all fields are used. Nested fields can be represented with dot delimiters.
exclude – Blacklist of the declared fields to exclude when instantiating the Schema. If a field appears in both only and exclude, it is not used. Nested fields can be represented with dot delimiters.
many – Should be set to True if
objis a collection so that the object will be serialized to a list.context – Optional context passed to
fields.Methodandfields.Functionfields.load_only – Fields to skip during serialization (write-only fields)
dump_only – Fields to skip during deserialization (read-only fields)
partial – Whether to ignore missing fields and not require any fields declared. Propagates down to
Nestedfields as well. If its value is an iterable, only missing fields listed in that iterable will be ignored. Use dot delimiters to specify nested fields.unknown – Whether to exclude, include, or raise an error for unknown fields in the data. Use EXCLUDE, INCLUDE or RAISE.
Changed in version 3.0.0: prefix parameter removed.
- name¶
- compiler_output¶
- stanc_warnings¶
- class httpstan.schemas.Data(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]¶
Bases:
marshmallow.SchemaData for a Stan model.
- class httpstan.schemas.CreateFitRequest(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]¶
Bases:
marshmallow.SchemaSchema for request to start sampling.
Only two algorithms are supported:
hmc_nuts_diag_e_adaptandfixed_param.Sampler parameters can be found in
httpstan/stan_services.cpp.- function¶
- data¶
- init¶
- random_seed¶
- chain¶
- init_radius¶
- num_warmup¶
- num_samples¶
- num_thin¶
- save_warmup¶
- refresh¶
- stepsize¶
- stepsize_jitter¶
- max_depth¶
- delta¶
- gamma¶
- kappa¶
- t0¶
- init_buffer¶
- term_buffer¶
- window¶
- class httpstan.schemas.Fit(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]¶
Bases:
marshmallow.SchemaBase schema class with which to define schemas.
Example usage:
import datetime as dt from dataclasses import dataclass from marshmallow import Schema, fields @dataclass class Album: title: str release_date: dt.date class AlbumSchema(Schema): title = fields.Str() release_date = fields.Date() album = Album("Beggars Banquet", dt.date(1968, 12, 6)) schema = AlbumSchema() data = schema.dump(album) data # {'release_date': '1968-12-06', 'title': 'Beggars Banquet'}
- Parameters:
only – Whitelist of the declared fields to select when instantiating the Schema. If None, all fields are used. Nested fields can be represented with dot delimiters.
exclude – Blacklist of the declared fields to exclude when instantiating the Schema. If a field appears in both only and exclude, it is not used. Nested fields can be represented with dot delimiters.
many – Should be set to True if
objis a collection so that the object will be serialized to a list.context – Optional context passed to
fields.Methodandfields.Functionfields.load_only – Fields to skip during serialization (write-only fields)
dump_only – Fields to skip during deserialization (read-only fields)
partial – Whether to ignore missing fields and not require any fields declared. Propagates down to
Nestedfields as well. If its value is an iterable, only missing fields listed in that iterable will be ignored. Use dot delimiters to specify nested fields.unknown – Whether to exclude, include, or raise an error for unknown fields in the data. Use EXCLUDE, INCLUDE or RAISE.
Changed in version 3.0.0: prefix parameter removed.
- name¶
- class httpstan.schemas.ShowParamsRequest(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]¶
Bases:
marshmallow.SchemaBase schema class with which to define schemas.
Example usage:
import datetime as dt from dataclasses import dataclass from marshmallow import Schema, fields @dataclass class Album: title: str release_date: dt.date class AlbumSchema(Schema): title = fields.Str() release_date = fields.Date() album = Album("Beggars Banquet", dt.date(1968, 12, 6)) schema = AlbumSchema() data = schema.dump(album) data # {'release_date': '1968-12-06', 'title': 'Beggars Banquet'}
- Parameters:
only – Whitelist of the declared fields to select when instantiating the Schema. If None, all fields are used. Nested fields can be represented with dot delimiters.
exclude – Blacklist of the declared fields to exclude when instantiating the Schema. If a field appears in both only and exclude, it is not used. Nested fields can be represented with dot delimiters.
many – Should be set to True if
objis a collection so that the object will be serialized to a list.context – Optional context passed to
fields.Methodandfields.Functionfields.load_only – Fields to skip during serialization (write-only fields)
dump_only – Fields to skip during deserialization (read-only fields)
partial – Whether to ignore missing fields and not require any fields declared. Propagates down to
Nestedfields as well. If its value is an iterable, only missing fields listed in that iterable will be ignored. Use dot delimiters to specify nested fields.unknown – Whether to exclude, include, or raise an error for unknown fields in the data. Use EXCLUDE, INCLUDE or RAISE.
Changed in version 3.0.0: prefix parameter removed.
- data¶
- class httpstan.schemas.Parameter(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]¶
Bases:
marshmallow.SchemaSchema for single parameter.
- name¶
- dims¶
- constrained_names¶
- class httpstan.schemas.WriterMessage(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]¶
Bases:
marshmallow.SchemaMessages from callback writers and loggers in
stan::callbacks.NOTE: You SHOULD NOT use this schema. This schema exists for testing and for documentation. It SHOULD NOT be used to process a large number of JSON messages. Doing so will slow down any program.
This schema is intended for messages emitted by C++ classes which inherit from
stan/callbacks/writer.hpp, andstan/callbacks/logger.hpp.
In particular, the schema matches a JSON-based “version” of the CSV-focused
stan/callbacks/stream_writer.hppandstan/callbacks/stream_logger.hpp.This version is found “inside” the httpstan-specific
httpstan/socket_writer.hppandhttpstan/socket_logger.hpp.WriterMessage is a data format for all messages written by the callback writers defined in
stan::callbacks. These writers are used by the functions defined instan::services. For example,stan::services::sample::hmc_nuts_diag_euses one logger and three writers:loggerLogger for informational and error messagesinit_writerWriter callback for unconstrained initssample_writerWriter for drawsdiagnostic_writerWriter for diagnostic information
WriterMessage is a format which is flexible enough to accommodate these different uses while still providing a predictable structure.
A WriterMessage has a field
topicwhich provides information about what the WriterMessage concerns or what produced it. For example, the topic associated with a WriterMessage written by sample_writer in the function issample.The “content” of a message is stored in the field
values. This is either a list or a mapping.- version¶
- topic¶
- values¶
- class httpstan.schemas.ShowLogProbRequest(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]¶
Bases:
marshmallow.SchemaSchema for log_prob request.
- data¶
- unconstrained_parameters¶
- adjust_transform¶
- class httpstan.schemas.ShowLogProbGradRequest(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]¶
Bases:
marshmallow.SchemaSchema for log_prob_grad request.
- data¶
- unconstrained_parameters¶
- adjust_transform¶
- class httpstan.schemas.ShowWriteArrayRequest(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]¶
Bases:
marshmallow.SchemaSchema for write_array request.
- data¶
- unconstrained_parameters¶
- include_tparams¶
- include_gqs¶
- class httpstan.schemas.ShowTransformInitsRequest(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]¶
Bases:
marshmallow.SchemaSchema for transform_inits request.
- data¶
- constrained_parameters¶