Skip to content

Commit 5e2477c

Browse files
committed
create thermo coverage dep polynomial model in numpy array class with new __repr__ method
1 parent 1adced1 commit 5e2477c

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

rmgpy/thermo/nasa.pyx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ cimport numpy as np
3434
from libc.math cimport log
3535

3636
cimport rmgpy.constants as constants
37+
from rmgpy.util import np_list
3738

3839
################################################################################
3940

@@ -313,8 +314,8 @@ cdef class NASA(HeatCapacityModel):
313314
for species, parameters in value.items():
314315
# just the polynomial model for now
315316
processed_parameters = {'model': parameters['model'],
316-
'enthalpy-coefficients': np.array([p for p in parameters['enthalpy-coefficients']]),
317-
'entropy-coefficients': np.array([p for p in parameters['entropy-coefficients']]),
317+
'enthalpy-coefficients': np_list([p for p in parameters['enthalpy-coefficients']]),
318+
'entropy-coefficients': np_list([p for p in parameters['entropy-coefficients']]),
318319
}
319320
self._thermo_coverage_dependence[species] = processed_parameters
320321

rmgpy/thermo/thermodata.pyx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ cimport numpy as np
3535
from libc.math cimport log
3636

3737
import rmgpy.quantity as quantity
38+
from rmgpy.util import np_list
3839

3940
################################################################################
4041

@@ -128,8 +129,8 @@ cdef class ThermoData(HeatCapacityModel):
128129
for species, parameters in value.items():
129130
# just the polynomial model for now
130131
processed_parameters = {'model': parameters['model'],
131-
'enthalpy-coefficients': np.array([p for p in parameters['enthalpy-coefficients']]),
132-
'entropy-coefficients': np.array([p for p in parameters['entropy-coefficients']]),
132+
'enthalpy-coefficients': np_list([p for p in parameters['enthalpy-coefficients']]),
133+
'entropy-coefficients': np_list([p for p in parameters['entropy-coefficients']]),
133134
}
134135
self._thermo_coverage_dependence[species] = processed_parameters
135136

rmgpy/thermo/wilhoit.pyx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ from libc.math cimport sqrt, log
3535

3636
cimport rmgpy.constants as constants
3737
import rmgpy.quantity as quantity
38+
from rmgpy.util import np_list
3839

3940
# Prior to numpy 1.14, `numpy.linalg.lstsq` does not accept None as a value
4041
RCOND = -1 if int(np.__version__.split('.')[1]) < 14 else None
@@ -150,8 +151,8 @@ cdef class Wilhoit(HeatCapacityModel):
150151
for species, parameters in value.items():
151152
# just the polynomial model for now
152153
processed_parameters = {'model': parameters['model'],
153-
'enthalpy-coefficients': np.array([p for p in parameters['enthalpy-coefficients']]),
154-
'entropy-coefficients': np.array([p for p in parameters['entropy-coefficients']]),
154+
'enthalpy-coefficients': np_list([p for p in parameters['enthalpy-coefficients']]),
155+
'entropy-coefficients': np_list([p for p in parameters['entropy-coefficients']]),
155156
}
156157
self._thermo_coverage_dependence[species] = processed_parameters
157158

@@ -213,7 +214,8 @@ cdef class Wilhoit(HeatCapacityModel):
213214
self.Cp0, self.CpInf,
214215
self.a0, self.a1, self.a2, self.a3,
215216
self.H0, self.S0, self.B,
216-
Tmin=self.Tmin, Tmax=self.Tmax, comment=self.comment,
217+
Tmin=self.Tmin, Tmax=self.Tmax, thermo_coverage_dependence=self.thermo_coverage_dependence,
218+
comment=self.comment,
217219
)
218220

219221
@cython.boundscheck(False)

0 commit comments

Comments
 (0)