PlotSettings#

pydantic model skysim.settings.PlotSettings[source]#

Settings subclass to hold values used when generating the final plot Additionally contains a copy of all attributes belonging to the Settings instance it inherits from.

Config:
  • arbitrary_types_allowed: bool = True

  • extra: str = forbid

  • frozen: bool = True

Fields:
Validators:
field dpi [Required]#

Dots per inch, passed to matplotlib.

Constraints:
  • gt = 0

Validated by:
field figure_size [Required]#

Size of the figure in inches to pass to matplotlib.

Validated by:
field filename [Required]#

Location to save the plot.

Validated by:
field fps [Required]#

Frames per second of the GIF/video generated. Zero if there is only one frame.

Constraints:
  • ge = 0

Validated by:
validator check_parent_directory_exists  »  filename[source]#

Raise an error if the directory in which to save the image doesn’t exist.

Parameters:
filenamepathlib.Path

Location to save image.

Returns:
pathlib.Path

Same as input.

Raises:
ValueError

Raised if parent directory does not exist.

validator validate_fps  »  fps[source]#

Ensure fps conforms to the described requirements.

Parameters:
input_fpspydantic.NonNegativeFloat

Frames per second as input when instantiating the PlotSettings object.

infopydantic.ValidationInfo

Pydantic ValidationInfo object allowing access to the other already-validated fields.

Returns:
pydantic.NonNegativeFloat

Validated fps.

Raises:
ValueError

Raised if fps is given as zero but the observation duration implies there should be multiple frames.

property datetime_strings#

Printable observation times.

Returns:
list[str]

List of strings for each time.

property observation_info#

Generate a string containing information about the observation for the plot. Only contains information which is constant throughout all snapshots.

Returns:
str

Formatted string.

property tempfile_path#

Path to store video frame files.

Returns:
pathlib.Path

Directory.

property tempfile_zfill#

How much zero-padding to use when writing the video frame filenames.

Returns:
int

Number of digits.