PetThermoTools 0.2.38__tar.gz → 0.2.39__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.
Files changed (25) hide show
  1. {PetThermoTools-0.2.38/src/PetThermoTools.egg-info → PetThermoTools-0.2.39}/PKG-INFO +1 -1
  2. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools/Melting.py +55 -18
  3. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools/Plotting.py +5 -4
  4. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools/_version.py +1 -1
  5. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39/src/PetThermoTools.egg-info}/PKG-INFO +1 -1
  6. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/LICENSE.txt +0 -0
  7. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/README.md +0 -0
  8. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/setup.cfg +0 -0
  9. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/setup.py +0 -0
  10. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools/Barom.py +0 -0
  11. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools/Compositions.py +0 -0
  12. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools/GenFuncs.py +0 -0
  13. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools/Holland.py +0 -0
  14. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools/Installation.py +0 -0
  15. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools/Liq.py +0 -0
  16. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools/MELTS.py +0 -0
  17. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools/Path.py +0 -0
  18. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools/Path_wrappers.py +0 -0
  19. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools/PhaseDiagrams.py +0 -0
  20. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools/Saturation.py +0 -0
  21. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools/__init__.py +0 -0
  22. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools.egg-info/SOURCES.txt +0 -0
  23. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools.egg-info/dependency_links.txt +0 -0
  24. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools.egg-info/requires.txt +0 -0
  25. {PetThermoTools-0.2.38 → PetThermoTools-0.2.39}/src/PetThermoTools.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PetThermoTools
3
- Version: 0.2.38
3
+ Version: 0.2.39
4
4
  Summary: PetThermoTools
5
5
  Home-page: https://github.com/gleesonm1/PetThermoTools
6
6
  Author: Matthew Gleeson
@@ -49,14 +49,15 @@ 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
- try:
53
- import pyMelt as m
54
- Lithologies = {'KLB-1': m.lithologies.matthews.klb1(),
55
- 'KG1': m.lithologies.matthews.kg1(),
56
- 'G2': m.lithologies.matthews.eclogite(),
57
- 'hz': m.lithologies.shorttle.harzburgite()}
58
- except ImportError:
59
- raise RuntimeError('You havent installed pyMelt or there is an error when importing pyMelt. pyMelt is currently required to estimate the starting point for the melting calculations.')
52
+ if Tp_Method == "pyMelt":
53
+ try:
54
+ import pyMelt as m
55
+ Lithologies = {'KLB-1': m.lithologies.matthews.klb1(),
56
+ 'KG1': m.lithologies.matthews.kg1(),
57
+ 'G2': m.lithologies.matthews.eclogite(),
58
+ 'hz': m.lithologies.shorttle.harzburgite()}
59
+ except ImportError:
60
+ raise RuntimeError('You havent installed pyMelt or there is an error when importing pyMelt. pyMelt is currently required to estimate the starting point for the melting calculations.')
60
61
 
61
62
  if bulk is not None and comp_lith_1 is None:
62
63
  comp_lith_1 = bulk
@@ -155,7 +156,9 @@ def AdiabaticDecompressionMelting(cores = multiprocessing.cpu_count(),
155
156
 
156
157
  return Results
157
158
 
158
- def AdiabaticMelt(q, index, *, Model = None, comp_1 = None, comp_2 = None, comp_3 = None, Tp_C = None, P_start_bar = None, P_end_bar = None, dp_bar = None, P_path_bar = None, Frac = None, fO2_buffer = None, fO2_offset = None, prop = None):
159
+ def AdiabaticMelt(q, index, *, Model = None, comp_1 = None, comp_2 = None, comp_3 = None,
160
+ Tp_C = None, P_start_bar = None, P_end_bar = None, dp_bar = None, P_path_bar = None,
161
+ Frac = None, fO2_buffer = None, fO2_offset = None, prop = None):
159
162
  '''
160
163
  Melting calculations to be performed in parallel.
161
164
 
@@ -163,21 +166,16 @@ def AdiabaticMelt(q, index, *, Model = None, comp_1 = None, comp_2 = None, comp_
163
166
  Results = {}
164
167
  if "MELTS" in Model:
165
168
  try:
166
- Results = AdiabaticDecompressionMelting_MELTS(Model = Model, comp = comp_1, Tp_C = Tp_C, P_path_bar = P_path_bar, P_start_bar = P_start_bar, P_end_bar = P_end_bar, dp_bar = dp_bar, fO2_buffer = fO2_buffer, fO2_offset = fO2_offset)
169
+ Results = AdiabaticDecompressionMelting_MELTS(Model = Model, comp = comp_1, Tp_C = Tp_C,
170
+ P_path_bar = P_path_bar, P_start_bar = P_start_bar, P_end_bar = P_end_bar, dp_bar = dp_bar,
171
+ fO2_buffer = fO2_buffer, fO2_offset = fO2_offset)
167
172
  q.put([Results, index])
168
173
  except:
169
174
  q.put([])
170
175
 
171
176
  return
172
-
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)
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.')
177
- q.put([Results, index])
178
- return
179
177
 
180
- if Model == "pyMelt":
178
+ elif Model == "pyMelt":
181
179
  try:
182
180
  import pyMelt as m
183
181
  Lithologies = {'KLB-1': m.lithologies.matthews.klb1(),
@@ -239,5 +237,44 @@ def AdiabaticMelt(q, index, *, Model = None, comp_1 = None, comp_2 = None, comp_
239
237
 
240
238
  q.put([Results, index])
241
239
  return
240
+
241
+ else:
242
+ # import pyMAGEMINcalc as MM
243
+ # 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)
244
+ # 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.')
245
+
246
+ try:
247
+ import pyMelt as m
248
+ Lithologies = {'KLB-1': m.lithologies.matthews.klb1(),
249
+ 'KG1': m.lithologies.matthews.kg1(),
250
+ 'G2': m.lithologies.matthews.eclogite(),
251
+ 'hz': m.lithologies.shorttle.harzburgite()}
252
+ except ImportError:
253
+ raise RuntimeError('You havent installed pyMelt or there is an error when importing pyMelt. pyMelt is currently required to estimate the starting point for the melting calculations.')
254
+
255
+ lz = m.lithologies.matthews.klb1()
256
+ mantle = m.mantle([lz], [1], ['Lz'])
257
+ T_start_C = mantle.adiabat(P_start_bar/10000.0, Tp_C)
258
+
259
+ from juliacall import Main as jl, convert as jlconvert
260
+
261
+ jl.seval("using MAGEMinCalc")
262
+
263
+ comp_1['O'] = comp_1['Fe3Fet_Liq']*(((159.59/2)/71.844)*comp_1['FeOt_Liq'] - comp_1['FeOt_Liq'])
264
+
265
+ if type(comp_1) == dict:
266
+ comp_julia = jl.seval("Dict")(comp_1)
267
+ else:
268
+ comp_new = comp_1.loc[i].to_dict()
269
+ comp_julia = jl.seval("Dict")(comp_new)
270
+
271
+ Output_jl = jl.MAGEMinCalc.AdiabaticDecompressionMelting(comp = comp_julia, P_start_kbar = P_start_bar/1000.0,
272
+ P_end_kbar = P_end_bar/1000.0, dp_kbar = dp_bar/1000.0,
273
+ T_start_C = T_start_C, fo2_buffer = fO2_buffer, fo2_offset = fO2_offset, Model = Model)
274
+ Results = dict(Output_jl)
275
+ # Results = stich(Results, Model = Model)
276
+
277
+ q.put([Results, index])
278
+ return
242
279
 
243
280
 
@@ -359,7 +359,7 @@ def residualT_plot(Results = None, P_bar = None, phases = None, H2O_Liq = None,
359
359
  a[i][j].set_zlim([0,50])
360
360
 
361
361
  def phase_plot(Results = None, y_axis = None, x_axis = None,
362
- phases = ['Liq','Ol', 'Opx', 'Cpx', 'Sp', 'Grt'], cmap = "Reds",
362
+ phases = ['Liq', 'Ol', 'Opx', 'Cpx', 'Sp', 'Grt'], cmap = "Reds",
363
363
  title = None, figsize = None):
364
364
 
365
365
  if type(Results) != list:
@@ -373,10 +373,11 @@ def phase_plot(Results = None, y_axis = None, x_axis = None,
373
373
 
374
374
  Stop = np.zeros(len(Results['All']['P_bar']))
375
375
  for idx, p in enumerate(phases):
376
- a.fill_betweenx(Results['All']['P_bar'], Stop,
377
- x2= Stop + Results['All']['Mass_' + p], alpha = 0.75, color = PhaseList[p], lw = 0)
376
+ if 'mass_' + p in Results['All'].keys():
377
+ a.fill_betweenx(Results['All']['P_bar'], Stop,
378
+ x2= Stop + Results['All']['mass_' + p], alpha = 0.75, color = PhaseList[p], lw = 0)
378
379
 
379
- Stop = Stop + Results['All']['Mass_'+p]
380
+ Stop = Stop + Results['All']['mass_' + p]
380
381
 
381
382
  a.set_ylabel('Pressure (bars)')
382
383
  a.set_xlabel('Mass (g)')
@@ -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.38'
8
+ __version__ = '0.2.39'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PetThermoTools
3
- Version: 0.2.38
3
+ Version: 0.2.39
4
4
  Summary: PetThermoTools
5
5
  Home-page: https://github.com/gleesonm1/PetThermoTools
6
6
  Author: Matthew Gleeson