PetThermoTools 0.2.42__py3-none-any.whl → 0.2.44__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/Barom.py CHANGED
@@ -223,6 +223,7 @@ def mineral_cosaturation(Model="MELTSv1.0.2", cores=int(np.floor(multiprocessing
223
223
  index_out = np.array([], dtype=int)
224
224
 
225
225
  while len(index_out) < len(index_in):
226
+ Start = time.time()
226
227
  index = np.setdiff1d(index_in, index_out)
227
228
  groups = np.array_split(index, cores)
228
229
  non_empty_groups = [g for g in groups if g.size > 0]
@@ -242,10 +243,19 @@ def mineral_cosaturation(Model="MELTSv1.0.2", cores=int(np.floor(multiprocessing
242
243
 
243
244
  for p, q, group in processes:
244
245
  try:
245
- res = q.get(timeout=timeout)
246
+ if time.time() - Start > timeout + 10:
247
+ res = q.get(timeout = 10)
248
+ else:
249
+ res = q.get(timeout=timeout)
246
250
  except:
251
+ if "MELTS" not in Model:
252
+ print(f"Timeout warning reached. Calculation P_bar = {P_bar[group[0]]} will not be returned. Try increasing the timeout.")
247
253
  res = []
248
254
  idx_chunks = np.array([group[0]], dtype = int)
255
+ mask = np.ones(len(P_bar), dtype=bool)
256
+ mask[idx_chunks] = False
257
+ P_bar = P_bar[mask]
258
+
249
259
  p.join(timeout = 2)
250
260
  p.terminate()
251
261
 
@@ -290,7 +300,7 @@ def mineral_cosaturation(Model="MELTSv1.0.2", cores=int(np.floor(multiprocessing
290
300
  phases=phases,
291
301
  melts = melts
292
302
  )
293
- results[f"index = {i}"] = Results
303
+ results[f"Run {i}"] = Results
294
304
  combined_results.update(results)
295
305
  else:
296
306
  if fO2_offset is None:
@@ -307,7 +317,7 @@ def mineral_cosaturation(Model="MELTSv1.0.2", cores=int(np.floor(multiprocessing
307
317
  )
308
318
 
309
319
  Results = dict(Results_df)
310
- results[f"index = {i}"] = Results
320
+ results[f"Run {i}"] = Results
311
321
  combined_results.update(results)
312
322
 
313
323
  results = combined_results
PetThermoTools/Melting.py CHANGED
@@ -13,7 +13,7 @@ from tqdm.notebook import tqdm, trange
13
13
 
14
14
  def AdiabaticDecompressionMelting(cores = multiprocessing.cpu_count(),
15
15
  Model = "pMELTS", bulk = "KLB-1", comp_lith_1 = None,
16
- comp_lith_2 = None, comp_lith_3 = None, Tp_C = 1350, Tp_Method = "pyMelt",
16
+ comp_lith_2 = None, comp_lith_3 = None, Tp_C = 1350, Tp_Method = None,
17
17
  P_start_bar = 30000, P_end_bar = 2000, dp_bar = 200,
18
18
  P_path_bar = None, Frac = False, prop = None,
19
19
  fO2_buffer = None, fO2_offset = None, Fe3Fet = None, MELTS_filter = True):
@@ -311,6 +311,17 @@ def AdiabaticMelt(q, index, *, Model = None, comp_1 = None, comp_2 = None, comp_
311
311
 
312
312
  from juliacall import Main as jl, convert as jlconvert
313
313
 
314
+ # import os, pathlib
315
+
316
+ # # 1. Where to install Julia + MAGEMin environment (user home dir, persistent)
317
+ # home = str(pathlib.Path.home())
318
+ # env_path = os.path.join(home, ".MAGEMinEnv")
319
+
320
+ # jl.seval(f"""
321
+ # import Pkg
322
+ # Pkg.activate("{env_path}")
323
+ # """)
324
+
314
325
  jl.seval("using MAGEMinCalc")
315
326
 
316
327
  comp_1['O'] = comp_1['Fe3Fet_Liq']*(((159.59/2)/71.844)*comp_1['FeOt_Liq'] - comp_1['FeOt_Liq'])
@@ -323,7 +334,8 @@ def AdiabaticMelt(q, index, *, Model = None, comp_1 = None, comp_2 = None, comp_
323
334
 
324
335
  Output_jl = jl.MAGEMinCalc.AdiabaticDecompressionMelting(comp = comp_julia, P_start_kbar = P_start_bar/1000.0,
325
336
  P_end_kbar = P_end_bar/1000.0, dp_kbar = dp_bar/1000.0,
326
- T_start_C = T_start_C, fo2_buffer = fO2_buffer, fo2_offset = fO2_offset, Model = Model)
337
+ T_start_C = T_start_C, fo2_buffer = fO2_buffer,
338
+ fo2_offset = fO2_offset, Model = Model, Tp_C = Tp_C)
327
339
  Results = dict(Output_jl)
328
340
  # Results = stich(Results, Model = Model)
329
341
 
PetThermoTools/Path.py CHANGED
@@ -491,9 +491,22 @@ def path_multi(q, index, *, Model = None, comp = None, Frac_solid = None, Frac_f
491
491
  elif Model == "MELTSv1.2.0":
492
492
  melts = MELTSdynamic(4)
493
493
  else:
494
- from juliacall import Main as jl, convert as jlconvert
494
+ from juliacall import Main as jl
495
+
496
+ # import os, pathlib
497
+
498
+ # # 1. Where to install Julia + MAGEMin environment (user home dir, persistent)
499
+ # home = str(pathlib.Path.home())
500
+ # env_path = os.path.join(home, ".MAGEMinEnv")
501
+
502
+ # jl.seval(f"""
503
+ # import Pkg
504
+ # Pkg.activate("{env_path}")
505
+ # """)
495
506
 
496
507
  jl.seval("using MAGEMinCalc")
508
+
509
+
497
510
 
498
511
  for i in index:
499
512
  try:
@@ -554,12 +567,24 @@ def path_multi(q, index, *, Model = None, comp = None, Frac_solid = None, Frac_f
554
567
  # T_C = T_C[i], T_path_C = T_path_C[i], P_start_bar = P_start_bar[i], P_end_bar = P_end_bar[i],
555
568
  # dp_bar = dp_bar[i], P_bar = P_bar[i], P_path_bar = P_path_bar[i], frac_xtal = Frac_solid,
556
569
  # fo2_buffer = fO2_buffer, fo2_offset = fO2_offset[i], find_liquidus = find_liquidus)
557
-
570
+
571
+ julia_Suppress = None
572
+ if Suppress == ['rutile', 'tridymite']:
573
+ Suppress = None
574
+ julia_Suppress = None
575
+
576
+ if Suppress is not None:
577
+ jl.Suppress = Suppress
578
+ jl.seval("Suppress = Vector{String}(Suppress)")
579
+ julia_Suppress = jl.Suppress
580
+
581
+
558
582
  Results_df = jl.MAGEMinCalc.path(
559
583
  comp=comp_julia, T_start_C=T_start_C[i], T_end_C=T_end_C[i], dt_C=dt_C[i],
560
584
  T_C=T_C[i], P_start_bar=P_start_bar[i], P_end_bar=P_end_bar[i], dp_bar=dp_bar[i],
561
585
  P_bar=P_bar[i], T_path_C=T_path_C[i], P_path_bar=P_path_bar[i], frac_xtal=Frac_solid,
562
- Model=Model, fo2_buffer=fO2_buffer, fo2_offset=fO2_offset[i], find_liquidus=find_liquidus
586
+ Model=Model, fo2_buffer=fO2_buffer, fo2_offset=fO2_offset[i], find_liquidus=find_liquidus,
587
+ suppress = julia_Suppress
563
588
  )
564
589
 
565
590
  Results = dict(Results_df)
@@ -721,6 +746,16 @@ def path(q, index, *, Model = None, comp = None, Frac_solid = None, Frac_fluid =
721
746
 
722
747
  # import julia
723
748
  from juliacall import Main as jl, convert as jlconvert
749
+ # import os, pathlib
750
+
751
+ # # 1. Where to install Julia + MAGEMin environment (user home dir, persistent)
752
+ # home = str(pathlib.Path.home())
753
+ # env_path = os.path.join(home, ".MAGEMinEnv")
754
+
755
+ # jl.seval(f"""
756
+ # import Pkg
757
+ # Pkg.activate("{env_path}")
758
+ # """)
724
759
 
725
760
  jl.seval("using MAGEMinCalc")
726
761
 
@@ -739,11 +774,23 @@ def path(q, index, *, Model = None, comp = None, Frac_solid = None, Frac_fluid =
739
774
  else:
740
775
  P_path_bar_julia = P_path_bar
741
776
 
777
+ julia_Suppress = None
778
+ if Suppress == ['rutile', 'tridymite']:
779
+ Suppress = None
780
+ julia_Suppress = None
781
+
782
+ if Suppress is not None:
783
+ jl.Suppress = Suppress
784
+ jl.seval("Suppress = Vector{String}(Suppress)")
785
+ julia_Suppress = jl.Suppress
786
+
787
+
742
788
  Results = jl.MAGEMinCalc.path(
743
789
  comp=comp_julia, T_start_C=T_start_C, T_end_C=T_end_C, dt_C=dt_C,
744
790
  T_C=T_C, P_start_bar=P_start_bar, P_end_bar=P_end_bar, dp_bar=dp_bar,
745
791
  P_bar=P_bar, T_path_C=T_path_C_julia, P_path_bar=P_path_bar_julia, frac_xtal=Frac_solid,
746
- Model=Model, fo2_buffer=fO2_buffer, fo2_offset=fO2_offset, find_liquidus=find_liquidus
792
+ Model=Model, fo2_buffer=fO2_buffer, fo2_offset=fO2_offset, find_liquidus=find_liquidus,
793
+ suppress = julia_Suppress
747
794
  )
748
795
  # Results = jl.pyconvert(dict, Results)
749
796
  Results_df = dict(Results)
@@ -5,4 +5,4 @@
5
5
  # 1) we don't load dependencies by storing it in __init__.py
6
6
  # 2) we can import it in setup.py for the same reason
7
7
  # 3) we can import it into your module
8
- __version__ = '0.2.42'
8
+ __version__ = '0.2.44'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PetThermoTools
3
- Version: 0.2.42
3
+ Version: 0.2.44
4
4
  Summary: PetThermoTools
5
5
  Home-page: https://github.com/gleesonm1/PetThermoTools
6
6
  Author: Matthew Gleeson
@@ -16,7 +16,6 @@ Requires-Dist: numpy
16
16
  Requires-Dist: matplotlib
17
17
  Requires-Dist: scikit-learn
18
18
  Requires-Dist: scipy
19
- Requires-Dist: julia
20
19
  Requires-Dist: tinynumpy
21
20
  Requires-Dist: shapely
22
21
  Requires-Dist: Thermobar
@@ -1,20 +1,20 @@
1
- PetThermoTools/Barom.py,sha256=HKd1TTHHl0FnM_SGb0qC7KqH7rybyVixVMH7Wph-nk8,46613
1
+ PetThermoTools/Barom.py,sha256=6LObqDzICfgBTH3ki9mt8yd-2EgTZIAO55p5BwfiBBk,47113
2
2
  PetThermoTools/Compositions.py,sha256=65NzfduzWdfHJ8VmHBN1Cv7fMz7kF3QbDVLei-e4v00,1483
3
3
  PetThermoTools/GenFuncs.py,sha256=oMV3FYIpfHNpGZloN5a6Vr8Sv_5IRsKt4hHIUNbDu24,19996
4
4
  PetThermoTools/Holland.py,sha256=udBFeVUyTBpSfLIhx7Hy6o0I8ApNCDvwU_gZa0diY5w,7251
5
5
  PetThermoTools/Installation.py,sha256=UfVOW1NZFdzMWPyID5u7t0KwvpJA0AqYohzidXIAwYs,6098
6
6
  PetThermoTools/Liq.py,sha256=4tOnVROXr7V6cfvZceKidFT9J20TZE3Om2oem92QC4s,36842
7
7
  PetThermoTools/MELTS.py,sha256=2WB4Y11i7yfTM5dRjEr-KrJY2_7f1kLaW4V0di6Qnew,76511
8
- PetThermoTools/Melting.py,sha256=D4mXTrKkoUPK8dAuHPQRAnK79owI23W7JBmUMvm1DVU,15332
9
- PetThermoTools/Path.py,sha256=jUAVvKSDuVSYRiIZbL1J21E8X4Loc2xCkRTYyl4PzG4,38179
8
+ PetThermoTools/Melting.py,sha256=19rFcTegaB04Dx3bsclbLdjzlegJHGlMRn2QnccLqQw,15718
9
+ PetThermoTools/Path.py,sha256=MOQMN9jIBbSsqXD1BCHsWoMPOWphqCYCKQvmm88mltA,39580
10
10
  PetThermoTools/Path_wrappers.py,sha256=gUxs_4Qbk4MLlLl4iySxfbfKU34588bIJAYyhHmhFdc,30177
11
11
  PetThermoTools/PhaseDiagrams.py,sha256=sjjX84LK34m_OjsKCV78zpzRDAXG7oaLu_Z5BxwB_3I,30298
12
12
  PetThermoTools/Plotting.py,sha256=KxBNT2nqqrVn9dsAIjGk1hMUVRq7r-WrG_b9quNcRMo,37295
13
13
  PetThermoTools/Saturation.py,sha256=3liK4WDVtl5DWpMpE_tQ_fONBCZTctkiNeCXCuNmXoM,29961
14
14
  PetThermoTools/__init__.py,sha256=PbiwQj_mNNEwuIZOLETmtMMshiXa50wjCA6mfvpOpOs,2393
15
- PetThermoTools/_version.py,sha256=gEQfVmDQZosUq8hqgOF7-NXfujY6yVc6ya0YiW2W8ZM,296
16
- PetThermoTools-0.2.42.dist-info/LICENSE.txt,sha256=-mkx4iEw8Pk1RZUvncBhGLW87Uur5JB7FBQtOmX-VP0,1752
17
- PetThermoTools-0.2.42.dist-info/METADATA,sha256=yUKuTP6xbaOHpYQ3g4D5T5qA5XyqfsB0Gs1aBTJF0YA,794
18
- PetThermoTools-0.2.42.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
19
- PetThermoTools-0.2.42.dist-info/top_level.txt,sha256=IqK8iYBR3YJozzMOTRZ8x8mU2k6x8ycoMBxZTm-I06U,15
20
- PetThermoTools-0.2.42.dist-info/RECORD,,
15
+ PetThermoTools/_version.py,sha256=YefFKNLbTovWyfWUHpACuEmBVwW4nY9fuZlPRNDqNDY,296
16
+ PetThermoTools-0.2.44.dist-info/LICENSE.txt,sha256=-mkx4iEw8Pk1RZUvncBhGLW87Uur5JB7FBQtOmX-VP0,1752
17
+ PetThermoTools-0.2.44.dist-info/METADATA,sha256=ppYpb851WSgn43kuz_O2fMQLSs1IuFwwlJXq5onq4Nk,773
18
+ PetThermoTools-0.2.44.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
19
+ PetThermoTools-0.2.44.dist-info/top_level.txt,sha256=IqK8iYBR3YJozzMOTRZ8x8mU2k6x8ycoMBxZTm-I06U,15
20
+ PetThermoTools-0.2.44.dist-info/RECORD,,