picongpu.pypicongpu.output.png

This file is part of PIConGPU. Copyright 2021-2024 PIConGPU contributors Authors: Masoud Afshari License: GPLv3+

Classes

EMFieldScaleEnum

Create a collection of name/value pairs.

ColorScaleEnum

Create a collection of name/value pairs.

Png

general interface for all plugins

Module Contents

class picongpu.pypicongpu.output.png.EMFieldScaleEnum(*args, **kwds)

Bases: enum.Enum

Inheritance diagram of picongpu.pypicongpu.output.png.EMFieldScaleEnum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

>>> Color.RED
<Color.RED: 1>
  • value lookup:

>>> Color(1)
<Color.RED: 1>
  • name lookup:

>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

AUTO = -1
PLASMA_WAVE = 3
CUSTOM = 6
INCIDENT = 7
class picongpu.pypicongpu.output.png.ColorScaleEnum(*args, **kwds)

Bases: enum.Enum

Inheritance diagram of picongpu.pypicongpu.output.png.ColorScaleEnum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

>>> Color.RED
<Color.RED: 1>
  • value lookup:

>>> Color(1)
<Color.RED: 1>
  • name lookup:

>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

RED = 'red'
GREEN = 'green'
BLUE = 'blue'
GRAY = 'gray'
GRAY_INV = 'grayInv'
NONE = 'none'
class picongpu.pypicongpu.output.png.Png

Bases: picongpu.pypicongpu.output.plugin.Plugin

Inheritance diagram of picongpu.pypicongpu.output.png.Png

general interface for all plugins

species
period
axis
slicePoint
folder
scale_image
scale_to_cellsize
white_box_per_GPU
EM_FIELD_SCALE_CHANNEL1
EM_FIELD_SCALE_CHANNEL2
EM_FIELD_SCALE_CHANNEL3
preParticleDensCol
preChannel1Col
preChannel2Col
preChannel3Col
customNormalizationSI
preParticleDens_opacity
preChannel1_opacity
preChannel2_opacity
preChannel3_opacity
preChannel1
preChannel2
preChannel3
classmethod __init_subclass__()
get_rendering_context()

retrieve a generic context containing type information specifying a subclass

Problem: Every self-registered subclass has its respective schema, and it is difficult in JSON (particularly in a mustache-compatible way) to get the type of the schema.

Solution: The normal rendering of self-registered subclasses via get_rendering_context() provides only their parameters, i.e. there is no meta information on types etc.

If a generic context is requested one can use the schema for parent class, for which this method returns the correct content. It includes metainformation and the data on the schema itself.

E.g.:

{
    "type": {
        "phasespace": true,
        "auto": false,
        ...
    },
    "data": DATA
}

where DATA is the serialization as returned by get_rendering_context().

__hash__()

custom hash function for indexing in dicts

static check_context_for_type(type_to_check: type, context: dict | None)

check if the given context is valid for the given type

Raises on error, passes silently if okay.

Raises:
  • ValidationError – on schema violation

  • RuntimeError – on schema not found