fluids

raw : dict[str, dict]

A dictionary where each key is the name of a known fluid and its value is it’s data.raw prototype entry.

Example:

import json
from draftsman.data import fluids
print(fluids.raw["petroleum-gas"])
{
    "subgroup": "fluid",
    "type": "fluid",
    "name": "petroleum-gas",
    "icon": "__base__/graphics/icons/fluid/petroleum-gas.png",
    "base_color": [
        0.3,
        0.1,
        0.3
    ],
    "default_temperature": 25,
    "order": "a[fluid]-b[oil]-b[petroleum-gas]",
    "flow_color": [
        0.8,
        0.8,
        0.8
    ]
}
add_fluid(name: str, order: str | None = None, **kwargs)

Add a new fluid, or modify the properties of an existing fluid. Useful for simulating a modded environment without having to fully supply an entire mod configuration for simple scripts.

Parameters:
name: str

The name of the fluid to add.

**kwargs

Any additional values that a fluid prototype should have.

Param:

The order string with which this fluid should be sorted with. If omitted, this fluid will be sorted by it’s regular name lexographically.

get_temperature_range(fluid_name: str) tuple[float, float]

Gets a tuple representing the [minimum, maximum] temperature range for the fluid with name fluid_name.

Parameters:
fluid_name: str

The name of the fluid.

Raises:

InvalidFluidError – if fluid_name is not a recognized fluid.

Returns:

A tuple of two floats, representing the minimum and maximum temperature this fluid can have, inclusive.