How to use the eemeter.ee.derivatives.Derivative function in eemeter

To help you get started, we’ve selected a few eemeter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openeemeter / eemeter / tests / io / test_serialize_derivative_pairs.py View on Github external
DerivativePair(
            "label",
            "ANNUALIZED_WEATHER_NORMAL",
            "ELECTRICITY_CONSUMPTION_SUPPLIED",
            "KWH",
            Derivative("1", 10, 3, 3, 5,
                       OrderedDict([('2011-01-01T00:00:00+00:00', 32.0)])),
            Derivative("2", 10, 6, 6, 5, None),
        ),
        DerivativePair(
            "label",
            "GROSS_PREDICTED",
            "ELECTRICITY_CONSUMPTION_SUPPLIED",
            "KWH",
            None,
            Derivative("2", 10, 8, 8, 5, None),
        ),
github openeemeter / eemeter / tests / io / test_serialize_derivative_pairs.py View on Github external
def derivative_pairs():
    return [
        DerivativePair(
            "label",
            "ANNUALIZED_WEATHER_NORMAL",
            "ELECTRICITY_CONSUMPTION_SUPPLIED",
            "KWH",
            Derivative("1", 10, 3, 3, 5,
                       OrderedDict([('2011-01-01T00:00:00+00:00', 32.0)])),
            Derivative("2", 10, 6, 6, 5, None),
        ),
        DerivativePair(
            "label",
            "GROSS_PREDICTED",
            "ELECTRICITY_CONSUMPTION_SUPPLIED",
            "KWH",
            Derivative("1", None, None, None, None, None),
            Derivative("2", 10, 8, 8, 5, None),
        ),
github openeemeter / eemeter / tests / io / test_serialize_derivative_pairs.py View on Github external
def derivative_pairs_badly_formed():
    return [
        DerivativePair(
            "label",
            "ANNUALIZED_WEATHER_NORMAL",
            "ELECTRICITY_CONSUMPTION_SUPPLIED",
            "KWH",
            Derivative("1", 10, 3, 3, 5,
                       OrderedDict([('2011-01-01T00:00:00+00:00', 32.0)])),
            Derivative("2", 10, 6, 6, 5, None),
        ),
        DerivativePair(
            "label",
            "GROSS_PREDICTED",
            "ELECTRICITY_CONSUMPTION_SUPPLIED",
            "KWH",
            None,
            Derivative("2", 10, 8, 8, 5, None),
        ),
github openeemeter / eemeter / eemeter / io / serializers / aggregation_input.py View on Github external
def _deserialize_derivative_pairs(derivatives):

    # check for "derivative_interpretation" key
    derivative_pairs, error = _get_key_or_error(
        derivatives, "derivative_pairs", "DERIVATIVE_PAIRS")
    if derivative_pairs is None:
        return error

    try:
        return [
            DerivativePair(
                pair["label"],
                pair["derivative_interpretation"],
                pair["trace_interpretation"],
                pair["unit"],
                Derivative(
                    None,
                    pair["baseline_value"],
                    pair["baseline_lower"],
                    pair["baseline_upper"],
                    pair["baseline_n"],
                    None
                ),
                Derivative(
                    None,
                    pair["reporting_value"],
                    pair["reporting_lower"],
                    pair["reporting_upper"],
                    pair["reporting_n"],
                    None
                ),
            ) for pair in derivative_pairs
github openeemeter / eemeter / eemeter / io / serializers / aggregation_input.py View on Github external
try:
        return [
            DerivativePair(
                pair["label"],
                pair["derivative_interpretation"],
                pair["trace_interpretation"],
                pair["unit"],
                Derivative(
                    None,
                    pair["baseline_value"],
                    pair["baseline_lower"],
                    pair["baseline_upper"],
                    pair["baseline_n"],
                    None
                ),
                Derivative(
                    None,
                    pair["reporting_value"],
                    pair["reporting_lower"],
                    pair["reporting_upper"],
                    pair["reporting_n"],
                    None
                ),
            ) for pair in derivative_pairs
        ]
    except KeyError:
        return {
            "error": "Missing key in derivative_pair serialization."
        }
github openeemeter / eemeter / eemeter / io / serializers / aggregation_input.py View on Github external
def _deserialize_simple_default(default_value):
    try:
        return Derivative(
            None,
            default_value["value"],
            default_value["lower"],
            default_value["upper"],
            default_value["n"],
            None
        )
    except:
        return {
            "error": "Missing key in default_value serialization."
        }