1
1
"""
2
2
Common handler and converter of scenariodat for cicero
3
+
3
4
Class will be inherited by subversions to get specific
4
5
handling
5
6
"""
19
20
20
21
def _unit_conv_factor (unit , cicero_unit ):
21
22
"""
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
23
26
in openscm_units
24
27
"""
25
28
with openscm_units .unit_registry .context ("NOx_conversions" ):
@@ -105,6 +108,8 @@ def __init__(self, udir, syear=2015, eyear=2100):
105
108
def initialize_units_comps (self , gasfile ):
106
109
"""
107
110
Get the list of gas components and units
111
+
112
+ Get the list of gas components and untis
108
113
from the gases file:
109
114
"""
110
115
with open (gasfile , encoding = "ascii" ) as txt_rcpfile :
@@ -170,7 +175,7 @@ def transform_scenarioframe(self, scenarioframe):
170
175
)
171
176
years = scenarioframe .columns
172
177
173
- if not isinstance (years [0 ], np .int64 ):
178
+ if not isinstance (years [0 ], ( np .int64 , np . int32 ) ):
174
179
yearsint = [np .int64 (d .year ) for d in years ]
175
180
scenarioframe .rename (
176
181
lambda d : np .int64 (d .year ), axis = "columns" , inplace = True
@@ -190,6 +195,8 @@ def transform_scenarioframe(self, scenarioframe):
190
195
191
196
def make_printoutframe (self , scenarioframe , ssp245data ):
192
197
"""
198
+ Take scenarioframe and convert to cicero format emissions
199
+
193
200
Take scenarioframe and convert to cicero format
194
201
emissions data to write to file or pass as dataframe
195
202
"""
0 commit comments