Skip to content

Commit 3851788

Browse files
committed
Trying to fix Windows int data type problem
1 parent 01a1b15 commit 3851788

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/openscm_runner/adapters/utils/cicero_utils/make_scenario_common.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""
22
Common handler and converter of scenariodat for cicero
3+
34
Class will be inherited by subversions to get specific
45
handling
56
"""
@@ -19,7 +20,9 @@
1920

2021
def _unit_conv_factor(unit, cicero_unit):
2122
"""
22-
Convert cicero units that can't be automatically dealt with
23+
Convert cicero units
24+
25+
Conversion for cicero units that can't be automatically dealt with
2326
in openscm_units
2427
"""
2528
with openscm_units.unit_registry.context("NOx_conversions"):
@@ -105,6 +108,8 @@ def __init__(self, udir, syear=2015, eyear=2100):
105108
def initialize_units_comps(self, gasfile):
106109
"""
107110
Get the list of gas components and units
111+
112+
Get the list of gas components and untis
108113
from the gases file:
109114
"""
110115
with open(gasfile, encoding="ascii") as txt_rcpfile:
@@ -170,7 +175,7 @@ def transform_scenarioframe(self, scenarioframe):
170175
)
171176
years = scenarioframe.columns
172177

173-
if not isinstance(years[0], np.int64):
178+
if not isinstance(years[0], (np.int64, np.int32)):
174179
yearsint = [np.int64(d.year) for d in years]
175180
scenarioframe.rename(
176181
lambda d: np.int64(d.year), axis="columns", inplace=True
@@ -190,6 +195,8 @@ def transform_scenarioframe(self, scenarioframe):
190195

191196
def make_printoutframe(self, scenarioframe, ssp245data):
192197
"""
198+
Take scenarioframe and convert to cicero format emissions
199+
193200
Take scenarioframe and convert to cicero format
194201
emissions data to write to file or pass as dataframe
195202
"""

0 commit comments

Comments
 (0)