From 7f1fc0a0f2fcb7f185c74ceb93b184a20183e9c1 Mon Sep 17 00:00:00 2001 From: softwareengineerprogrammer <4056124+softwareengineerprogrammer@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:35:24 -0700 Subject: [PATCH] workaround pint's apparent inability to handle '%' as a unit in python3.8 --- src/geophires_x/Economics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geophires_x/Economics.py b/src/geophires_x/Economics.py index 6590535e..316125f2 100644 --- a/src/geophires_x/Economics.py +++ b/src/geophires_x/Economics.py @@ -1383,7 +1383,7 @@ def __init__(self, model: Model): ) fir_default_unit = PercentUnit.PERCENT - fir_default_val = self.discountrate.quantity().to(fir_default_unit.value).magnitude + fir_default_val = self.discountrate.quantity().to('percent').magnitude # pint can't handle '%' in python 3.8 self.FixedInternalRate = self.ParameterDict[self.FixedInternalRate.Name] = floatParameter( "Fixed Internal Rate", DefaultValue=fir_default_val,