diff --git a/burnman/data/input_raw_endmember_datasets/hpx_eos_to_burnman.py b/burnman/data/input_raw_endmember_datasets/hpx_eos_to_burnman.py index 979c5c6b..d4aa46e2 100644 --- a/burnman/data/input_raw_endmember_datasets/hpx_eos_to_burnman.py +++ b/burnman/data/input_raw_endmember_datasets/hpx_eos_to_burnman.py @@ -24,6 +24,7 @@ dataset = HGP_2018_ds633 mbr_dataset = "HGP_2018_ds633" solution_file = "tc-thermoinput-igneous-2022-01-23/tc-ig50NCKFMASHTOCr.txt" +solution_file = "tc-thermoinput-igneous-2022-01-23/tc-ig50NCKFMASTOCr.txt" first_model = "pl4tr" # melt and fl are (currently unreadable) Temkin models # logging.basicConfig(stream=sys.stderr, level=logging.DEBUG) @@ -146,8 +147,12 @@ def ordering_modifier(property_modifier, ordered): if increment_i: i += 1 +n_data = len(data) + noods = [] -for k in range(16): +while True: + if i > n_data - 3: + break name = data[i][0] n_mbrs = int(data[i][1]) logging.debug(f"Solution: {name}") diff --git a/burnman/minerals/__init__.py b/burnman/minerals/__init__.py index 81d6d441..767c920c 100644 --- a/burnman/minerals/__init__.py +++ b/burnman/minerals/__init__.py @@ -53,6 +53,7 @@ from . import JH_2015 from . import HGP_2018_ds633 from . import ig50NCKFMASHTOCr +from . import ig50NCKFMASTOCr # Kurnosov et al. 2017 from . import KMFBZ_2017 diff --git a/burnman/minerals/ig50NCKFMASTOCr.py b/burnman/minerals/ig50NCKFMASTOCr.py new file mode 100644 index 00000000..e30e2d6b --- /dev/null +++ b/burnman/minerals/ig50NCKFMASTOCr.py @@ -0,0 +1,535 @@ +# This file is part of BurnMan - a thermoelastic +# and thermodynamic toolkit for the Earth and Planetary Sciences +# Copyright (C) 2012 - 2024 by the BurnMan team, released under the GNU +# GPL v2 or later. + +""" +ig50NCKFMASTOCr +^^^^^^^^^^^^^^^ + +HPx-eos solutions using endmembers from +dataset HGP_2018_ds633. +The values in this document are all in S.I. units, +unlike those in the original THERMOCALC file. +This file is autogenerated using process_HPX_eos.py +""" + +from numpy import array, nan +from . import HGP_2018_ds633 +from ..classes.mineral import Mineral +from ..classes.solution import Solution +from ..classes.solutionmodel import SymmetricRegularSolution +from ..classes.solutionmodel import AsymmetricRegularSolution +from ..classes.combinedmineral import CombinedMineral + + +cats_nood = Mineral( + { + "name": "cats", + "formula": {"Al": 2.0, "Ca": 1.0, "O": 6.0, "Si": 1.0}, + "equation_of_state": "hp_tmt", + "H_0": -3310050.0, + "S_0": 135.0, + "V_0": 6.356e-05, + "Cp": [347.6, -0.006974, -1781600.0, -2757.5], + "a_0": 2.08e-05, + "K_0": 119200000000.0, + "Kprime_0": 5.19, + "Kdprime_0": -4.4e-11, + "n": 10.0, + "molar_mass": 0.2181229, + "T_0": 298.15, + "E_0": 0.0, + "P_0": 100000.0, + "G_0": nan, + "Gprime_0": nan, + "T_einstein": 533.4002006018054, + } +) + +hem_nood = Mineral( + { + "name": "hem", + "formula": {"Fe": 2.0, "O": 3.0}, + "equation_of_state": "hp_tmt", + "H_0": -825420.0, + "S_0": 87.4, + "V_0": 3.027e-05, + "Cp": [163.9, 0.0, -2257200.0, -657.6], + "a_0": 2.79e-05, + "K_0": 223000000000.0, + "Kprime_0": 4.04, + "Kdprime_0": -1.8e-11, + "n": 5.0, + "molar_mass": 0.1596882, + "T_0": 298.15, + "E_0": 0.0, + "P_0": 100000.0, + "G_0": nan, + "Gprime_0": nan, + "T_einstein": 444.6488294314381, + } +) + +herc_nood = Mineral( + { + "name": "herc", + "formula": {"Al": 2.0, "Fe": 1.0, "O": 4.0}, + "equation_of_state": "hp_tmt", + "H_0": -1949470.0, + "S_0": 113.9, + "V_0": 4.075e-05, + "Cp": [184.9, 0.01417, -3674800.0, -404.0], + "a_0": 2.06e-05, + "K_0": 192200000000.0, + "Kprime_0": 4.04, + "Kdprime_0": -2.1e-11, + "n": 7.0, + "molar_mass": 0.1738056, + "T_0": 298.15, + "E_0": 0.0, + "P_0": 100000.0, + "G_0": nan, + "Gprime_0": nan, + "T_einstein": 468.310479305573, + } +) + +ilm_nood = Mineral( + { + "name": "ilm", + "formula": {"Fe": 1.0, "O": 3.0, "Ti": 1.0}, + "equation_of_state": "hp_tmt", + "H_0": -1232320.0, + "S_0": 107.5, + "V_0": 3.169e-05, + "Cp": [138.9, 0.005081, -1288800.0, -463.7], + "a_0": 2.4e-05, + "K_0": 170000000000.0, + "Kprime_0": 8.3, + "Kdprime_0": -4.9e-11, + "n": 5.0, + "molar_mass": 0.1517102, + "T_0": 298.15, + "E_0": 0.0, + "P_0": 100000.0, + "G_0": nan, + "Gprime_0": nan, + "T_einstein": 380.67287043664993, + } +) + +sp_nood = Mineral( + { + "name": "sp", + "formula": {"Al": 2.0, "Mg": 1.0, "O": 4.0}, + "equation_of_state": "hp_tmt", + "H_0": -2300180.0, + "S_0": 80.63, + "V_0": 3.978e-05, + "Cp": [200.5, 0.006252, -2996400.0, -888.4], + "a_0": 1.93e-05, + "K_0": 192200000000.0, + "Kprime_0": 4.04, + "Kdprime_0": -2.1e-11, + "n": 7.0, + "molar_mass": 0.1422656, + "T_0": 298.15, + "E_0": 0.0, + "P_0": 100000.0, + "G_0": nan, + "Gprime_0": nan, + "T_einstein": 592.252008591202, + } +) + + +abhI = CombinedMineral([HGP_2018_ds633.abh()], [1.0], [570.0, 4.12, 0.0], "abhI") +anC = CombinedMineral([HGP_2018_ds633.an()], [1.0], [7030.0, 4.66, 0.0], "anC") +cfm = CombinedMineral( + [HGP_2018_ds633.fa(), HGP_2018_ds633.fo()], [0.5, 0.5], [0.0, -0.0, 0.0], "cfm" +) +anC = CombinedMineral([HGP_2018_ds633.an()], [1.0], [7030.0, 4.66, 0.0], "anC") +knom = CombinedMineral([HGP_2018_ds633.knor()], [1.0], [18200.0, -0.0, 0.0], "knom") +tig = CombinedMineral( + [ + HGP_2018_ds633.py(), + HGP_2018_ds633.per(), + HGP_2018_ds633.ru(), + HGP_2018_ds633.cor(), + ], + [1.0, 0.5, 0.5, -0.5], + [46700.0, 17.3, 0.0], + "tig", +) +fm = CombinedMineral( + [HGP_2018_ds633.en(), HGP_2018_ds633.fs()], [0.5, 0.5], [-6600.0, -0.0, 0.0], "fm" +) +odi = CombinedMineral( + [HGP_2018_ds633.di()], [1.0], [2800.0, -0.0, 5.0000000000000004e-08], "odi" +) +cren = CombinedMineral( + [HGP_2018_ds633.mgts(), HGP_2018_ds633.kos(), HGP_2018_ds633.jd()], + [1.0, 1.0, -1.0], + [-25900.0, -15.5, 5.000000000000001e-07], + "cren", +) +obuf = CombinedMineral( + [ + HGP_2018_ds633.mgts(), + HGP_2018_ds633.per(), + HGP_2018_ds633.ru(), + HGP_2018_ds633.cor(), + ], + [1.0, 0.5, 0.5, -0.5], + [-5000.0, 5.1000000000000005, -6.1e-08], + "obuf", +) +mess = CombinedMineral( + [HGP_2018_ds633.mgts(), HGP_2018_ds633.acm(), HGP_2018_ds633.jd()], + [1.0, 1.0, -1.0], + [4800.0, -0.0, -8.900000000000001e-07], + "mess", +) +ojd = CombinedMineral([HGP_2018_ds633.jd()], [1.0], [18800.0, -0.0, 0.0], "ojd") +cfs = CombinedMineral( + [HGP_2018_ds633.fs()], [1.0], [2100.0, 2.0, 4.5000000000000003e-07], "cfs" +) +crdi = CombinedMineral( + [cats_nood, HGP_2018_ds633.kos(), HGP_2018_ds633.jd()], + [1.0, 1.0, -1.0], + [-1100.0, 2.881573160768881, 1e-07], + "crdi", +) +cess = CombinedMineral( + [cats_nood, HGP_2018_ds633.acm(), HGP_2018_ds633.jd()], + [1.0, 1.0, -1.0], + [350.0, 2.881573160768881, 1e-07], + "cess", +) +cbuf = CombinedMineral( + [cats_nood, HGP_2018_ds633.per(), HGP_2018_ds633.ru(), HGP_2018_ds633.cor()], + [1.0, 0.5, 0.5, -0.5], + [-12400.0, 4.0815731607688805, 4.999999999999999e-08], + "cbuf", +) +cen = CombinedMineral( + [HGP_2018_ds633.en()], [1.0], [3500.0, 2.0, 4.800000000000001e-07], "cen" +) +cfm = CombinedMineral( + [HGP_2018_ds633.en(), HGP_2018_ds633.fs()], + [0.5, 0.5], + [-1600.0, 2.0, 4.6500000000000005e-07], + "cfm", +) +kjd = CombinedMineral( + [HGP_2018_ds633.jd(), HGP_2018_ds633.abh(), HGP_2018_ds633.san()], + [1.0, -1.0, 1.0], + [11700.0, -0.0, 6e-06], + "kjd", +) +nsp = CombinedMineral([sp_nood], [1.0], [0.0, 0.0, 0.0], "nsp") +isp = CombinedMineral([sp_nood], [1.0], [23600.0, 5.76303, 0.0], "isp") +nhc = CombinedMineral([herc_nood], [1.0], [0.0, 0.0, 0.0], "nhc") +ihc = CombinedMineral([herc_nood], [1.0], [23600.0, 5.76303, 0.0], "ihc") +nmt = CombinedMineral([HGP_2018_ds633.mt()], [1.0], [0.0, -5.76303, 0.0], "nmt") +imt = CombinedMineral([HGP_2018_ds633.mt()], [1.0], [300.0, -0.0, 0.0], "imt") +pcr = CombinedMineral([HGP_2018_ds633.picr()], [1.0], [0.0, -0.0, 0.0], "pcr") +qndm = CombinedMineral([HGP_2018_ds633.qnd()], [1.0], [-30000.0, -0.0, 0.0], "qndm") +oilm = CombinedMineral( + [ilm_nood], + [1.0], + [1444.0572257227777, 1.5923196732102785, 1.836386612201713e-07], + "oilm", +) +dilm = CombinedMineral( + [ilm_nood], + [1.0], + [17044.35722572278, 13.118319673210278, 1.836386612201713e-07], + "dilm", +) +dhem = CombinedMineral( + [hem_nood], [1.0], [9522.770803030953, 12.937668369038724, 0.0], "dhem" +) + + +class pl4tr(Solution): + def __init__(self, molar_fractions=None): + self.name = "pl4tr" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HGP_2018_ds633.ab(), "[Naa][Altb1/4Sitb3/4]"], + [HGP_2018_ds633.an(), "[Caa][Altb1/2Sitb1/2]"], + [HGP_2018_ds633.san(), "[Ka][Altb1/4Sitb3/4]"], + ], + alphas=[0.674, 0.55, 1.0], + energy_interaction=[[14600.0, 24100.0], [48500.0]], + entropy_interaction=[[0.00935, 0.00957], [-0.0]], + volume_interaction=[ + [-4.0000000000000003e-07, 3.3800000000000007e-06], + [-1.3e-06], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class k4tr(Solution): + def __init__(self, molar_fractions=None): + self.name = "k4tr" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HGP_2018_ds633.ab(), "[Naa][Altb1/4Sitb3/4]"], + [HGP_2018_ds633.an(), "[Caa][Altb1/2Sitb1/2]"], + [HGP_2018_ds633.san(), "[Ka][Altb1/4Sitb3/4]"], + ], + alphas=[0.674, 0.55, 1.0], + energy_interaction=[[14600.0, 24100.0], [48500.0]], + entropy_interaction=[[0.00935, 0.00957], [-0.0]], + volume_interaction=[ + [-4.0000000000000003e-07, 3.3800000000000007e-06], + [-1.3e-06], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class pli(Solution): + def __init__(self, molar_fractions=None): + self.name = "pli" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [abhI, "[Na]"], + [HGP_2018_ds633.an(), "[Ca]"], + [HGP_2018_ds633.san(), "[K]"], + ], + alphas=[0.643, 1.0, 1.0], + energy_interaction=[[15000.0, 25100.0], [40000.0]], + entropy_interaction=[[-0.0, 0.0108], [-0.0]], + volume_interaction=[[0.0, 3.3800000000000007e-06], [0.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class plc(Solution): + def __init__(self, molar_fractions=None): + self.name = "plc" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HGP_2018_ds633.abh(), "[Na]"], + [anC, "[Ca]"], + [HGP_2018_ds633.san(), "[K]"], + ], + alphas=[0.643, 1.0, 1.0], + energy_interaction=[[3100.0, 25100.0], [40000.0]], + entropy_interaction=[[-0.0, 0.0108], [-0.0]], + volume_interaction=[[0.0, 3.3800000000000007e-06], [0.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ol(Solution): + def __init__(self, molar_fractions=None): + self.name = "ol" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HGP_2018_ds633.mont(), "[Mgm][Cam]"], + [HGP_2018_ds633.fa(), "[Fem][Fem]"], + [HGP_2018_ds633.fo(), "[Mgm][Mgm]"], + [cfm, "[Mgm][Fem]"], + ], + energy_interaction=[ + [24000.0, 38000.0, 24000.0], + [9000.0, 4500.0], + [4500.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ksp(Solution): + def __init__(self, molar_fractions=None): + self.name = "ksp" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HGP_2018_ds633.san(), "[K]"], + [HGP_2018_ds633.abh(), "[Na]"], + [anC, "[Ca]"], + ], + alphas=[1.0, 0.643, 1.0], + energy_interaction=[[25100.0, 40000.0], [3100.0]], + entropy_interaction=[[0.0108, -0.0], [-0.0]], + volume_interaction=[[3.3800000000000007e-06, 0.0], [0.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class g(Solution): + def __init__(self, molar_fractions=None): + self.name = "g" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HGP_2018_ds633.py(), "[Mgm]3[Alm]2"], + [HGP_2018_ds633.alm(), "[Fem]3[Alm]2"], + [HGP_2018_ds633.gr(), "[Cam]3[Alm]2"], + [HGP_2018_ds633.andr(), "[Cam]3[Fem]2"], + [knom, "[Mgm]3[Crm]2"], + [tig, "[Mgm]3[Alm1/2Mgm1/4Tim1/4]2"], + ], + alphas=[1.0, 1.0, 2.5, 2.5, 1.0, 1.0], + energy_interaction=[ + [4000.0, 45400.0, 107000.0, 2000.0, 0.0], + [17000.0, 65000.0, 6000.0, 0.0], + [2000.0, 1000.0, 0.0], + [63000.0, 0.0], + [0.0], + ], + entropy_interaction=[ + [-0.0, 0.01, 0.01, -0.0, -0.0], + [0.01, 0.01, -0.0, -0.0], + [-0.0, 0.01, -0.0], + [0.01, -0.0], + [-0.0], + ], + volume_interaction=[ + [1.0000000000000002e-06, 4.0000000000000003e-07, -3.6e-07, 0.0, 0.0], + [1.0000000000000002e-06, 3.9e-07, 1.0000000000000001e-07, 0.0], + [0.0, 1.8000000000000001e-06, 0.0], + [1.0000000000000002e-06, 0.0], + [0.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class opx(Solution): + def __init__(self, molar_fractions=None): + self.name = "opx" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HGP_2018_ds633.en(), "[Mgm][Mgm][Sit]1/2"], + [HGP_2018_ds633.fs(), "[Fem][Fem][Sit]1/2"], + [fm, "[Mgm][Fem][Sit]1/2"], + [odi, "[Mgm][Cam][Sit]1/2"], + [HGP_2018_ds633.mgts(), "[Alm][Mgm][Sit1/2Alt1/2]1/2"], + [cren, "[Crm][Mgm][Sit1/2Alt1/2]1/2"], + [obuf, "[Mgm1/2Tim1/2][Mgm][Sit1/2Alt1/2]1/2"], + [mess, "[Fem][Mgm][Sit1/2Alt1/2]1/2"], + [ojd, "[Alm][Nam][Sit]1/2"], + ], + alphas=[1.0, 1.0, 1.0, 1.2, 1.0, 1.0, 1.0, 1.0, 1.2], + energy_interaction=[ + [7000.0, 4000.0, 29400.0, 12500.0, 8000.0, 6000.0, 8000.0, 35000.0], + [4000.0, 21500.0, 11000.0, 10000.0, 7000.0, 10000.0, 35000.0], + [18000.0, 15000.0, 12000.0, 8000.0, 12000.0, 35000.0], + [75500.0, 20000.0, 40000.0, 20000.0, 35000.0], + [2000.0, 10000.0, 2000.0, 7000.0], + [6000.0, 2000.0, -11000.0], + [6000.0, 20000.0], + [-11000.0], + ], + volume_interaction=[ + [0.0, 0.0, 0.0, -4.0000000000000003e-07, 0.0, 0.0, 0.0, 0.0], + [0.0, 8.000000000000001e-07, -1.5e-06, 0.0, 0.0, 0.0, 0.0], + [8.000000000000001e-07, -1.5e-06, 0.0, 0.0, 0.0, 0.0], + [-8.400000000000001e-06, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0], + [0.0, 0.0], + [0.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class cpx(Solution): + def __init__(self, molar_fractions=None): + self.name = "cpx" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HGP_2018_ds633.di(), "[Mgm][Cam][Sit]1/2"], + [cfs, "[Fem][Fem][Sit]1/2"], + [HGP_2018_ds633.cats(), "[Alm][Cam][Sit1/2Alt1/2]1/2"], + [crdi, "[Crm][Cam][Sit1/2Alt1/2]1/2"], + [cess, "[Fem][Cam][Sit1/2Alt1/2]1/2"], + [cbuf, "[Mgm1/2Tim1/2][Cam][Sit1/2Alt1/2]1/2"], + [HGP_2018_ds633.jd(), "[Alm][Nam][Sit]1/2"], + [cen, "[Mgm][Mgm][Sit]1/2"], + [cfm, "[Mgm][Fem][Sit]1/2"], + [kjd, "[Alm][Km][Sit]1/2"], + ], + alphas=[1.2, 1.0, 1.9, 1.9, 1.9, 1.9, 1.2, 1.0, 1.0, 1.2], + energy_interaction=[ + [ + 25800.0, + 13000.0, + 8000.0, + 8000.0, + 8000.0, + 26000.0, + 29800.0, + 20600.0, + 26000.0, + ], + [25000.0, 38300.0, 43300.0, 24000.0, 24000.0, 2300.0, 3500.0, 24000.0], + [2000.0, 2000.0, 6000.0, 6000.0, 45200.0, 27000.0, 6000.0], + [2000.0, 6000.0, 3000.0, 52300.0, 40300.0, 3000.0], + [6000.0, 3000.0, 57300.0, 45300.0, 3000.0], + [16000.0, 24000.0, 22000.0, 16000.0], + [40000.0, 40000.0, 28000.0], + [4000.0, 40000.0], + [40000.0], + ], + volume_interaction=[ + [0.0, -6.000000000000001e-07, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [-1.0000000000000002e-06, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, -3.5e-06, -1.0000000000000002e-06, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0], + [0.0, 0.0], + [0.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class spn(Solution): + def __init__(self, molar_fractions=None): + self.name = "spn" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [nsp, "[Mgt][Alm]"], + [isp, "[Alt][Mgm1/2Alm1/2]"], + [nhc, "[Fet][Alm]"], + [ihc, "[Alt][Fem1/2Alm1/2]"], + [nmt, "[Fet][Fem]"], + [imt, "[Fet][Fem1/2Fem1/2]"], + [pcr, "[Mgt][Crm]"], + [qndm, "[Mgt][Mgm1/2Tim1/2]"], + ], + energy_interaction=[ + [-8200.0, 3500.0, -13000.0, 43200.0, 49100.0, -5000.0, 22500.0], + [4400.0, -6000.0, 36800.0, 20000.0, 14000.0, 21500.0], + [-8200.0, 18100.0, 49000.0, -19000.0, 35100.0], + [-4000.0, 7600.0, -11000.0, 9000.0], + [18100.0, 11900.0, 62200.0], + [-6400.0, 24300.0], + [60000.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ilm(Solution): + def __init__(self, molar_fractions=None): + self.name = "ilm" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [oilm, "[Fea][Tib]"], + [dilm, "[Fea1/2Tia1/2][Feb1/2Tib1/2]"], + [dhem, "[Fea][Feb]"], + ], + energy_interaction=[[15600.0, 26600.0], [11000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) diff --git a/tests/test_hp_solutions.py b/tests/test_hp_solutions.py index 613c15da..a6274208 100644 --- a/tests/test_hp_solutions.py +++ b/tests/test_hp_solutions.py @@ -3,14 +3,14 @@ import unittest from util import BurnManTest from burnman import Mineral, CombinedMineral, Solution -from burnman.minerals import ig50NCKFMASHTOCr +from burnman.minerals import ig50NCKFMASHTOCr, ig50NCKFMASTOCr import inspect import numpy as np from collections import Counter class hp_solutions(BurnManTest): - def test_set_composition(self): + def test_ig50NCKFMASHTOCr(self): for m in dir(ig50NCKFMASHTOCr): mineral = getattr(ig50NCKFMASHTOCr, m) if ( @@ -27,6 +27,23 @@ def test_set_composition(self): m.set_composition(molar_fractions) self.assertTrue(type(m.formula) is Counter) + def test_ig50NCKFMASTOCr(self): + for m in dir(ig50NCKFMASTOCr): + mineral = getattr(ig50NCKFMASTOCr, m) + if ( + inspect.isclass(mineral) + and mineral != Mineral + and mineral != CombinedMineral + and issubclass(mineral, Mineral) + ): + if issubclass(mineral, Solution) and mineral is not Solution: + mbr_names = mineral().endmember_names + n_mbrs = len(mbr_names) + molar_fractions = np.ones(n_mbrs) / n_mbrs + m = mineral() + m.set_composition(molar_fractions) + self.assertTrue(type(m.formula) is Counter) + if __name__ == "__main__": unittest.main()