- chemistrylab.util.Visualization.fill_line(arr, x1, y1, x2, y2, lw)
- class chemistrylab.util.Visualization.matplotVisualizer(char_bench)
- legend_update_delay = 1
- class chemistrylab.util.Visualization.numbaVisualizer(char_bench)
- class chemistrylab.util.Visualization.pygameVisualizer(char_bench)
Class to visualize the chemistry benches.
The dictionary viz gives a list of observations the class can visualize. These should correspond to observations which come from the characterization bench.
Call get_rgb(vessels) to get an rgb image of your vessel observations (which visualize all observations set in the characterization bench)
The resultant image is tiled such that every row has one type of observation, and every column contains all observations for a single vessel.
- get_rgb(vessels: Tuple[Vessel])
Create an rgb image corresponding to the observations of each vessel.
- render_PVT(vessel: Vessel, x: int, y: int)
Method to create a bar graph of the pressure,volume, and temperature of a vessel
- render_layers(vessel: Vessel, x: int, y: int)
Method to visualize the layer information of a vessel.
- render_spectra(vessel: Vessel, x: int, y: int)
Method to visualize the spectral information of a vessel.
Converts a 4-channel rgba image into a 3-channel rgb image
This module provides a default set of reward functions.
- class chemistrylab.util.reward.RewardGenerator(use_purity, exclude_solvents, include_dissolved, exclude_mat=None)
RewardGenerator class generates rewards for a given set of vessels and desired materials.
use_purity (bool) – True if reward is based on purity, False if reward is based on the amount of desired material.
exclude_solvents (bool) – True if solvents should be excluded from the total amount of materials for purity calculations.
include_dissolved (bool) – True if reward should include dissolved material components in the vessels as the desired material.
exclude_mat (str, optional) – A string representing a material which gives a negative reward.
This class returns callable objects, which serve as reward functions
- __call__(vessels: Tuple[Vessel], desired_material: str, exclude_material: str | None = None)
Assign a reward to a set of vessels based off of what is desired/undesired
A floating point number representing the calculated reward.
- Return type:
- chemistrylab.util.reward.get_dissolved_amounts(vessel: Vessel, desired_material: str)