ParticleJSONDecoder

class plasmapy.particles.serialization.ParticleJSONDecoder(*, object_hook=None, **kwargs)

Bases: json.decoder.JSONDecoder

A custom JSONDecoder class to deserialize JSON objects into PlasmaPy particle objects.

Parameters:
  • object_hook – If specified, will be called with the result of every JSON object decoded and its return value will be used in place of the given dict. This can be used to provide custom deserializations (e.g. to support JSON-RPC class hinting) (If not specified, then defaults to particle_hook.).
  • **kwargs – Any keyword accepted by JSONDecoder.

Methods Summary

particle_hook(json_dict) An object_hook utilized by the json deserialization processes to decode json strings into a plasmapy particle class (AbstractParticle, CustomParticle, DimensionlessParticle, Particle).

Methods Documentation

static particle_hook(json_dict)

An object_hook utilized by the json deserialization processes to decode json strings into a plasmapy particle class (AbstractParticle, CustomParticle, DimensionlessParticle, Particle).