Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
alanisaac committed Nov 22, 2023
1 parent 1c1a544 commit 4dd7599
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 14 deletions.
17 changes: 12 additions & 5 deletions rules-engine/src/rules_engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@
from typing import Any, List, Optional, Tuple

import numpy as np
from rules_engine.pydantic_models import (AnalysisType, BalancePointGraph,
DhwInput, FuelType,
NaturalGasBillingInput,
OilPropaneBillingInput, SummaryInput,
SummaryOutput, TemperatureInput)

from rules_engine.pydantic_models import (
AnalysisType,
BalancePointGraph,
DhwInput,
FuelType,
NaturalGasBillingInput,
OilPropaneBillingInput,
SummaryInput,
SummaryOutput,
TemperatureInput,
)


def get_outputs_oil_propane(
Expand Down
2 changes: 1 addition & 1 deletion rules-engine/src/rules_engine/pydantic_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class FuelType(Enum):
PROPANE = 91333


def validate_fuel_type(value: Any):
def validate_fuel_type(value: Any) -> FuelType:
if isinstance(value, FuelType):
return value

Expand Down
12 changes: 9 additions & 3 deletions rules-engine/tests/test_rules_engine/test_engine.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import pytest
from pytest import approx

from rules_engine import engine
from rules_engine.pydantic_models import (BalancePointGraph, DhwInput,
FuelType, NaturalGasBillingInput,
SummaryInput, SummaryOutput)
from rules_engine.pydantic_models import (
BalancePointGraph,
DhwInput,
FuelType,
NaturalGasBillingInput,
SummaryInput,
SummaryOutput,
)


@pytest.mark.parametrize(
Expand Down
14 changes: 9 additions & 5 deletions rules-engine/tests/test_rules_engine/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@
import pytest
from pydantic import BaseModel
from pytest import approx
from rules_engine import engine
from rules_engine.pydantic_models import (NaturalGasBillingInput,
NaturalGasBillingRecordInput,
SummaryInput, SummaryOutput,
TemperatureInput)
from typing_extensions import Annotated

from rules_engine import engine
from rules_engine.pydantic_models import (
NaturalGasBillingInput,
NaturalGasBillingRecordInput,
SummaryInput,
SummaryOutput,
TemperatureInput,
)

# Test inputs are provided as separate directory within the "cases/examples" directory
# Each subdirectory contains a JSON file (named summary.json) which specifies the inputs for the test runner
ROOT_DIR = pathlib.Path(__file__).parent / "cases" / "examples"
Expand Down

0 comments on commit 4dd7599

Please sign in to comment.