Skip to content

Commit

Permalink
drop online facility base
Browse files Browse the repository at this point in the history
  • Loading branch information
austinorr committed Jun 15, 2023
1 parent cd37e4c commit 8c43420
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
22 changes: 11 additions & 11 deletions nereid/nereid/api/api_v1/models/treatment_facility_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class DryWeatherTreatmentLowFlowFacility(LowFlowFacility):
_constructor: str = "dry_weather_treatment_low_flow_facility_constructor"


class OnlineFaciltyBase(FacilityBase):
class OnlineFacilityBase(FacilityBase): # pragma: no cover
is_online: bool = True
tributary_area_tc_min: float = Field(5.0, le=60)
offline_diversion_rate_cfs: Optional[float] = None
Expand All @@ -128,33 +128,33 @@ def required_if_offline(cls, v, values):
return v


class RetentionFacility(OnlineFaciltyBase):
class RetentionFacility(FacilityBase):
total_volume_cuft: float
area_sqft: float
inf_rate_inhr: float
_constructor: str = "retention_facility_constructor"


class RetentionFacilityHSG(OnlineFaciltyBase):
class RetentionFacilityHSG(FacilityBase):
total_volume_cuft: float
area_sqft: float
hsg: str
_constructor: str = "retention_facility_constructor"


class DryWellFacility(OnlineFaciltyBase):
class DryWellFacility(FacilityBase):
total_volume_cuft: float
treatment_rate_cfs: float
_constructor: str = "dry_well_facility_constructor"


class DryWellFacilityFlowOrVolume(OnlineFaciltyBase):
class DryWellFacilityFlowOrVolume(FacilityBase):
total_volume_cuft: float
treatment_rate_cfs: float
_constructor: str = "dry_well_facility_flow_or_volume_constructor"


class BioInfFacility(OnlineFaciltyBase):
class BioInfFacility(FacilityBase):
total_volume_cuft: float
retention_volume_cuft: float
area_sqft: float
Expand All @@ -163,7 +163,7 @@ class BioInfFacility(OnlineFaciltyBase):
_constructor: str = "bioinfiltration_facility_constructor"


class RetAndTmntFacility(OnlineFaciltyBase):
class RetAndTmntFacility(FacilityBase):
total_volume_cuft: float
retention_volume_cuft: float
area_sqft: float
Expand All @@ -172,7 +172,7 @@ class RetAndTmntFacility(OnlineFaciltyBase):
_constructor: str = "retention_and_treatment_facility_constructor"


class TmntFacility(OnlineFaciltyBase):
class TmntFacility(FacilityBase):
total_volume_cuft: float
area_sqft: float
media_filtration_rate_inhr: float
Expand All @@ -194,22 +194,22 @@ class TmntFacilityWithRetentionOverride(TmntFacility):
)


class FlowAndRetFacility(OnlineFaciltyBase):
class FlowAndRetFacility(FacilityBase):
treatment_rate_cfs: float
area_sqft: float
depth_ft: float
hsg: str
_constructor: str = "flow_and_retention_facility_constructor"


class CisternFacility(OnlineFaciltyBase):
class CisternFacility(FacilityBase):
total_volume_cuft: float
winter_demand_cfs: float = 0.0
summer_demand_cfs: float = 0.0
_constructor: str = "cistern_facility_constructor"


class PermPoolFacility(OnlineFaciltyBase):
class PermPoolFacility(FacilityBase):
pool_volume_cuft: float = 0.0
treatment_volume_cuft: float = 0.0
_constructor: str = "perm_pool_facility_constructor"
Expand Down
2 changes: 1 addition & 1 deletion nereid/nereid/tests/test_api/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
),
(
"validation error",
False,
{
"node_id": "1",
"facility_type": "biofiltration",
Expand Down
1 change: 0 additions & 1 deletion nereid/nereid/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ def generate_random_treatment_facility_request_node(
dct["captured_pct"] = numpy.random.uniform(0.1, 99.0)
del dct["retained_pct"]
dct["design_storm_depth_inches"] = numpy.random.uniform(0.75, 1.5)
dct["is_online"] = True

if "tributary_area_tc_min" in dct:
dct["tributary_area_tc_min"] = int(numpy.random.choice(range(5, 60, 5)))
Expand Down

0 comments on commit 8c43420

Please sign in to comment.