-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stub implementation of JEDI geothermal #169
- Loading branch information
1 parent
d72d04f
commit 94ddec5
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |