Skip to content

Commit

Permalink
Make ResultLocations and ResultLocationsCreator inherit from ABC.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gediminas Kirsanskas committed Nov 22, 2024
1 parent 9829ebe commit d7e10cb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mikeio1d/result_network/result_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from DHI.Mike1D.ResultDataAccess import ResultData
from DHI.Mike1D.ResultDataAccess import IDataItems

from abc import ABC
from abc import abstractmethod
import pandas as pd

from ..dotnet import pythonnet_implementation as impl
Expand All @@ -35,7 +37,7 @@
from .various import build_html_repr_from_sections


class ResultLocations(Dict[str, ResultLocation]):
class ResultLocations(ABC, Dict[str, ResultLocation]):
"""A base class for a network locations (nodes, reaches) or a catchments wrapper class."""

def __init__(self):
Expand Down Expand Up @@ -120,7 +122,7 @@ def read(
return df


class ResultLocationsCreator:
class ResultLocationsCreator(ABC):
"""A base helper class for creating ResultLocations.
Parameters
Expand Down Expand Up @@ -156,9 +158,10 @@ def __init__(self, result_locations: ResultLocations, res1d: Res1D):
self.result_quantity_map: Dict[str : List[ResultQuantity]] = {}
self.result_quantity_derived_map: Dict[str, List[ResultQuantityDerived]] = {}

@abstractmethod
def create(self):
"""Perform ResultLocations creation steps."""
pass
...

def repr_html_(self) -> str:
"""HTML representation."""
Expand Down

0 comments on commit d7e10cb

Please sign in to comment.