Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JEDI Geothermal Implementation #221

Open
softwareengineerprogrammer opened this issue May 16, 2024 · 0 comments
Open

JEDI Geothermal Implementation #221

softwareengineerprogrammer opened this issue May 16, 2024 · 0 comments
Labels
enhancement New feature or improvement (as opposed to bug/problem)

Comments

@softwareengineerprogrammer
Copy link
Collaborator

softwareengineerprogrammer commented May 16, 2024

Parent issue: #169


Implementation being handled by @aimiktena & @natakokota (I can't assign them directly because they are not added as collaborators on this repo)


  1. Download a fresh copy of 01d-jedi-geothermal-model-rel-gt12-23-16.xlsm and open it in Excel (other programs such as Google Sheets or Numbers on Mac may also work, although Excel is recommended to reduce chances of compatibility issues affecting formulas). It is strongly recommended that you DO NOT REUSE the same original file repeatedly in order to reduce the risk of accidentally editing it. You should be careful to avoid editing the sheet at all throughout this entire process, as it will be hard to catch and correct alterations.

  2. Pick an initial output to calculate from the Summary Results sheet, i.e. Jobs (FTE) Total Impacts in cell B28:
    image

  3. Add the output to JediGeothermalResult, suffixed with units, i.e. operating_years_annual_earnings_MUSD:

    @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

  4. Using Excel, follow & write down the formulas that calculate that output until you get back to inputs

  5. Add the required inputs to JediGeothermalInputParameters (if not already present), i.e. resource_depth_m:

    @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

  6. Add a python function to src/jedi_geothermal/__init__.py that implements the formula you wrote down, calculating the output from the inputs, i.e.

def get_operating_years_annual_earnings_MUSD(resource_depth_m):
    return resource_depth_m * 5 # dummy example formula, obviously =]
  1. Call the function in get_jedi_geothermal_result using input values from input_params and setting the corresponding output on JediGeothermalResult, i.e.
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}')
        result: JediGeothermalResult = JediGeothermalResult
        result.operating_years_annual_earnings_MUSD = get_operating_years_annual_earnings_MUSD(input_params.resource_depth_m)
       
      # [... other calculations ...]
      
       return result
  1. Write one or more tests in tests/jedi_geothermal_tests/test_jedi_geothermal.py i.e.
def test_calculate_operating_years_annual_earnings():
    self.assertEqual(500, get_operating_years_annual_earnings_MUSD(100))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement (as opposed to bug/problem)
Projects
None yet
Development

No branches or pull requests

1 participant