PetThermoTools 0.2.40__tar.gz → 0.2.41__tar.gz
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-0.2.40/src/PetThermoTools.egg-info → PetThermoTools-0.2.41}/PKG-INFO +1 -1
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/setup.py +1 -1
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools/Barom.py +12 -1
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools/GenFuncs.py +11 -0
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools/Melting.py +12 -1
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools/Path.py +58 -18
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools/PhaseDiagrams.py +21 -1
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools/_version.py +1 -1
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41/src/PetThermoTools.egg-info}/PKG-INFO +1 -1
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools.egg-info/requires.txt +1 -1
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/LICENSE.txt +0 -0
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/README.md +0 -0
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/setup.cfg +0 -0
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools/Compositions.py +0 -0
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools/Holland.py +0 -0
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools/Installation.py +0 -0
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools/Liq.py +0 -0
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools/MELTS.py +0 -0
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools/Path_wrappers.py +0 -0
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools/Plotting.py +0 -0
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools/Saturation.py +0 -0
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools/__init__.py +0 -0
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools.egg-info/SOURCES.txt +0 -0
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools.egg-info/dependency_links.txt +0 -0
- {PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools.egg-info/top_level.txt +0 -0
@@ -186,7 +186,18 @@ def mineral_cosaturation(Model="MELTSv1.0.2", cores=int(np.floor(multiprocessing
|
|
186
186
|
Results : dict
|
187
187
|
Raw simulation outputs for each pressure step.
|
188
188
|
"""
|
189
|
-
|
189
|
+
## make sure everything is a float
|
190
|
+
T_initial_C = to_float(T_initial_C)
|
191
|
+
T_maxdrop_C = to_float(T_maxdrop_C)
|
192
|
+
T_cut_C = to_float(T_cut_C)
|
193
|
+
|
194
|
+
P_bar = to_float(P_bar)
|
195
|
+
|
196
|
+
Fe3Fet_init= to_float(Fe3Fet_init)
|
197
|
+
H2O_init = to_float(H2O_init)
|
198
|
+
CO2_init = to_float(CO2_init)
|
199
|
+
fO2_offset = to_float(fO2_offset)
|
200
|
+
|
190
201
|
comp = bulk.copy()
|
191
202
|
if H2O_Sat:
|
192
203
|
comp['H2O_Liq'] = 20
|
@@ -51,6 +51,17 @@ Names_MM = {'liq1': '_Liq',
|
|
51
51
|
'spl1': '_Sp',
|
52
52
|
'spl2': '_Sp2'}
|
53
53
|
|
54
|
+
def to_float(x):
|
55
|
+
if x is None:
|
56
|
+
return None
|
57
|
+
if isinstance(x, (int, float)):
|
58
|
+
return float(x)
|
59
|
+
if isinstance(x, (list, tuple)):
|
60
|
+
return [float(v) for v in x]
|
61
|
+
if isinstance(x, np.ndarray):
|
62
|
+
return x.astype(float)
|
63
|
+
return x # leave unchanged if unexpected type
|
64
|
+
|
54
65
|
def label_results(Result,label):
|
55
66
|
Results = Result.copy()
|
56
67
|
new_out = {}
|
@@ -49,6 +49,17 @@ def AdiabaticDecompressionMelting(cores = multiprocessing.cpu_count(),
|
|
49
49
|
P_path_bar = None, Frac = False, prop = None,
|
50
50
|
fO2_buffer = None, fO2_offset = None, Fe3Fet = None, MELTS_filter = True):
|
51
51
|
|
52
|
+
Tp_C = to_float(Tp_C)
|
53
|
+
|
54
|
+
P_path_bar = to_float(P_path_bar)
|
55
|
+
P_start_bar= to_float(P_start_bar)
|
56
|
+
P_end_bar = to_float(P_end_bar)
|
57
|
+
dp_bar = to_float(dp_bar)
|
58
|
+
|
59
|
+
Fe3Fet = to_float(Fe3Fet)
|
60
|
+
fO2_offset = to_float(fO2_offset)
|
61
|
+
|
62
|
+
|
52
63
|
if Tp_Method == "pyMelt":
|
53
64
|
try:
|
54
65
|
import pyMelt as m
|
@@ -265,7 +276,7 @@ def AdiabaticMelt(q, index, *, Model = None, comp_1 = None, comp_2 = None, comp_
|
|
265
276
|
if type(comp_1) == dict:
|
266
277
|
comp_julia = jl.seval("Dict")(comp_1)
|
267
278
|
else:
|
268
|
-
comp_new = comp_1.loc[
|
279
|
+
comp_new = comp_1.loc[0].to_dict()
|
269
280
|
comp_julia = jl.seval("Dict")(comp_new)
|
270
281
|
|
271
282
|
Output_jl = jl.MAGEMinCalc.AdiabaticDecompressionMelting(comp = comp_julia, P_start_kbar = P_start_bar/1000.0,
|
@@ -98,6 +98,26 @@ def multi_path(cores = None, Model = None, bulk = None, comp = None, Frac_solid
|
|
98
98
|
Dictionary with each run's label as key. Values are sub-dictionaries of phase/property DataFrames.
|
99
99
|
Includes `Input` key summarizing model configuration per run.
|
100
100
|
"""
|
101
|
+
## make sure everything is a float
|
102
|
+
T_C = to_float(T_C)
|
103
|
+
T_path_C = to_float(T_path_C)
|
104
|
+
T_start_C = to_float(T_start_C)
|
105
|
+
T_end_C = to_float(T_end_C)
|
106
|
+
dt_C = to_float(dt_C)
|
107
|
+
|
108
|
+
P_bar = to_float(P_bar)
|
109
|
+
P_path_bar = to_float(P_path_bar)
|
110
|
+
P_start_bar= to_float(P_start_bar)
|
111
|
+
P_end_bar = to_float(P_end_bar)
|
112
|
+
dp_bar = to_float(dp_bar)
|
113
|
+
|
114
|
+
Fe3Fet_init= to_float(Fe3Fet_init)
|
115
|
+
Fe3Fet_Liq = to_float(Fe3Fet_Liq)
|
116
|
+
H2O_init = to_float(H2O_init)
|
117
|
+
H2O_Liq = to_float(H2O_Liq)
|
118
|
+
CO2_init = to_float(CO2_init)
|
119
|
+
CO2_Liq = to_float(CO2_Liq)
|
120
|
+
fO2_offset = to_float(fO2_offset)
|
101
121
|
|
102
122
|
if timeout is None:
|
103
123
|
timeout = 180
|
@@ -153,7 +173,7 @@ def multi_path(cores = None, Model = None, bulk = None, comp = None, Frac_solid
|
|
153
173
|
|
154
174
|
# ensure the bulk composition has the correct headers etc.
|
155
175
|
comp = comp_fix(Model = Model, comp = comp, Fe3Fet_Liq = Fe3Fet_init, H2O_Liq = H2O_init, CO2_Liq = CO2_init)
|
156
|
-
|
176
|
+
|
157
177
|
if type(comp) == dict:
|
158
178
|
if comp['H2O_Liq'] == 0.0 and "MELTS" in Model:
|
159
179
|
raise Warning("Adding small amounts of H$_{2}$O may improve the ability of MELTS to accurately reproduce the saturation of oxide minerals. Additionally, sufficient H$_{2}$O is required in the model for MELTS to predict the crystallisation of apatite, rather than whitlockite.")
|
@@ -473,28 +493,48 @@ def path_multi(q, index, *, Model = None, comp = None, Frac_solid = None, Frac_f
|
|
473
493
|
|
474
494
|
jl.seval("using MAGEMinCalc")
|
475
495
|
|
476
|
-
|
477
496
|
for i in index:
|
478
497
|
try:
|
479
498
|
if "MELTS" in Model:
|
480
499
|
if type(comp) == dict:
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
500
|
+
if trail is not None:
|
501
|
+
Results, tr = path_MELTS(Model = Model, comp = comp, Frac_solid = Frac_solid, Frac_fluid = Frac_fluid,
|
502
|
+
T_initial_C = 1400, T_C = T_C[i], T_path_C = T_path_C[i], T_start_C = T_start_C[i],
|
503
|
+
T_end_C = T_end_C[i], dt_C = dt_C[i], P_bar = P_bar[i], P_path_bar = P_path_bar[i],
|
504
|
+
P_start_bar = P_start_bar[i], P_end_bar = P_end_bar[i], dp_bar = dp_bar[i],
|
505
|
+
isenthalpic = isenthalpic, isentropic = isentropic, isochoric = isochoric,
|
506
|
+
find_liquidus = find_liquidus, fO2_buffer = fO2_buffer, fO2_offset = fO2_offset[i],
|
507
|
+
fluid_sat = fluid_sat, Crystallinity_limit = Crystallinity_limit, Suppress = Suppress,
|
508
|
+
Suppress_except=Suppress_except, trail = trail, melts = melts)
|
509
|
+
else:
|
510
|
+
Results = path_MELTS(Model = Model, comp = comp, Frac_solid = Frac_solid, Frac_fluid = Frac_fluid,
|
511
|
+
T_initial_C = 1400, T_C = T_C[i], T_path_C = T_path_C[i], T_start_C = T_start_C[i],
|
512
|
+
T_end_C = T_end_C[i], dt_C = dt_C[i], P_bar = P_bar[i], P_path_bar = P_path_bar[i],
|
513
|
+
P_start_bar = P_start_bar[i], P_end_bar = P_end_bar[i], dp_bar = dp_bar[i],
|
514
|
+
isenthalpic = isenthalpic, isentropic = isentropic, isochoric = isochoric,
|
515
|
+
find_liquidus = find_liquidus, fO2_buffer = fO2_buffer, fO2_offset = fO2_offset[i],
|
516
|
+
fluid_sat = fluid_sat, Crystallinity_limit = Crystallinity_limit, Suppress = Suppress,
|
517
|
+
Suppress_except=Suppress_except, trail = trail, melts = melts)
|
518
|
+
|
489
519
|
else:
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
520
|
+
if trail is not None:
|
521
|
+
Results, tr = path_MELTS(Model = Model, comp = comp.loc[i].to_dict(), Frac_solid = Frac_solid, Frac_fluid = Frac_fluid,
|
522
|
+
T_initial_C = 1400, T_C = T_C[i], T_path_C = T_path_C[i], T_start_C = T_start_C[i],
|
523
|
+
T_end_C = T_end_C[i], dt_C = dt_C[i], P_bar = P_bar[i], P_path_bar = P_path_bar[i],
|
524
|
+
P_start_bar = P_start_bar[i], P_end_bar = P_end_bar[i], dp_bar = dp_bar[i],
|
525
|
+
isenthalpic = isenthalpic, isentropic = isentropic, isochoric = isochoric,
|
526
|
+
find_liquidus = find_liquidus, fO2_buffer = fO2_buffer, fO2_offset = fO2_offset[i],
|
527
|
+
fluid_sat = fluid_sat, Crystallinity_limit = Crystallinity_limit, Suppress = Suppress,
|
528
|
+
Suppress_except=Suppress_except, trail = trail, melts = melts)
|
529
|
+
else:
|
530
|
+
Results = path_MELTS(Model = Model, comp = comp.loc[i].to_dict(), Frac_solid = Frac_solid, Frac_fluid = Frac_fluid,
|
531
|
+
T_initial_C = 1400, T_C = T_C[i], T_path_C = T_path_C[i], T_start_C = T_start_C[i],
|
532
|
+
T_end_C = T_end_C[i], dt_C = dt_C[i], P_bar = P_bar[i], P_path_bar = P_path_bar[i],
|
533
|
+
P_start_bar = P_start_bar[i], P_end_bar = P_end_bar[i], dp_bar = dp_bar[i],
|
534
|
+
isenthalpic = isenthalpic, isentropic = isentropic, isochoric = isochoric,
|
535
|
+
find_liquidus = find_liquidus, fO2_buffer = fO2_buffer, fO2_offset = fO2_offset[i],
|
536
|
+
fluid_sat = fluid_sat, Crystallinity_limit = Crystallinity_limit, Suppress = Suppress,
|
537
|
+
Suppress_except=Suppress_except, trail = trail, melts = melts)
|
498
538
|
else:
|
499
539
|
if fO2_offset[i] is None:
|
500
540
|
fO2_offset[i] = 0.0
|
@@ -66,6 +66,26 @@ def phaseDiagram_calc(cores = None, Model = None, bulk = None, T_C = None, P_bar
|
|
66
66
|
pandas.DataFrame
|
67
67
|
A dataframe containing the phase diagram results.
|
68
68
|
"""
|
69
|
+
|
70
|
+
## make sure everything is a float
|
71
|
+
T_C = to_float(T_C)
|
72
|
+
T_min_C = to_float(T_min_C)
|
73
|
+
T_max_C = to_float(T_max_C)
|
74
|
+
T_num = to_float(T_num)
|
75
|
+
|
76
|
+
P_bar = to_float(P_bar)
|
77
|
+
P_min_bar = to_float(P_min_bar)
|
78
|
+
P_max_bar= to_float(P_max_bar)
|
79
|
+
P_num = to_float(P_num)
|
80
|
+
|
81
|
+
Fe3Fet_init= to_float(Fe3Fet_init)
|
82
|
+
Fe3Fet_Liq = to_float(Fe3Fet_Liq)
|
83
|
+
H2O_init = to_float(H2O_init)
|
84
|
+
H2O_Liq = to_float(H2O_Liq)
|
85
|
+
CO2_init = to_float(CO2_init)
|
86
|
+
CO2_Liq = to_float(CO2_Liq)
|
87
|
+
fO2_offset = to_float(fO2_offset)
|
88
|
+
|
69
89
|
if H2O_Liq is not None:
|
70
90
|
print('Warning - the kwarg "H2O_Liq" will be removed from v1.0.0 onwards. Please use "H2O_init" instead.')
|
71
91
|
if H2O_init is None:
|
@@ -299,7 +319,7 @@ def phaseDiagram_calc(cores = None, Model = None, bulk = None, T_C = None, P_bar
|
|
299
319
|
return Combined
|
300
320
|
|
301
321
|
def phaseDiagram_refine(Data = None, Model = None, bulk = None, Fe3Fet_Liq = None, H2O_Liq = None, CO2_Liq = None,
|
302
|
-
fO2_buffer = None, fO2_offset = None, i_max =
|
322
|
+
fO2_buffer = None, fO2_offset = None, i_max = 150):
|
303
323
|
Combined = Data.copy()
|
304
324
|
# find existing T,P data
|
305
325
|
T_C = Combined['T_C'].unique()
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{PetThermoTools-0.2.40 → PetThermoTools-0.2.41}/src/PetThermoTools.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|