ams.core.service#
Routine services — operations and transformations on routine arrays.
Service selection guide#
Pick a service by what you need; subclass ROperationService
only if none of the existing ones fits.
Need |
Use |
|---|---|
Wrap a precomputed ndarray |
|
Apply |
|
Apply |
|
Repeat |
|
Pick gen subset by indexer |
|
Sum into zones / areas |
|
Ramp difference matrix |
|
Shape-only reduction matrix |
inline (e.g. |
Zonal load scaling |
|
UC min on/off duration |
|
Notes#
The
expand_dims=axiskwarg onNumOpcovers theNumExpandDimuse case.NumExpandDimis deprecated in v1.3.0 and slated for removal in v1.4.0 — useNumOpdirectly.VarReductionis likewise deprecated (no production users); inline the reduction matrix instead.MinDurinherits fromNumOpDualfor parameter plumbing only; the inheritedfun/rfunmachinery is unused..vcaching: subclasses recompute fresh on every access — there is no framework-level cache. OnlyValueServicereturns a stored value. Memoize at the routine level if a tight loop is hitting.vrepeatedly.
File layout#
Bases (
RBaseService,ROperationService)Static storage (
ValueService)Generic single-input ops (
NumOp,NumHstack)Generic dual-input ops (
NumOpDual)Subset / aggregation (
VarSelect,ZonalSum)Reduction / difference (
RampSub,VarReduction)Domain-specific (
LoadScale,MinDur)Deprecated, slated for removal in v1.4.0 (
NumExpandDim,VarReduction)
Classes
|
Retrieve zonal load by scaling nodal load using the specified load scale factor. |
|
Build the coefficient matrix for minimum online/offline constraints used in UC. |
|
Expand the dimensions of the input array along a specified axis using NumPy's |
|
Repeat an array along the second axis nc times or the length of reference array, using NumPy's hstack function, where nc is the column number of the reference array, |
|
Perform an operation on a numerical array using the function |
|
Performan an operation on two numerical arrays using the function |
|
Base class for services that are used in a routine. |
|
Base calss for operational services used in routine. |
|
Build a substraction matrix for a 2D variable in the shape (nr, nr-1), where nr is the rows of the input. |
|
Service to store given numeric values. |
|
A numerical matrix to reduce a 2D variable to 1D, |
|
A numerical matrix to select a subset of a 2D variable, |
|
Build zonal sum matrix for a vector in the shape of collection model, |