mirror of
https://github.com/pim-n/pg-rad
synced 2026-02-02 14:33:09 +01:00
Add air density. Add docstring for Landscape
This commit is contained in:
@ -8,9 +8,20 @@ from pg_rad.objects import Source
|
|||||||
class Landscape:
|
class Landscape:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
air_density: float = 1.243,
|
||||||
size: int | tuple[int, int, int] = 500,
|
size: int | tuple[int, int, int] = 500,
|
||||||
scale = 'meters',
|
scale = 'meters',
|
||||||
):
|
):
|
||||||
|
"""_A generic Landscape that can contain a Path and sources._
|
||||||
|
|
||||||
|
Args:
|
||||||
|
air_density (float, optional): _Air density in kg / m^3_. Defaults to 1.243.
|
||||||
|
size (int | tuple[int, int, int], optional): _Size of the world_. Defaults to 500.
|
||||||
|
scale (str, optional): _The scale of the size argument passed_. Defaults to 'meters'.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
TypeError: _description_
|
||||||
|
"""
|
||||||
|
|
||||||
if isinstance(size, int):
|
if isinstance(size, int):
|
||||||
self.world = np.zeros((size, size, size))
|
self.world = np.zeros((size, size, size))
|
||||||
@ -19,6 +30,7 @@ class Landscape:
|
|||||||
else:
|
else:
|
||||||
raise TypeError("size must be an integer or a tuple of 3 integers.")
|
raise TypeError("size must be an integer or a tuple of 3 integers.")
|
||||||
|
|
||||||
|
self.air_density = air_density
|
||||||
self.scale = scale
|
self.scale = scale
|
||||||
|
|
||||||
self.path: Path = None
|
self.path: Path = None
|
||||||
|
|||||||
Reference in New Issue
Block a user