PetThermoTools 0.2.30__py3-none-any.whl → 0.2.32__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- PetThermoTools/Liq.py +21 -7
- PetThermoTools/MELTS.py +15 -14
- PetThermoTools/Melting.py +3 -2
- PetThermoTools/Path.py +35 -15
- PetThermoTools/PhaseDiagrams.py +12 -7
- PetThermoTools/_version.py +1 -1
- {PetThermoTools-0.2.30.dist-info → PetThermoTools-0.2.32.dist-info}/METADATA +1 -1
- {PetThermoTools-0.2.30.dist-info → PetThermoTools-0.2.32.dist-info}/RECORD +10 -10
- {PetThermoTools-0.2.30.dist-info → PetThermoTools-0.2.32.dist-info}/WHEEL +0 -0
- {PetThermoTools-0.2.30.dist-info → PetThermoTools-0.2.32.dist-info}/top_level.txt +0 -0
PetThermoTools/Liq.py
CHANGED
@@ -366,12 +366,15 @@ def equilibrate_multi(cores = None, Model = None, bulk = None, T_C = None, P_bar
|
|
366
366
|
# Affinity = Af_Combined.copy()
|
367
367
|
return Combined
|
368
368
|
else:
|
369
|
-
import julia
|
370
|
-
from julia.api import Julia
|
371
|
-
jl = Julia(compiled_modules=False)
|
372
|
-
from julia import MAGEMinCalc
|
373
|
-
|
374
|
-
|
369
|
+
# import julia
|
370
|
+
# from julia.api import Julia
|
371
|
+
# jl = Julia(compiled_modules=False)
|
372
|
+
# from julia import MAGEMinCalc
|
373
|
+
## Output = MM.equilibrate_multi(P_bar = P_bar, T_C = T_C, comp = comp)
|
374
|
+
from juliacall import Main as jl, convert as jlconvert
|
375
|
+
|
376
|
+
jl.seval("using MAGEMinCalc")
|
377
|
+
|
375
378
|
comp['O'] = comp['Fe3Fet_Liq']*(((159.59/2)/71.844)*comp['FeOt_Liq'] - comp['FeOt_Liq'])
|
376
379
|
|
377
380
|
if Model == "Weller2024":
|
@@ -380,8 +383,19 @@ def equilibrate_multi(cores = None, Model = None, bulk = None, T_C = None, P_bar
|
|
380
383
|
bulk = comp[['SiO2_Liq', 'Al2O3_Liq', 'CaO_Liq', 'MgO_Liq', 'FeOt_Liq', 'K2O_Liq', 'Na2O_Liq', 'TiO2_Liq', 'O', 'Cr2O3_Liq', 'H2O_Liq']].astype(float).values
|
381
384
|
|
382
385
|
print(np.shape(bulk))
|
386
|
+
bulk_jl = jl.seval("collect")(bulk)
|
387
|
+
|
388
|
+
if type(T_C) == np.ndarray:
|
389
|
+
T_C = jl.seval("collect")(T_C)
|
390
|
+
if type(P_bar) == np.ndarray:
|
391
|
+
P_kbar = jl.seval("collect")(P_bar/1000.0)
|
392
|
+
else:
|
393
|
+
P_kbar = P_bar/1000.0
|
394
|
+
if type(fO2_offset) == np.ndarray:
|
395
|
+
fO2_offset = jl.seval("collect")(fO2_offset)
|
383
396
|
|
384
|
-
Output = MAGEMinCalc.equilibrate(bulk =
|
397
|
+
Output = jl.MAGEMinCalc.equilibrate(bulk = bulk_jl, P_kbar = P_kbar, T_C = T_C, fo2_buffer = fO2_buffer, fo2_offset = fO2_offset, Model = Model)
|
398
|
+
Output = dict(Output)
|
385
399
|
Combined = stich(Output, Model = Model)
|
386
400
|
|
387
401
|
if copy_columns is not None:
|
PetThermoTools/MELTS.py
CHANGED
@@ -911,21 +911,22 @@ def path_MELTS(Model = None, comp = None, Frac_solid = None, Frac_fluid = None,
|
|
911
911
|
bulk = list(100*np.array(bulk)/np.sum(bulk))
|
912
912
|
|
913
913
|
if Suppress_except is False:
|
914
|
-
if Suppress
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
if p != "
|
922
|
-
|
923
|
-
|
924
|
-
if type(Suppress) == list:
|
925
|
-
for p in Suppress:
|
926
|
-
melts.engine.setSystemProperties("Suppress", p)
|
914
|
+
if Suppress is not None:
|
915
|
+
if Suppress == "All":
|
916
|
+
melts.engine.pressure = np.random.normal(500, 500/10)
|
917
|
+
melts.engine.temperature = 1200 + 200
|
918
|
+
melts.engine.setBulkComposition(bulk)
|
919
|
+
PL = melts.engine.calcSaturationState()
|
920
|
+
for p in PL:
|
921
|
+
if p != "fluid":
|
922
|
+
if p != "water":
|
923
|
+
melts.engine.setSystemProperties("Suppress", p)
|
927
924
|
else:
|
928
|
-
|
925
|
+
if type(Suppress) == list:
|
926
|
+
for p in Suppress:
|
927
|
+
melts.engine.setSystemProperties("Suppress", p)
|
928
|
+
else:
|
929
|
+
melts.engine.setSystemProperties("Suppress", Suppress)
|
929
930
|
else:
|
930
931
|
melts.engine.pressure = np.random.normal(500, 500/10)
|
931
932
|
melts.engine.temperature = 1200 + 200
|
PetThermoTools/Melting.py
CHANGED
@@ -171,8 +171,9 @@ def AdiabaticMelt(q, index, *, Model = None, comp_1 = None, comp_2 = None, comp_
|
|
171
171
|
return
|
172
172
|
|
173
173
|
if Model == "Holland":
|
174
|
-
import pyMAGEMINcalc as MM
|
175
|
-
Results = MM.AdiabaticDecompressionMelting(comp = comp_1, T_p_C = Tp_C, P_start_kbar = P_start_bar/1000, P_end_kbar = P_end_bar/1000, dp_kbar = dp_bar/1000, Frac = 0)
|
174
|
+
# import pyMAGEMINcalc as MM
|
175
|
+
# Results = MM.AdiabaticDecompressionMelting(comp = comp_1, T_p_C = Tp_C, P_start_kbar = P_start_bar/1000, P_end_kbar = P_end_bar/1000, dp_kbar = dp_bar/1000, Frac = 0)
|
176
|
+
print('Note that the ability to use MAGEMin to performed adiabatic decompression melting in PetThermoTools has been temporarily disabled. The underlying issue will be fixed soon and this funciton will once again become available.')
|
176
177
|
q.put([Results, index])
|
177
178
|
return
|
178
179
|
|
PetThermoTools/Path.py
CHANGED
@@ -201,7 +201,7 @@ def multi_path(cores = None, Model = None, bulk = None, comp = None, Frac_solid
|
|
201
201
|
|
202
202
|
qs = []
|
203
203
|
q = Queue()
|
204
|
-
|
204
|
+
|
205
205
|
# perform calculation if only 1 calculation is specified
|
206
206
|
if One == 1:
|
207
207
|
if Print_suppress is None:
|
@@ -374,6 +374,7 @@ def multi_path(cores = None, Model = None, bulk = None, comp = None, Frac_solid
|
|
374
374
|
if Print_suppress is None:
|
375
375
|
print(" Complete (time taken = " + str(round(time.time() - s,2)) + " seconds)", end = "\n", flush = True)
|
376
376
|
|
377
|
+
|
377
378
|
Results = {}
|
378
379
|
Out = {}
|
379
380
|
for i in range(len(qs)):
|
@@ -452,7 +453,6 @@ def multi_path(cores = None, Model = None, bulk = None, comp = None, Frac_solid
|
|
452
453
|
|
453
454
|
#if "MELTS" in Model:
|
454
455
|
Results = stich(Results, multi = True, Model = Model, Frac_fluid = Frac_fluid, Frac_solid = Frac_solid)
|
455
|
-
|
456
456
|
|
457
457
|
for r in Results:
|
458
458
|
i = int(r.split('=')[1].strip())
|
@@ -625,21 +625,41 @@ def path(q, index, *, Model = None, comp = None, Frac_solid = None, Frac_fluid =
|
|
625
625
|
return
|
626
626
|
|
627
627
|
if "MELTS" not in Model:
|
628
|
-
import julia
|
629
|
-
from julia.api import Julia
|
630
|
-
jl = Julia(compiled_modules=False)
|
631
|
-
from julia import MAGEMinCalc
|
632
|
-
# import pyMAGEMINcalc as MM
|
633
|
-
# try:
|
634
|
-
|
628
|
+
# import julia
|
629
|
+
# from julia.api import Julia
|
630
|
+
# jl = Julia(compiled_modules=False)
|
631
|
+
# from julia import MAGEMinCalc
|
632
|
+
# # import pyMAGEMINcalc as MM
|
633
|
+
# # try:
|
634
|
+
# # Results = MM.path(Model = Model, comp = comp, Frac_solid = Frac_solid, Frac_fluid = Frac_fluid, T_C = T_C, T_path_C = T_path_C, T_start_C = T_start_C, T_end_C = T_end_C, dt_C = dt_C, P_bar = P_bar, P_path_bar = P_path_bar, P_start_bar = P_start_bar, P_end_bar = P_end_bar, dp_bar = dp_bar, find_liquidus = find_liquidus, fO2_buffer = fO2_buffer, fO2_offset = fO2_offset)
|
635
|
+
# if Frac_solid is None:
|
636
|
+
# Frac_solid = False
|
637
|
+
|
638
|
+
# Results = MAGEMinCalc.path(comp = comp, T_start_C = T_start_C, T_end_C = T_end_C, dt_C = dt_C,
|
639
|
+
# T_C = T_C, P_start_bar = P_start_bar, P_end_bar = P_end_bar, dp_bar = dp_bar,
|
640
|
+
# P_bar = P_bar, T_path_C = T_path_C, P_path_bar = P_path_bar, frac_xtal = Frac_solid,
|
641
|
+
# Model = Model, fo2_buffer = fO2_buffer, fo2_offset = fO2_offset, find_liquidus = find_liquidus)
|
642
|
+
# q.put([Results, index])
|
643
|
+
|
644
|
+
# import julia
|
645
|
+
from juliacall import Main as jl, convert as jlconvert
|
646
|
+
|
647
|
+
jl.seval("using MAGEMinCalc")
|
648
|
+
|
635
649
|
if Frac_solid is None:
|
636
650
|
Frac_solid = False
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
651
|
+
|
652
|
+
comp_julia = jl.seval("Dict")(comp)
|
653
|
+
|
654
|
+
Results = jl.MAGEMinCalc.path(
|
655
|
+
comp=comp_julia, T_start_C=T_start_C, T_end_C=T_end_C, dt_C=dt_C,
|
656
|
+
T_C=T_C, P_start_bar=P_start_bar, P_end_bar=P_end_bar, dp_bar=dp_bar,
|
657
|
+
P_bar=P_bar, T_path_C=T_path_C, P_path_bar=P_path_bar, frac_xtal=Frac_solid,
|
658
|
+
Model=Model, fo2_buffer=fO2_buffer, fo2_offset=fO2_offset, find_liquidus=find_liquidus
|
659
|
+
)
|
660
|
+
# Results = jl.pyconvert(dict, Results)
|
661
|
+
Results_df = dict(Results)
|
662
|
+
q.put([Results_df, index])
|
643
663
|
# except:
|
644
664
|
# q.put([])
|
645
665
|
# return
|
PetThermoTools/PhaseDiagrams.py
CHANGED
@@ -148,12 +148,12 @@ def phaseDiagram_calc(cores = None, Model = None, bulk = None, T_C = None, P_bar
|
|
148
148
|
j = j + 1
|
149
149
|
|
150
150
|
for i in range(cores):
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
151
|
+
if "MELTS" in Model:
|
152
|
+
T_path_C = T_flat[i*A:(i+1)*A]
|
153
|
+
P_path_bar = P_flat[i*A:(i+1)*A]
|
154
|
+
else:
|
155
|
+
T_path_C = np.array(subarrays_T[i])
|
156
|
+
P_path_bar = np.array(subarrays_P[i])
|
157
157
|
|
158
158
|
|
159
159
|
if "MELTS" in Model:
|
@@ -191,7 +191,12 @@ def phaseDiagram_calc(cores = None, Model = None, bulk = None, T_C = None, P_bar
|
|
191
191
|
# T_path_C = np.array(T_randomized)
|
192
192
|
# P_path_bar = np.array(P_randomized)
|
193
193
|
|
194
|
-
p = Process(target = path, args = (q,i), kwargs = {'Model': Model, 'comp': comp,
|
194
|
+
p = Process(target = path, args = (q,i), kwargs = {'Model': Model, 'comp': comp,
|
195
|
+
'T_path_C': T_path_C,
|
196
|
+
'P_path_bar': P_path_bar,
|
197
|
+
'fO2_buffer': fO2_buffer,
|
198
|
+
'fO2_offset': fO2_offset,
|
199
|
+
'Suppress': ['rutile', 'tridymite']})
|
195
200
|
|
196
201
|
ps.append(p)
|
197
202
|
p.start()
|
PetThermoTools/_version.py
CHANGED
@@ -3,17 +3,17 @@ PetThermoTools/Compositions.py,sha256=65NzfduzWdfHJ8VmHBN1Cv7fMz7kF3QbDVLei-e4v0
|
|
3
3
|
PetThermoTools/GenFuncs.py,sha256=u2GWqH--Wmqd0WXHxfulEAatQb6uswjl1s9SyyoHSa8,16412
|
4
4
|
PetThermoTools/Holland.py,sha256=udBFeVUyTBpSfLIhx7Hy6o0I8ApNCDvwU_gZa0diY5w,7251
|
5
5
|
PetThermoTools/Installation.py,sha256=UfVOW1NZFdzMWPyID5u7t0KwvpJA0AqYohzidXIAwYs,6098
|
6
|
-
PetThermoTools/Liq.py,sha256=
|
7
|
-
PetThermoTools/MELTS.py,sha256
|
8
|
-
PetThermoTools/Melting.py,sha256=
|
9
|
-
PetThermoTools/Path.py,sha256=
|
6
|
+
PetThermoTools/Liq.py,sha256=2kdU8r00Y20khwvPvCvLr6P7y2HEOvCH2cwrF_qw5u8,35541
|
7
|
+
PetThermoTools/MELTS.py,sha256=-nkyo3yx7dZXVnRwZhlMRGCc5SkYSm1nP3qDbLDNNyY,72354
|
8
|
+
PetThermoTools/Melting.py,sha256=h1-KchPFw5tI2xoOyNJUfVy_TJqTtcYiHtGuInIwzio,11017
|
9
|
+
PetThermoTools/Path.py,sha256=FI_JkpCDXUVWsaKxA_PKOyKvXSzsQEBiLonGNiamcIM,33424
|
10
10
|
PetThermoTools/Path_wrappers.py,sha256=_0pBs_cK2hICxAHkYxKXICUnUEBSiUg07-qhgBeuTdc,26555
|
11
|
-
PetThermoTools/PhaseDiagrams.py,sha256=
|
11
|
+
PetThermoTools/PhaseDiagrams.py,sha256=8S_BcqggBzfUbiCPcsJRWFBenGL4tcCevte3-ATQjQI,30884
|
12
12
|
PetThermoTools/Plotting.py,sha256=biM4QJFCH6xVDpK-nG2oAIGIFFJCzBt5Uez6XzTFiGY,28107
|
13
13
|
PetThermoTools/Saturation.py,sha256=XXY6fKVouQM3RLgQgXur4xSq7_uGp7bCw_k7NNlWYi8,14095
|
14
14
|
PetThermoTools/__init__.py,sha256=PbiwQj_mNNEwuIZOLETmtMMshiXa50wjCA6mfvpOpOs,2393
|
15
|
-
PetThermoTools/_version.py,sha256=
|
16
|
-
PetThermoTools-0.2.
|
17
|
-
PetThermoTools-0.2.
|
18
|
-
PetThermoTools-0.2.
|
19
|
-
PetThermoTools-0.2.
|
15
|
+
PetThermoTools/_version.py,sha256=Dx2nyXCP2anL0ePIK0yaL-9dVQUNLwN_Y5sjqdoNjU0,296
|
16
|
+
PetThermoTools-0.2.32.dist-info/METADATA,sha256=bzOGZMsHROBRHP9DrgSejdN3d8YyMbaYSX9Pt9yn5Ho,796
|
17
|
+
PetThermoTools-0.2.32.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
18
|
+
PetThermoTools-0.2.32.dist-info/top_level.txt,sha256=IqK8iYBR3YJozzMOTRZ8x8mU2k6x8ycoMBxZTm-I06U,15
|
19
|
+
PetThermoTools-0.2.32.dist-info/RECORD,,
|
File without changes
|
File without changes
|