Skip to content

Commit

Permalink
Stub implementation of JEDI geothermal #169
Browse files Browse the repository at this point in the history
  • Loading branch information
softwareengineerprogrammer committed May 14, 2024
1 parent d72d04f commit 94ddec5
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
51 changes: 51 additions & 0 deletions src/jedi_geothermal/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import logging
from dataclasses import dataclass
from enum import Enum

_logger = logging.getLogger(__name__)


class ProjectGeothermalTechnology(Enum):
HYDROTHERMAL = 'Hydrothermal'
EGS = 'EGS'


class ProjectPlantType(Enum):
FLASH = 'Flash'
BINARY = 'Binary'


@dataclass
class JediGeothermalResult:
construction_period_total_jobs: int = None
construction_period_earnings_MUSD: float = None
construction_period_output_MUSD: float = None
construction_period_value_added: float = None

operating_years_annual_total_jobs: int = None
operating_years_annual_earnings_MUSD: float = None
operating_years_annual_output_MUSD: float = None
operating_years_annual_value_added_MUSD: float = None


@dataclass
class JediGeothermalInputParameters:
# TODO set default values to None, fake values are stubbed here for demonstration
project_location_state = 'ID'
year_of_construction = 2010
construction_period_months = 21
nominal_plant_size_mw_net_output = 10
technology = ProjectGeothermalTechnology.HYDROTHERMAL
resource_temperature_degC = 200
resource_depth_m = 2250

# TODO define all input parameters


class JediGeothermalClient:
def __init__(self):
self._logger = _logger

def get_jedi_geothermal_result(self, input_params: JediGeothermalInputParameters) -> JediGeothermalResult:
self._logger.info(f'Calculating JEDI result for: {input_params}')
raise NotImplementedError('Implement me please! =]')
Empty file.
23 changes: 23 additions & 0 deletions tests/jedi_geothermal_tests/test_jedi_geothermal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from base_test_case import BaseTestCase
from jedi_geothermal import JediGeothermalClient
from jedi_geothermal import JediGeothermalInputParameters
from jedi_geothermal import JediGeothermalResult


class JediGeothermalTest(BaseTestCase):

def test_basic_example(self):
client = JediGeothermalClient()

input_params = JediGeothermalInputParameters()
input_params.resource_depth_m = 2250
# TODO define rest of input_params properties

result: JediGeothermalResult = client.get_jedi_geothermal_result(input_params)
self.assertIsNotNone(result)

# TODO assert result properties are calculated from inputs correctly
# i.e.
# self.assertEqual(183, result.construction_period_total_jobs)
# self.assertEqual(1.70, result.operating_years_annual_value_added_MUSD)
# etc.

0 comments on commit 94ddec5

Please sign in to comment.