Skip to content

Improve JSON dumping in CompiledStanModel.with_data #204

@WardBrian

Description

@WardBrian

Stan's JSON data type has a few custom features, particularly when it comes to complex numbers and tuple types, that json.dumps does not handle correctly.

The JSON processing we use in cmdstanpy is available in the stanio package which is small and standalone. If it was added as a dependency in the [stan] group, then stanio.dump_stan_json would be a great replacement to json.dumps to handle these types (and match e.g. cmdstanpy's behavior in other cases like pandas sequences)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions