emod_api.channelreports.channels module¶
Module for reading InsetChart.json channels.
- class emod_api.channelreports.channels.Channel(title: str, units: str, data: List)[source]¶
Bases:
object
- property data¶
- class emod_api.channelreports.channels.ChannelReport(filename: Optional[str] = None, **kwargs)[source]¶
Bases:
object
- property header: emod_api.channelreports.channels.Header¶
- property channel_names: List¶
- property channels: Dict¶
Channel objects keyed on channel name/title
- write_file(filename: str, indent: int = 0, separators=(',', ':')) None [source]¶
Write inset chart to specified text file.
- to_csv(filename: Union[str, pathlib.Path], channel_names: Optional[List[str]] = None, transpose: bool = False) None [source]¶
Write each channel from the report to a row, CSV style, in the given file.
Channel name goes in the first column, channel data goes into subsequent columns.
- Parameters
filename – string or path specifying destination file
channel_names – optional list of channels (by name) to write to the file
transpose – write channels as columns rather than rows