Skip to content

Commit e99199c

Browse files
committed
rename formulas to site_formulae
1 parent 70f53d3 commit e99199c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

burnman/classes/elasticsolutionmodel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class ElasticMechanicalSolution(ElasticSolutionModel):
227227
def __init__(self, endmembers):
228228
self.endmembers = endmembers
229229
self.n_endmembers = len(endmembers)
230-
self.formulas = [e[1] for e in endmembers]
230+
self.site_formulae = [e[1] for e in endmembers]
231231

232232
def excess_helmholtz_energy(self, volume, temperature, molar_fractions):
233233
return 0.0
@@ -263,7 +263,7 @@ class ElasticIdealSolution(ElasticSolutionModel):
263263
def __init__(self, endmembers):
264264
self.endmembers = endmembers
265265
self.n_endmembers = len(endmembers)
266-
self.formulas = [e[1] for e in endmembers]
266+
self.site_formulae = [e[1] for e in endmembers]
267267

268268
# Process solution chemistry
269269
process_solution_chemistry(self)

burnman/classes/solutionmodel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ class MechanicalSolution(SolutionModel):
374374
def __init__(self, endmembers):
375375
self.endmembers = endmembers
376376
self.n_endmembers = len(endmembers)
377-
self.formulas = [e[1] for e in endmembers]
377+
self.site_formulae = [e[1] for e in endmembers]
378378

379379
def excess_gibbs_free_energy(self, pressure, temperature, molar_fractions):
380380
return 0.0
@@ -421,7 +421,7 @@ class IdealSolution(SolutionModel):
421421
def __init__(self, endmembers):
422422
self.endmembers = endmembers
423423
self.n_endmembers = len(endmembers)
424-
self.formulas = [e[1] for e in endmembers]
424+
self.site_formulae = [e[1] for e in endmembers]
425425

426426
# Process solution chemistry
427427
process_solution_chemistry(self)

burnman/optimize/composition_fitting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(self, endmember_element_formulae, endmember_site_formulae):
3636
dictionarize_formula(f) for f in endmember_element_formulae
3737
]
3838
self.solution_model = type(
39-
"Dimension", (object,), {"formulas": endmember_site_formulae}
39+
"Dimension", (object,), {"site_formulae": endmember_site_formulae}
4040
)()
4141
self.solution_model.endmembers = [None for f in endmember_site_formulae]
4242
process_solution_chemistry(self.solution_model)

burnman/utils/chemistry.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def convert_formula(formula, to_type="mass", normalize=False):
284284

285285
def process_solution_chemistry(solution_model):
286286
"""
287-
This function parses a class instance with a "formulas"
287+
This function parses a class instance with a "site_formulae"
288288
attribute containing site information, e.g.
289289
290290
[ '[Mg]3[Al]2Si3O12', '[Mg]3[Mg1/2Si1/2]2Si3O12' ]
@@ -297,7 +297,7 @@ def process_solution_chemistry(solution_model):
297297
molar fractions of the phases and pressure
298298
and temperature where necessary.
299299
300-
:param solution_model: Class must have a "formulas" attribute,
300+
:param solution_model: Class must have a "site_formulae" attribute,
301301
containing a list of chemical formulae with site information
302302
:type solution model: instance of class
303303
@@ -341,7 +341,7 @@ def process_solution_chemistry(solution_model):
341341
containing the number of atoms of each species on each site
342342
per mole of endmember.
343343
"""
344-
formulae = solution_model.formulas
344+
formulae = solution_model.site_formulae
345345
n_sites = formulae[0].count("[")
346346
n_endmembers = len(formulae)
347347

@@ -424,7 +424,7 @@ def process_solution_chemistry(solution_model):
424424
)
425425

426426
solution_model.empty_formula = re.sub(
427-
"([\\[]).*?([\\]])", "\\g<1>\\g<2>", solution_model.formulas[0]
427+
"([\\[]).*?([\\]])", "\\g<1>\\g<2>", solution_model.site_formulae[0]
428428
)
429429
split_empty = solution_model.empty_formula.split("[")
430430
solution_model.general_formula = split_empty[0]

0 commit comments

Comments
 (0)