hadar.viewer package¶
Submodules¶
hadar.viewer.abc module¶
-
class
hadar.viewer.abc.
ABCElementPlotting
¶ Bases:
abc.ABC
Abstract interface to implement to plot graphics
-
candles
(open: numpy.ndarray, close: numpy.ndarray, title: str)¶ Plot candle stick with open close :param open: candle open data :param close: candle close data :param title: title to plot :return:
-
gaussian
(rac: numpy.ndarray, qt: numpy.ndarray, title: str)¶ Plot gaussian.
Parameters: - rac – Remain Available Capacities matrix (to plot green or red point)
- qt – value vector
- title – title to plot
Returns:
-
map_exchange
(nodes, lines, limit, title, zoom)¶ Plot map with exchanges as arrow.
Parameters: - nodes – node to set on map
- lines – arrow to se on map
- limit – colorscale limit to use
- title – title to plot
- zoom – zoom to set on map
Returns:
-
matrix
(data: numpy.ndarray, title)¶ Plot matrix (heatmap)
Parameters: - data – 2D matrix to plot
- title – title to plot
Returns:
-
monotone
(y: numpy.ndarray, title: str)¶ Plot monotone.
Parameters: - y – value vector
- title – title to plot
Returns:
-
stack
(areas: List[Tuple[str, numpy.ndarray]], lines: List[Tuple[str, numpy.ndarray]], title: str)¶ Plot stack.
Parameters: - areas – list of timelines to stack with area
- lines – list of timelines to stack with line
- title – title to plot
Returns:
-
timeline
(df: pandas.core.frame.DataFrame, title: str)¶ Plot timeline with all scenarios.
Parameters: - df – dataframe with scenario on columns and time on index
- title – title to plot
Returns:
-
-
class
hadar.viewer.abc.
ABCPlotting
(agg: hadar.analyzer.result.ResultAnalyzer, unit_symbol: str = '', time_start=None, time_end=None, node_coord: Dict[str, List[float]] = None)¶ Bases:
abc.ABC
Abstract method to plot optimizer result.
-
network
(network: str = 'default')¶ Entry point to use fluent API.
Parameters: network – select network to anlyze. Default is ‘default’ Returns: NetworkFluentAPISelector
-
-
class
hadar.viewer.abc.
ConsumptionFluentAPISelector
(plotting: hadar.viewer.abc.ABCElementPlotting, agg: hadar.analyzer.result.ResultAnalyzer, network: str, name: str, node: str, kind: str)¶ Bases:
hadar.viewer.abc.FluentAPISelector
Consumption level of fluent api.
-
gaussian
(t: int = None, scn: int = None)¶ Plot gaussian graphics
Parameters: - t – focus on t index
- scn – focus on scn index if t not given
Returns:
-
monotone
(t: int = None, scn: int = None)¶ Plot monotone graphics.
Parameters: - t – focus on t index
- scn – focus on scn index if t not given
Returns:
-
timeline
()¶ Plot timeline graphics. :return:
-
-
class
hadar.viewer.abc.
DestConverterFluentAPISelector
(plotting: hadar.viewer.abc.ABCElementPlotting, agg: hadar.analyzer.result.ResultAnalyzer, network: str, node: str, name: str)¶ Bases:
hadar.viewer.abc.FluentAPISelector
Source converter level of fluent api
-
gaussian
(t: int = None, scn: int = None)¶ Plot gaussian graphics
Parameters: - t – focus on t index
- scn – focus on scn index if t not given
Returns:
-
monotone
(t: int = None, scn: int = None)¶ Plot monotone graphics.
Parameters: - t – focus on t index
- scn – focus on scn index if t not given
Returns:
-
timeline
()¶ Plot timeline graphics. :return:
-
-
class
hadar.viewer.abc.
FluentAPISelector
(plotting: hadar.viewer.abc.ABCElementPlotting, agg: hadar.analyzer.result.ResultAnalyzer)¶ Bases:
abc.ABC
-
static
not_both
(t: int, scn: int)¶
-
static
-
class
hadar.viewer.abc.
LinkFluentAPISelector
(plotting: hadar.viewer.abc.ABCElementPlotting, agg: hadar.analyzer.result.ResultAnalyzer, network: str, src: str, dest: str, kind: str)¶ Bases:
hadar.viewer.abc.FluentAPISelector
Link level of fluent api
-
gaussian
(t: int = None, scn: int = None)¶ Plot gaussian graphics
Parameters: - t – focus on t index
- scn – focus on scn index if t not given
Returns:
-
monotone
(t: int = None, scn: int = None)¶ Plot monotone graphics.
Parameters: - t – focus on t index
- scn – focus on scn index if t not given
Returns:
-
timeline
()¶ Plot timeline graphics. :return:
-
-
class
hadar.viewer.abc.
NetworkFluentAPISelector
(plotting: hadar.viewer.abc.ABCElementPlotting, agg: hadar.analyzer.result.ResultAnalyzer, network: str)¶ Bases:
hadar.viewer.abc.FluentAPISelector
Network level of fluent API
-
map
(t: int, zoom: int, scn: int = 0, limit: int = None)¶ Plot map exchange graphics
Parameters: - t – t index to focus
- zoom – zoom to set
- scn – scn index to focus
- limit – color scale limite to use
Returns:
-
node
(node: str)¶ Go to node level fo fluent API :param node: node name :return: NodeFluentAPISelector
-
rac_matrix
()¶ plot RAC matrix graphics
Returns:
-
-
class
hadar.viewer.abc.
NodeFluentAPISelector
(plotting: hadar.viewer.abc.ABCElementPlotting, agg: hadar.analyzer.result.ResultAnalyzer, network: str, node: str)¶ Bases:
hadar.viewer.abc.FluentAPISelector
Node level of fluent api
-
consumption
(name: str, kind: str = 'given') → hadar.viewer.abc.ConsumptionFluentAPISelector¶ Go to consumption level of fluent API
Parameters: - name – select consumption name
- kind – kind of data ‘asked’ or ‘given’
Returns:
-
from_converter
(name: str)¶ get a converter importation level fluent API :param name: :return:
-
link
(dest: str, kind: str = 'used')¶ got to link level of fluent API
Parameters: - dest – select destination node name
- kind – kind of data available (‘avail’) or ‘used’
Returns:
-
production
(name: str, kind: str = 'used') → hadar.viewer.abc.ProductionFluentAPISelector¶ Go to production level of fluent API
Parameters: - name – select production name
- kind – kind of data available (‘avail’) or ‘used’
Returns:
-
stack
(scn: int = 0, prod_kind: str = 'used', cons_kind: str = 'asked')¶ Plot with production stacked with area and consumptions stacked by dashed lines.
Parameters: - node – select node to plot.
- scn – scenario index to plot.
- prod_kind – select which prod to stack : available (‘avail’) or ‘used’
- cons_kind – select which cons to stack : ‘asked’ or ‘given’
Returns: plotly figure or jupyter widget to plot
-
storage
(name: str) → hadar.viewer.abc.StorageFluentAPISelector¶ Got o storage level of fluent API
Parameters: name – select storage name Returns:
-
to_converter
(name: str)¶ get a converter exportation level fluent API :param name: :return:
-
-
class
hadar.viewer.abc.
ProductionFluentAPISelector
(plotting: hadar.viewer.abc.ABCElementPlotting, agg: hadar.analyzer.result.ResultAnalyzer, network: str, name: str, node: str, kind: str)¶ Bases:
hadar.viewer.abc.FluentAPISelector
Production level of fluent api
-
gaussian
(t: int = None, scn: int = None)¶ Plot gaussian graphics
Parameters: - t – focus on t index
- scn – focus on scn index if t not given
Returns:
-
monotone
(t: int = None, scn: int = None)¶ Plot monotone graphics.
Parameters: - t – focus on t index
- scn – focus on scn index if t not given
Returns:
-
timeline
()¶ Plot timeline graphics. :return:
-
-
class
hadar.viewer.abc.
SrcConverterFluentAPISelector
(plotting: hadar.viewer.abc.ABCElementPlotting, agg: hadar.analyzer.result.ResultAnalyzer, network: str, node: str, name: str)¶ Bases:
hadar.viewer.abc.FluentAPISelector
Source converter level of fluent api
-
gaussian
(t: int = None, scn: int = None)¶ Plot gaussian graphics
Parameters: - t – focus on t index
- scn – focus on scn index if t not given
Returns:
-
monotone
(t: int = None, scn: int = None)¶ Plot monotone graphics.
Parameters: - t – focus on t index
- scn – focus on scn index if t not given
Returns:
-
timeline
()¶ Plot timeline graphics. :return:
-
-
class
hadar.viewer.abc.
StorageFluentAPISelector
(plotting: hadar.viewer.abc.ABCElementPlotting, agg: hadar.analyzer.result.ResultAnalyzer, network: str, node: str, name: str)¶ Bases:
hadar.viewer.abc.FluentAPISelector
Storage level of fluent API
-
candles
(scn: int = 0)¶
-
monotone
(t: int = None, scn: int = None)¶ Plot monotone graphics.
Parameters: - t – focus on t index
- scn – focus on scn index if t not given
Returns:
-
hadar.viewer.html module¶
-
class
hadar.viewer.html.
HTMLPlotting
(agg: hadar.analyzer.result.ResultAnalyzer, unit_symbol: str = '', time_start=None, time_end=None, node_coord: Dict[str, List[float]] = None)¶ Bases:
hadar.viewer.abc.ABCPlotting
Plotting implementation interactive html graphics. (Use plotly)