VolFe 0.4.2__tar.gz → 1.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: VolFe
3
- Version: 0.4.2
3
+ Version: 1.0
4
4
  Summary: VolFe
5
5
  Author: Pip Liggins, Penny Wieser
6
6
  Author-email: Ery Hughes <ery.c.hughes@gmail.com>
@@ -38,7 +38,7 @@ Welcome to VolFe! an open-source framework for calculating melt-vapour equilibri
38
38
  [![Documentation Status](https://readthedocs.org/projects/VolFe/badge/?version=latest)](https://VolFe.readthedocs.io/en/latest/?badge=latest)
39
39
 
40
40
  Read more about the python package in the Earth ArXiv pre-print (and please cite if you use the package!):
41
- Hughes, E.C., Liggins, P., Wieser, P. and Stolper, E.M., 2024. VolFe: an open-source tool for calculating melt-vapor equilibria including silicate melt, carbon, hydrogen, sulfur, and noble gases. https://doi.org/10.31223/X52X3G
41
+ Hughes, E.C., Liggins, P., Wieser, P. and Stolper, E.M., 2024. VolFe: an open-source Python package for calculating melt-vapor equilibria including silicate melt, carbon, hydrogen, sulfur, and noble gases. https://doi.org/10.31223/X52X3G
42
42
 
43
43
  For more information and worked examples, see the ReadTheDocs page:
44
44
  https://volfe.readthedocs.io/en/latest/
@@ -8,7 +8,7 @@ Welcome to VolFe! an open-source framework for calculating melt-vapour equilibri
8
8
  [![Documentation Status](https://readthedocs.org/projects/VolFe/badge/?version=latest)](https://VolFe.readthedocs.io/en/latest/?badge=latest)
9
9
 
10
10
  Read more about the python package in the Earth ArXiv pre-print (and please cite if you use the package!):
11
- Hughes, E.C., Liggins, P., Wieser, P. and Stolper, E.M., 2024. VolFe: an open-source tool for calculating melt-vapor equilibria including silicate melt, carbon, hydrogen, sulfur, and noble gases. https://doi.org/10.31223/X52X3G
11
+ Hughes, E.C., Liggins, P., Wieser, P. and Stolper, E.M., 2024. VolFe: an open-source Python package for calculating melt-vapor equilibria including silicate melt, carbon, hydrogen, sulfur, and noble gases. https://doi.org/10.31223/X52X3G
12
12
 
13
13
  For more information and worked examples, see the ReadTheDocs page:
14
14
  https://volfe.readthedocs.io/en/latest/
@@ -30,4 +30,4 @@ Check VolFe runs on your machine, and that any edits you make haven't broken exi
30
30
  ```
31
31
  python -m pytest tests
32
32
  ```
33
- or you can use the testing frameworks that come with your IDE (e.g. [VSCode](https://code.visualstudio.com/docs/python/testing), [PyCharm](https://www.jetbrains.com/help/pycharm/testing-your-first-python-application.html)).
33
+ or you can use the testing frameworks that come with your IDE (e.g. [VSCode](https://code.visualstudio.com/docs/python/testing), [PyCharm](https://www.jetbrains.com/help/pycharm/testing-your-first-python-application.html)).
@@ -1,5 +1,5 @@
1
1
  __author__ = "Ery Hughes, Pip Liggins, Penny Wieser"
2
- __version__ = "0.4.2"
2
+ __version__ = "1.0"
3
3
 
4
4
  # functions for calculating properties of the melt and gas
5
5
  from .melt_gas import * # noqa F401 F403
@@ -3276,6 +3276,14 @@ def calc_comp_error_function(
3276
3276
 
3277
3277
  # outputting model options used in the calculation
3278
3278
  def results_isotopes_model_options(models):
3279
+ """Outputs headers and values for model options related to isotopic fractionation.
3280
+
3281
+ Args:
3282
+ models (pandas.DataFrame): Model options.
3283
+
3284
+ Returns:
3285
+ tuple(pandas.DataFrame,pandas.DataFrame): Headers. Values.
3286
+ """
3279
3287
  results_headers = pd.DataFrame(
3280
3288
  [
3281
3289
  [
@@ -3322,6 +3330,16 @@ def results_isotopes_model_options(models):
3322
3330
 
3323
3331
 
3324
3332
  def results_isotopes_gas_melt(comp, run):
3333
+ """Outputs headers and values for melt and vapor composition for isotope
3334
+ fractionation calculations.
3335
+
3336
+ Args:
3337
+ comp (pandas.DataFrame): Composition of the melt and vapor by species, including weight fraction of vapor.
3338
+ run (float): Index of interest.
3339
+
3340
+ Returns:
3341
+ tuple(pandas.DataFrame,pandas.DataFrame): Headers. Values.
3342
+ """
3325
3343
  results_headers = pd.DataFrame(
3326
3344
  [
3327
3345
  [
@@ -3393,6 +3411,21 @@ def results_isotopes_gas_melt(comp, run):
3393
3411
  def results_table_isotopes(
3394
3412
  PT, R_all_species_S, R_m_g_S, R_all_species_C, R_m_g_C, R_all_species_H, R_m_g_H
3395
3413
  ):
3414
+ """Outputs headers and values for isotope ratios for all species and melt and vapor
3415
+ for all elements.
3416
+
3417
+ Args:
3418
+ PT (dict): Pressure (bars) as "P" and temperature ('C) as "T".
3419
+ R_all_species_S (dict): S isotope ratios of all S-bearing species.
3420
+ R_m_g_S (dict): S isotope ratio of melt and vapor.
3421
+ R_all_species_C (dict): C isotope ratios of all C-bearing species.
3422
+ R_m_g_C (dict): C isotope ratio of melt and vapor.
3423
+ R_all_species_H (dict): H isotope ratios of all H-bearing species.
3424
+ R_m_g_H (dict): H isotope ratio of melt and vapor.
3425
+
3426
+ Returns:
3427
+ tuple(pandas.DataFrame,pandas.DataFrame): Headers. Values.
3428
+ """
3396
3429
  results_headers = pd.DataFrame(
3397
3430
  [
3398
3431
  [
@@ -3473,6 +3506,20 @@ def results_table_isotopes(
3473
3506
  def results_table_isotopes_d(
3474
3507
  R_all_species_S, R_m_g_S, R_all_species_C, R_m_g_C, R_all_species_H, R_m_g_H
3475
3508
  ):
3509
+ """Outputs headers and values for isotope ratios for all species and melt and vapor
3510
+ for all elements as delta-values.
3511
+
3512
+ Args:
3513
+ R_all_species_S (dict): S isotope ratios of all S-bearing species.
3514
+ R_m_g_S (dict): S isotope ratio of melt and vapor.
3515
+ R_all_species_C (dict): C isotope ratios of all C-bearing species.
3516
+ R_m_g_C (dict): C isotope ratio of melt and vapor.
3517
+ R_all_species_H (dict): H isotope ratios of all H-bearing species.
3518
+ R_m_g_H (dict): H isotope ratio of melt and vapor.
3519
+
3520
+ Returns:
3521
+ tuple(pandas.DataFrame,pandas.DataFrame): Headers. Values.
3522
+ """
3476
3523
  results_headers = pd.DataFrame(
3477
3524
  [
3478
3525
  [
@@ -3555,6 +3602,21 @@ def calc_isotopes_gassing(
3555
3602
  nr_tol=1.0e-9,
3556
3603
  models=mdv.default_models,
3557
3604
  ):
3605
+ """Calculates the isotopic ratio and delta value of all species and melt and vapor
3606
+ during degassing.
3607
+
3608
+ Args:
3609
+ setup (pandas.DataFrame): Output from a degassing calculation.
3610
+ R_i_d (dict): Bulk isotope ratios as delta values.
3611
+ first_row (int, optional): First row in setup to run. Defaults to 0.
3612
+ last_row (_type_, optional): Last run in setup to run. Defaults to None.
3613
+ nr_step (float, optional): Step-size for Newton-Raphson solver. Defaults to 1.0.
3614
+ nr_tol (float, optional): Tolerance for Newton-Raphson solver. Defaults to 1.0e-9.
3615
+ models (pandas.DataFrame, optional): Model options. Defaults to mdv.default_models.
3616
+
3617
+ Returns:
3618
+ pandas.DataFrame: Results of isotopic fractionation during degassing.
3619
+ """
3558
3620
  if last_row is None:
3559
3621
  last_row = len(setup)
3560
3622
 
@@ -1184,8 +1184,21 @@ def mf_S_species_old(melt_wf, gas_mf):
1184
1184
  return mf_S
1185
1185
 
1186
1186
 
1187
- # WORK IN PROGRESS
1188
1187
  def mf_S_species(comp):
1188
+ """
1189
+ Calculates weight fraction of S in each sulfur-bearing species in the melt and vapor wrt to
1190
+ total sulfur in the system.
1191
+
1192
+ Parameters
1193
+ ----------
1194
+ comp: pandas.DataFrame
1195
+ Weight fraction by species in the melt and mole fraction in vapor including the wt% of vapor
1196
+
1197
+ Returns
1198
+ -------
1199
+ dict
1200
+ weight fraction (equivalent to mole fraction) of S in each species relative to total S
1201
+ """
1189
1202
  # weight of S in each sulfur-bearing species
1190
1203
  wtg = (float(comp["wt_g_wtpc"].iloc[0])) / 100.0
1191
1204
  wtm = 1.0 - wtg
@@ -1232,8 +1245,21 @@ def mf_S_species(comp):
1232
1245
  return mf
1233
1246
 
1234
1247
 
1235
- # WORK IN PROGRESS
1236
1248
  def mf_C_species(comp):
1249
+ """
1250
+ Calculates weight fraction of C in each carbon-bearing species in the melt and vapor wrt to
1251
+ total carbon in the system.
1252
+
1253
+ Parameters
1254
+ ----------
1255
+ comp: pandas.DataFrame
1256
+ Weight fraction by species in the melt and mole fraction in vapor including the wt% of vapor
1257
+
1258
+ Returns
1259
+ -------
1260
+ dict
1261
+ weight fraction (equivalent to mole fraction) of C in each species relative to total C
1262
+ """
1237
1263
  # weight of C in each carbon-bearing species
1238
1264
  wtg = (float(comp["wt_g_wtpc"].iloc[0])) / 100.0
1239
1265
  wtm = 1.0 - wtg
@@ -1292,42 +1318,22 @@ def mf_C_species(comp):
1292
1318
  return mf
1293
1319
 
1294
1320
 
1295
- (
1296
- "xgO2_mf",
1297
- "xgH2_mf",
1298
- "xgH2O_mf",
1299
- "xgS2_mf",
1300
- "xgSO2_mf",
1301
- "xgH2S_mf",
1302
- "xgCO2_mf",
1303
- )
1304
- (
1305
- "xgCO_mf",
1306
- "xgCH4_mf",
1307
- "xgOCS_mf",
1308
- "xgX_mf",
1309
- "xgC_S_mf",
1310
- )
1311
- (
1312
- "H2OT_wtpc",
1313
- "OH_wtpc",
1314
- "H2Omol_wtpc",
1315
- "H2_ppmw",
1316
- "CH4_ppmw",
1317
- "CO2T_ppmw",
1318
- )
1319
- (
1320
- "CO2mol_ppmw",
1321
- "CO32-_ppmw",
1322
- "CO_ppmw",
1323
- "S2-_ppmw",
1324
- "S6+_ppmw",
1325
- "H2S_ppmw",
1326
- )
1327
-
1328
-
1329
1321
  # WORK IN PROGRESS
1330
1322
  def mf_H_species(comp):
1323
+ """
1324
+ Calculates weight fraction of H in each hydrogen-bearing species in the melt and vapor wrt to
1325
+ total hydrogen in the system.
1326
+
1327
+ Parameters
1328
+ ----------
1329
+ comp: pandas.DataFrame
1330
+ Weight fraction by species in the melt and mole fraction in vapor including the wt% of vapor
1331
+
1332
+ Returns
1333
+ -------
1334
+ dict
1335
+ weight fraction (equivalent to mole fraction) of H in each species relative to total H
1336
+ """
1331
1337
  # weight of H in each hydrogen-bearing species
1332
1338
  wtg = (float(comp["wt_g_wtpc"].iloc[0])) / 100.0
1333
1339
  wtm = 1.0 - wtg
@@ -1751,8 +1757,22 @@ def calc_pure_solubility(PT, melt_wf, models):
1751
1757
  return results
1752
1758
 
1753
1759
 
1754
- # WORK IN PROGRESS
1755
1760
  def calc_isotopes(PT, comp, R, models, nr_step, nr_tol, run=0.0):
1761
+ """Calculates the isotope ratio for all species and melt and vapor for H, S, and C
1762
+ for a single melt-vapor composition.
1763
+
1764
+ Args:
1765
+ PT (dict): Pressure in bars as "P" and temperature in 'C as "T"
1766
+ comp (pandas.DataFrame): Composition of the melt and vapor by species, including weight fraction of vapor.
1767
+ R (dict): Bulk isotope ratio of the system.
1768
+ models (pandas.DataFrame): Model options
1769
+ nr_step (float): Step-size for Newton-Raphson solver.
1770
+ nr_tol (float): Tolerance for Newton-Raphson solver.
1771
+ run (float, optional): Row number in file to run. Defaults to 0.0.
1772
+
1773
+ Returns:
1774
+ tuple(dict,dict,dict,dict,dict,dict): Isotope ratios for all species in S, C, and H. Isotope ratios for melt and vapor in S, C, and H.
1775
+ """
1756
1776
  comp_ = comp[run : run + 1] # noqa
1757
1777
  R_all_species_C, R_m_g_C = iso.i2s9("C", PT, comp_, R, models, nr_step, nr_tol)
1758
1778
  R_all_species_S, R_m_g_S = iso.i2s9("S", PT, comp_, R, models, nr_step, nr_tol)
@@ -17,10 +17,33 @@ import VolFe.model_dependent_variables as mdv
17
17
 
18
18
 
19
19
  def delta_standard(standard, isotope, element):
20
+ """
21
+ Get the isotopic ratio reference value for a standard for an element.
22
+
23
+
24
+ Parameters
25
+ ----------
26
+ standard: str
27
+ Standard material of interest: VCDT for S, VPDB for C, and VSMOW for H.
28
+
29
+ isotope: float
30
+ Minor isotope if interest: 34 for S, 13 for C, and 2 for H
31
+
32
+ element: str
33
+ Element of interest: S, C, or H.
34
+
35
+ Returns
36
+ -------
37
+ float
38
+ isotope ratio for reference material
39
+
40
+ """
20
41
  if element == "S":
21
42
  if standard == "VCDT":
22
43
  if isotope == 34:
23
- reference = 1 / 22.6436 # 34S/32S Ding et al. (2001)
44
+ reference = (
45
+ 1 / 22.6436
46
+ ) # 34S/32S Ding et al. (2001) GCA 65(15):2433–2437 https://doi.org/10.1016/S0016-7037(01)00611-1
24
47
  elif element == "C":
25
48
  if standard == "VPDB":
26
49
  if isotope == 13:
@@ -30,11 +53,37 @@ def delta_standard(standard, isotope, element):
30
53
  elif element == "H":
31
54
  if standard == "VSMOW":
32
55
  if isotope == 2:
33
- reference = 155.76 / 1.0e6 # 2H/1H Hagemann et al. (1970)
56
+ reference = (
57
+ 155.76 / 1.0e6
58
+ ) # 2H/1H Hagemann et al. (1970) Tellus 22(6):712–715 https://doi.org/10.1111/J.2153-3490.1970.TB00540.X
34
59
  return reference
35
60
 
36
61
 
37
62
  def ratio2delta(standard, isotope, element, ratio):
63
+ """
64
+ Convert isotope ratio to delta value.
65
+
66
+
67
+ Parameters
68
+ ----------
69
+ standard: str
70
+ Standard material of interest: VCDT for S, VPDB for C, and VSMOW for H.
71
+
72
+ isotope: float
73
+ Minor isotope if interest: 34 for S, 13 for C, and 2 for H
74
+
75
+ element: str
76
+ Element of interest: S, C, or H.
77
+
78
+ ratio: float
79
+ Value of isotope ratio.
80
+
81
+ Returns
82
+ -------
83
+ float
84
+ delta-value of isotope ratio
85
+
86
+ """
38
87
  reference = delta_standard(standard, isotope, element)
39
88
  if ratio == "":
40
89
  d = ""
@@ -44,12 +93,52 @@ def ratio2delta(standard, isotope, element, ratio):
44
93
 
45
94
 
46
95
  def delta2ratio(standard, isotope, element, d):
96
+ """
97
+ Convert delta value to isotope ratio.
98
+
99
+
100
+ Parameters
101
+ ----------
102
+ standard: str
103
+ Standard material of interest: VCDT for S, VPDB for C, and VSMOW for H.
104
+
105
+ isotope: float
106
+ Minor isotope if interest: 34 for S, 13 for C, and 2 for H
107
+
108
+ element: str
109
+ Element of interest: S, C, or H.
110
+
111
+ d: float
112
+ delta-value.
113
+
114
+ Returns
115
+ -------
116
+ float
117
+ isotope ratio of delta-value.
118
+
119
+ """
47
120
  reference = delta_standard(standard, isotope, element)
48
121
  ratio = ((d / 1000.0) * reference) + reference
49
122
  return ratio
50
123
 
51
124
 
52
125
  def alpha2Delta(a):
126
+ """
127
+ Convert alpha fractionation factor to cap-delta fractionation factor.
128
+
129
+
130
+ Parameters
131
+ ----------
132
+ isotope: float
133
+ alpha fractionation factor
134
+
135
+
136
+ Returns
137
+ -------
138
+ float
139
+ cap-delta fractionation factor
140
+
141
+ """
53
142
  D = 1000.0 * (1.0 - a)
54
143
  return D
55
144
 
@@ -60,6 +149,33 @@ def alpha2Delta(a):
60
149
 
61
150
 
62
151
  def alpha_gas_using_beta(element, A, B, PT, models): # using beta values
152
+ """
153
+ Calculate alpha fractionation factor from beta-factors.
154
+
155
+
156
+ Parameters
157
+ ----------
158
+ element: str
159
+ Element of interest: S, C, or H.
160
+
161
+ A: str
162
+ Nominator species.
163
+
164
+ B: str
165
+ Denominator species.
166
+
167
+ PT: dict
168
+ Pressure (bars) as "P" and temperature ('C) as "T".
169
+
170
+ models: pandas.DataFrame
171
+ Models options.
172
+
173
+ Returns
174
+ -------
175
+ float
176
+ alpha fractionation factor for A-B
177
+
178
+ """
63
179
  beta_A = mdv.beta_gas(PT, element, A, models) # gas species A
64
180
  beta_B = mdv.beta_gas(PT, element, B, models) # gas species B
65
181
  result = beta_A / beta_B
@@ -72,6 +188,30 @@ def alpha_gas_using_beta(element, A, B, PT, models): # using beta values
72
188
 
73
189
 
74
190
  def alphas_C(PT, comp, models):
191
+ """
192
+ Calculate consistant alpha fractionation factors for C-bearing species (i.e., all
193
+ relative to the same species). If vapor is present, the species is CO2(v), otherwise
194
+ it is CO2mol(m) or CO32-(m).
195
+
196
+
197
+ Parameters
198
+ ----------
199
+ PT: dict
200
+ Pressure (bars) as "P" and temperature ('C) as "T".
201
+
202
+ comp: pandas.DataFrame
203
+ Composition of the melt and vapor by species, including weight fraction of
204
+ vapor.
205
+
206
+ models: pandas.DataFrame
207
+ Models options.
208
+
209
+ Returns
210
+ -------
211
+ dict
212
+ alpha fractionation factor for all C-bearing species relative to one species
213
+
214
+ """
75
215
  if float(comp["wt_g_wtpc"].iloc[0]) > 0.0: # all alphas against CO2 in the vapor
76
216
  A = alpha_gas_using_beta("C", "CO", "CO2", PT, models) # CO(v)-CO2(v)
77
217
  B = alpha_gas_using_beta("C", "CH4", "CO2", PT, models) # CH4(v)-CO2(v)
@@ -123,6 +263,30 @@ def alphas_C(PT, comp, models):
123
263
 
124
264
 
125
265
  def alphas_H(PT, comp, models):
266
+ """
267
+ Calculate consistant alpha fractionation factors for H-bearing species (i.e., all
268
+ relative to the same species). If vapor is present, the species is H2O(v), otherwise
269
+ it is H2Omol(m) or OH-(m).
270
+
271
+
272
+ Parameters
273
+ ----------
274
+ PT: dict
275
+ Pressure (bars) as "P" and temperature ('C) as "T".
276
+
277
+ comp: pandas.DataFrame
278
+ Composition of the melt and vapor by species, including weight fraction of
279
+ vapor.
280
+
281
+ models: pandas.DataFrame
282
+ Models options.
283
+
284
+ Returns
285
+ -------
286
+ dict
287
+ alpha fractionation factor for all H-bearing species relative to one species
288
+
289
+ """
126
290
  if float(comp["wt_g_wtpc"].iloc[0]) > 0.0: # all alphas against H2O in the vapor
127
291
  A = alpha_gas_using_beta("H", "H2", "H2O", PT, models) # H2(v)
128
292
  B = alpha_gas_using_beta("H", "CH4", "H2O", PT, models) # CH4(v)
@@ -153,9 +317,9 @@ def alphas_H(PT, comp, models):
153
317
  A = mdv.alpha_H_H2Ov_H2Om(PT, comp, models) # H2Omol(m)
154
318
  B = c / mdv.alpha_H_H2Ov_OHmm(PT, comp, models) # OH-(m)
155
319
  H_species1, H_species2 = "OH-", "H2Omol"
156
- else: # all alphas against CO2mol in the melt
157
- A = mdv.alpha_C_CO2v_CO2m(PT, comp, models) # OH-(m)
158
- B = c / mdv.alpha_H_H2Ov_OHmm(PT, comp, models) # H2Omol(m)
320
+ else: # all alphas against OH- in the melt
321
+ A = mdv.alpha_H_H2Ov_OHmm(PT, comp, models) # OH-(m)
322
+ B = c / mdv.alpha_H_H2Ov_H2Om(PT, comp, models) # H2Omol(m)
159
323
  H_species1, H_species2 = "H2Omol", "OH-"
160
324
  C = (a * A) / mdv.alpha_H_H2v_H2m(PT, comp, models) # H2mol(m)
161
325
  D = (b * A) / mdv.alpha_H_CH4v_CH4m(PT, comp, models) # CH4mol(m)
@@ -179,6 +343,29 @@ def alphas_H(PT, comp, models):
179
343
 
180
344
 
181
345
  def alphas_S(PT, comp, models): # all alphas against S2-(m)
346
+ """
347
+ Calculate consistant alpha fractionation factors for S-bearing species (i.e., all
348
+ relative to the same species) against *S2-(m).
349
+
350
+
351
+ Parameters
352
+ ----------
353
+ PT: dict
354
+ Pressure (bars) as "P" and temperature ('C) as "T".
355
+
356
+ comp: pandas.DataFrame
357
+ Composition of the melt and vapor by species, including weight fraction of
358
+ vapor.
359
+
360
+ models: pandas.DataFrame
361
+ Models options.
362
+
363
+ Returns
364
+ -------
365
+ dict
366
+ alpha fractionation factor for all S-bearing species relative to *S2-
367
+
368
+ """
182
369
  C = mdv.alpha_S_H2Sv_S2mm(PT, comp, models) # H2S(v)
183
370
  A = C * alpha_gas_using_beta("S", "S2", "H2S", PT, models) # S2(v)
184
371
  B = C * alpha_gas_using_beta("S", "OCS", "H2S", PT, models) # OCS(v)
@@ -211,14 +398,16 @@ def simple_isotope_fractionation(D, db):
211
398
  Parameters
212
399
  ----------
213
400
  D: float
214
- Float of cap-delta Fractionation factor between vapor and melt in per mil.
401
+ Cap-delta Fractionation factor between vapor and melt in per mil.
215
402
 
216
403
  db: float
217
- Float initial little-delta isotope value of bulk system in per mil.
404
+ Initial little-delta isotope value of bulk system in per mil.
405
+
218
406
 
219
407
  Returns
220
408
  -------
221
- Dataframe.
409
+ pandas.DataFrame
410
+ Isotopic composition of melt and vapor during closed- and open-system degassing
222
411
 
223
412
  """
224
413
  for n in range(0, 1000, 1):
@@ -252,6 +441,21 @@ def simple_isotope_fractionation(D, db):
252
441
 
253
442
 
254
443
  def newton_raphson(x0, constants, e1, step, eqs, deriv, maxiter=100):
444
+ """Newton-Raphson solver.
445
+
446
+ Args:
447
+ x0 (float): Initial guess
448
+ constants (list): Constants required to evaluate equations
449
+ e1 (float): Tolerance for solver
450
+ step (float): Step-size for solver
451
+ eqs (func): Equations to solve
452
+ deriv (func): Differentials of equations to solve
453
+ maxiter (int, optional): Maximum number of iterations to try. Defaults to 100.
454
+
455
+ Returns:
456
+ float: Solution
457
+ """
458
+
255
459
  def dx(x, eqs):
256
460
  f_ = eqs(x, constants)
257
461
  result = abs(0 - f_)
@@ -291,6 +495,18 @@ def newton_raphson(x0, constants, e1, step, eqs, deriv, maxiter=100):
291
495
 
292
496
 
293
497
  def allocate_species(element, comp, alphas, species_distribution):
498
+ """Specifies species order for subsequent calculations.
499
+
500
+ Args:
501
+ element (str): Element of interest: H, S, or C.
502
+ comp (pandas.DataFrame): Composition of the melt and vapor by species, including weight fraction of vapor.
503
+ alphas (dict): Consistent alpha fractionation factors.
504
+ species_distribution (dict): Fraction of element in each species.
505
+
506
+ Returns:
507
+ tuple(dict,dict): Dictionary of alphas and species distribution in correct
508
+ order.
509
+ """
294
510
  if element == "S":
295
511
  species = "S2-"
296
512
  T_a = species_distribution[species]
@@ -402,6 +618,16 @@ def allocate_species(element, comp, alphas, species_distribution):
402
618
 
403
619
 
404
620
  def rename_output(element, input, comp):
621
+ """Renames generic output with species names.
622
+
623
+ Args:
624
+ element (str): Element of interest: H, S, or C.
625
+ input (dict): Dictionary of interest with generic names.
626
+ comp (pandas.DataFrame): Composition of the melt and vapor by species, including weight fraction of vapor.
627
+
628
+ Returns:
629
+ dict: Species names instead of generic names.
630
+ """
405
631
  output = {}
406
632
  if element == "S":
407
633
  output["m_S2-"] = input["A"]
@@ -455,6 +681,21 @@ def rename_output(element, input, comp):
455
681
 
456
682
 
457
683
  def i2s9(element, PT, comp, R, models, nr_step, nr_tol):
684
+ """Calculate the isotope ratios of up to nine species with two isotopes.
685
+
686
+ Args:
687
+ element (str): Element of interest: H, S, or C.
688
+ PT (dict): Pressure (bars) as "P" and temperature ('C) as "T".
689
+ comp (pandas.DataFrame): Composition of the melt and vapor by species, including weight fraction of vapor.
690
+ R (dict): Bulk isotope ratio of the system.
691
+ models (dict): Model options.
692
+ nr_step (float): Step-size for Newton-Raphson solver.
693
+ nr_tol (float): Tolerance for Newton-Raphson solver.
694
+
695
+ Returns:
696
+ tuple(dict,dict): Isotope ratio of each species. Average isotope ratio of melt
697
+ and vapor.
698
+ """
458
699
  comp.reset_index(drop=True, inplace=True)
459
700
  if element == "S":
460
701
  if comp.loc[0, "ST_ppmw"] == 0.0:
@@ -673,6 +914,16 @@ def i2s9(element, PT, comp, R, models, nr_step, nr_tol):
673
914
 
674
915
 
675
916
  def av_m_g(element, ratio, constants):
917
+ """Melt and vapor isotope ratio based on isotope ratio of species within them.
918
+
919
+ Args:
920
+ element (str): Element of interest: H, C, or S.
921
+ ratio (dict): Isotope ratios of all species
922
+ constants (tuple(dict,dict,float)): Consistent alpha fractionation factors. Fraction of element in each species. Bulk isotope ratio.
923
+
924
+ Returns:
925
+ dict: Melt and vapor isotope ratio.
926
+ """
676
927
  alphas, species_distribution, R_i = constants
677
928
 
678
929
  # heavy/total isotope ratio
@@ -769,6 +1020,16 @@ def av_m_g(element, ratio, constants):
769
1020
 
770
1021
 
771
1022
  def iso_initial_guesses(element, R, comp):
1023
+ """Initial guess for Newton-Raphson solver.
1024
+
1025
+ Args:
1026
+ element (str): Element of interest: S, C, or H.
1027
+ R (dict): Isotope ratio of bulk system.
1028
+ comp (pandas.DataFrame): Composition of the melt and vapor by species, including weight fraction of vapor.
1029
+
1030
+ Returns:
1031
+ float: Initial guess for Newton-Raphson solver.
1032
+ """
772
1033
  if element == "S":
773
1034
  species_distribution = c.mf_S_species(comp)
774
1035
  R_i = R["S"]
@@ -111,9 +111,9 @@ default_models = [
111
111
  ["alpha_H_H2Sv_H2Sm", "no fractionation"],
112
112
  ["alpha_C_CH4v_CH4m", "no fractionation"],
113
113
  ["alpha_C_COv_COm", "no fractionation"],
114
- ["alpha_C_CO2v_CO2T", "LeePP"],
114
+ ["alpha_C_CO2v_CO2T", "Lee24"],
115
115
  ["alpha_C_CO2v_CO2m", "Blank93"],
116
- ["alpha_C_CO2v_CO32mm", "LeePP"],
116
+ ["alpha_C_CO2v_CO32mm", "Lee24"],
117
117
  ["alpha_S_H2Sv_H2Sm", "no fractionation"],
118
118
  ["alpha_SO2_SO4", "Fiege15"],
119
119
  ["alpha_H2S_S", "Fiege15"],
@@ -5778,7 +5778,37 @@ species = species.set_index("species")
5778
5778
 
5779
5779
 
5780
5780
  def beta_gas(PT, element, species, models): # beta factors
5781
- # from Richet et al. (1977)fitted to quadratic equation for 600 < T'C < 1300
5781
+ """
5782
+ Beta isotopic fractionation factors between vapor species containing 32S/34S, 13C/12C, and D/H.
5783
+
5784
+
5785
+ Parameters
5786
+ ----------
5787
+ PT: dict
5788
+ Pressure (bars) as "P" and temperature ('C) as "T".
5789
+
5790
+ element: str
5791
+ Element of interest (H, C, or S).
5792
+
5793
+ species: str
5794
+ Vapor species of interest (H2O, H2, CH4, H2S, CO2, CO, OCS, SO2, S2).
5795
+
5796
+ models: pandas.DataFrame
5797
+ Minimum requirement is index of "beta_factors" and column label of "option".
5798
+
5799
+ Returns
5800
+ -------
5801
+ float
5802
+ Beta factor for element in species of interest
5803
+
5804
+
5805
+ Model options for 'beta_factors'
5806
+ -------------
5807
+ - 'Richet77' [default] Quadratic fits to data in Tables 9, 10, and 13 between 600 < T'C < 1300 of Richet et al. (1977) Ann. Rev. Earth Planet. Sci. 5:65-110 as detailed in Saper et al. (in prep).
5808
+ Only one option available currently, included for future development.
5809
+
5810
+ """
5811
+ # from Richet et al. (1977) fitted to quadratic equation for 600 < T'C < 1300
5782
5812
  if models.loc["beta_factors", "option"] == "Richet77":
5783
5813
  t = 1.0 / (PT["T"] + 273.15)
5784
5814
  if element == "S":
@@ -5818,6 +5848,35 @@ def beta_gas(PT, element, species, models): # beta factors
5818
5848
 
5819
5849
 
5820
5850
  def alpha_S_H2Sv_S2mm(PT, comp, models): # alpha for 32/34S between H2S(v) and S2-(m)
5851
+ """
5852
+ Alpha fractionation factor for 32S/34S (R) between H2S(v) and *S2-(m): a = R[H2S(m)]/R[S2-(m)].
5853
+
5854
+
5855
+ Parameters
5856
+ ----------
5857
+ PT: dict
5858
+ Pressure (bars) as "P" and temperature ('C) as "T".
5859
+
5860
+ comp: dict
5861
+ Melt composition (SiO2, TiO2, etc.), not normally used unless model option
5862
+ requires melt composition.
5863
+
5864
+ models: pandas.DataFrame
5865
+ Minimum requirement is index of "alpha_H2S_S" and column label of "option".
5866
+
5867
+ Returns
5868
+ -------
5869
+ float
5870
+ alpha fractionation factor
5871
+
5872
+
5873
+ Model options for "alpha_H2S_S"
5874
+ -------------
5875
+ - 'Fiege15' [default] Eq. (8) from Fiege et al. (2015) Chem. Geol. 393:36-54 https://doi.org/10.1016/j.chemgeo.2014.11.012
5876
+ - 'no fractionation' Treat as no isotopic fractionation between these species
5877
+
5878
+ """
5879
+
5821
5880
  model = models.loc["alpha_H2S_S", "option"]
5822
5881
  if model == "Fiege15": # Fiege et al. (2015) Chemical Geology eq. 8
5823
5882
  T_K = PT["T"] + 273.15
@@ -5832,6 +5891,35 @@ def alpha_S_H2Sv_S2mm(PT, comp, models): # alpha for 32/34S between H2S(v) and
5832
5891
 
5833
5892
 
5834
5893
  def alpha_S_SO2v_S6pm(PT, comp, models): # alpha for 32/34S between SO2(v) and S6+(m)
5894
+ """
5895
+ Alpha fractionation factor for 32S/34S (R) between SO2(v) and S6+(m): a = R[SO2(v)]/R[S6+(m)].
5896
+
5897
+
5898
+ Parameters
5899
+ ----------
5900
+ PT: dict
5901
+ Pressure (bars) as "P" and temperature ('C) as "T".
5902
+
5903
+ comp: dict
5904
+ Melt composition (SiO2, TiO2, etc.), not normally used unless model option
5905
+ requires melt composition.
5906
+
5907
+ models: pandas.DataFrame
5908
+ Minimum requirement is index of "alpha_SO2_SO4" and column label of "option".
5909
+
5910
+ Returns
5911
+ -------
5912
+ float
5913
+ alpha fractionation factor
5914
+
5915
+
5916
+ Model options for "alpha_SO2_SO4"
5917
+ -------------
5918
+ - 'Fiege15' [default] Eq. (9) from Fiege et al. (2015) Chem. Geol. 393:36-54 https://doi.org/10.1016/j.chemgeo.2014.11.012
5919
+ - 'no fractionation' Treat as no isotopic fractionation between these species
5920
+
5921
+ """
5922
+
5835
5923
  model = models.loc["alpha_SO2_SO4", "option"]
5836
5924
  if model == "Fiege15": # Fiege et al. (2015) Chemical Geology eq. 9
5837
5925
  T_K = PT["T"] + 273.15
@@ -5851,6 +5939,35 @@ def alpha_S_SO2v_S6pm(PT, comp, models): # alpha for 32/34S between SO2(v) and
5851
5939
 
5852
5940
 
5853
5941
  def alpha_S_H2Sv_H2Sm(PT, comp, models): # alpha for 32/34S between H2S(v) and H2S(m)
5942
+ """
5943
+ Alpha fractionation factor for 32S/34S (R) between H2S(v) and H2S(m): a = R[H2S(v)]/R[H2S(m)].
5944
+
5945
+
5946
+ Parameters
5947
+ ----------
5948
+ PT: dict
5949
+ Pressure (bars) as "P" and temperature ('C) as "T".
5950
+
5951
+ comp: dict
5952
+ Melt composition (SiO2, TiO2, etc.), not normally used unless model option
5953
+ requires melt composition.
5954
+
5955
+ models: pandas.DataFrame
5956
+ Minimum requirement is index of "alpha_S_H2Sv_H2Sm" and column label of "option".
5957
+
5958
+ Returns
5959
+ -------
5960
+ float
5961
+ alpha fractionation factor
5962
+
5963
+
5964
+ Model options for "alpha_S_H2Sv_H2Sm"
5965
+ -------------
5966
+ - 'no fractionation' Treat as no isotopic fractionation between these species
5967
+ Only one option available currently, included for future development.
5968
+
5969
+ """
5970
+
5854
5971
  model = models.loc["alpha_S_H2Sv_H2Sm", "option"]
5855
5972
  if model == "no fractionation": #
5856
5973
  a = 1.0
@@ -5865,8 +5982,37 @@ def alpha_S_H2Sv_H2Sm(PT, comp, models): # alpha for 32/34S between H2S(v) and
5865
5982
  def alpha_C_CO2v_CO32mm(
5866
5983
  PT, comp, models
5867
5984
  ): # alpha for 13/12C between CO2(v) and CO32-(m)
5985
+ """
5986
+ Alpha fractionation factor for 13C/12C (R) between CO2(v) and CO32-(m): a = R[CO2(v)]/R[CO32-(m)].
5987
+
5988
+
5989
+ Parameters
5990
+ ----------
5991
+ PT: dict
5992
+ Pressure (bars) as "P" and temperature ('C) as "T".
5993
+
5994
+ comp: dict
5995
+ Melt composition (SiO2, TiO2, etc.), not normally used unless model option
5996
+ requires melt composition.
5997
+
5998
+ models: pandas.DataFrame
5999
+ Minimum requirement is index of "alpha_C_CO2v_CO32mm" and column label of "option".
6000
+
6001
+ Returns
6002
+ -------
6003
+ float
6004
+ alpha fractionation factor
6005
+
6006
+
6007
+ Model options for "alpha_C_CO2v_CO32mm"
6008
+ -------------
6009
+ - 'Lee24' [default] Lee et al. (2024) GCA 380:208-219 https://doi.org/10.1016/j.gca.2024.07.015
6010
+ - 'no fractionation' Treat as no isotopic fractionation between these species
6011
+
6012
+ """
6013
+
5868
6014
  model = models.loc["alpha_C_CO2v_CO32mm", "option"]
5869
- if model == "LeePP":
6015
+ if model == "Lee24":
5870
6016
  a = math.exp(2.9 / 1000.0)
5871
6017
  elif model == "no fractionation":
5872
6018
  a = 1.0
@@ -5876,6 +6022,35 @@ def alpha_C_CO2v_CO32mm(
5876
6022
  def alpha_C_CO2v_CO2m(
5877
6023
  PT, comp, models
5878
6024
  ): # alpha for 13/12C between CO2(v) and CO2mol(m)
6025
+ """
6026
+ Alpha fractionation factor for 13C/12C (R) between CO2(v) and CO2(m): a = R[CO2(v)]/R[CO2(m)].
6027
+
6028
+
6029
+ Parameters
6030
+ ----------
6031
+ PT: dict
6032
+ Pressure (bars) as "P" and temperature ('C) as "T".
6033
+
6034
+ comp: dict
6035
+ Melt composition (SiO2, TiO2, etc.), not normally used unless model option
6036
+ requires melt composition.
6037
+
6038
+ models: pandas.DataFrame
6039
+ Minimum requirement is index of "alpha_C_CO2v_CO2m" and column label of "option".
6040
+
6041
+ Returns
6042
+ -------
6043
+ float
6044
+ alpha fractionation factor
6045
+
6046
+
6047
+ Model options for "alpha_C_CO2v_CO2m"
6048
+ -------------
6049
+ - 'Blank93' [default] Blank & Stolper (1993) EOS Trans Am Geophys Union 74:347-8
6050
+ - 'no fractionation' Treat as no isotopic fractionation between these species
6051
+
6052
+ """
6053
+
5879
6054
  model = models.loc["alpha_C_CO2v_CO2m", "option"]
5880
6055
  if model == "Blank93":
5881
6056
  a = 1.0
@@ -5884,6 +6059,7 @@ def alpha_C_CO2v_CO2m(
5884
6059
  return a
5885
6060
 
5886
6061
 
6062
+ # WORK IN PROGRESS
5887
6063
  def alpha_C_CO2v_CO2Tm(PT, comp, models): # alpha for 13/12C between CO2(v) and CO2T(m)
5888
6064
  model = models.loc["alpha_C_CO2v_CO2T", "option"]
5889
6065
  if model == "LeePP":
@@ -5894,6 +6070,35 @@ def alpha_C_CO2v_CO2Tm(PT, comp, models): # alpha for 13/12C between CO2(v) and
5894
6070
 
5895
6071
 
5896
6072
  def alpha_C_COv_COm(PT, comp, models): # alpha for 13/12C between CO(v) and COmol(m)
6073
+ """
6074
+ Alpha fractionation factor for 13C/12C (R) between CO(v) and COmol(m): a = R[CO(v)]/R[COmol(m)].
6075
+
6076
+
6077
+ Parameters
6078
+ ----------
6079
+ PT: dict
6080
+ Pressure (bars) as "P" and temperature ('C) as "T".
6081
+
6082
+ comp: dict
6083
+ Melt composition (SiO2, TiO2, etc.), not normally used unless model option
6084
+ requires melt composition.
6085
+
6086
+ models: pandas.DataFrame
6087
+ Minimum requirement is index of "alpha_C_COv_COm" and column label of "option".
6088
+
6089
+ Returns
6090
+ -------
6091
+ float
6092
+ alpha fractionation factor
6093
+
6094
+
6095
+ Model options for "alpha_C_COv_COm"
6096
+ -------------
6097
+ - 'no fractionation' Treat as no isotopic fractionation between these species
6098
+ Only one option available currently, included for future development.
6099
+
6100
+ """
6101
+
5897
6102
  model = models.loc["alpha_C_COv_COm", "option"]
5898
6103
  if model == "no fractionation":
5899
6104
  a = 1.0
@@ -5903,6 +6108,35 @@ def alpha_C_COv_COm(PT, comp, models): # alpha for 13/12C between CO(v) and COm
5903
6108
  def alpha_C_CH4v_CH4m(
5904
6109
  PT, comp, models
5905
6110
  ): # alpha for 13/12C between CH4(v) and CH4mol(m)
6111
+ """
6112
+ Alpha fractionation factor for 13C/12C (R) between CH4(v) and CH4mol(m): a = R[CH4(v)]/R[CH4mol(m)].
6113
+
6114
+
6115
+ Parameters
6116
+ ----------
6117
+ PT: dict
6118
+ Pressure (bars) as "P" and temperature ('C) as "T".
6119
+
6120
+ comp: dict
6121
+ Melt composition (SiO2, TiO2, etc.), not normally used unless model option
6122
+ requires melt composition.
6123
+
6124
+ models: pandas.DataFrame
6125
+ Minimum requirement is index of "alpha_C_CH4v_CH4m" and column label of "option".
6126
+
6127
+ Returns
6128
+ -------
6129
+ float
6130
+ alpha fractionation factor
6131
+
6132
+
6133
+ Model options for "alpha_C_CH4v_CH4m"
6134
+ -------------
6135
+ - 'no fractionation' Treat as no isotopic fractionation between these species
6136
+ Only one option available currently, included for future development.
6137
+
6138
+ """
6139
+
5906
6140
  model = models.loc["alpha_C_CH4v_CH4m", "option"]
5907
6141
  if model == "no fractionation":
5908
6142
  a = 1.0
@@ -5915,6 +6149,35 @@ def alpha_C_CH4v_CH4m(
5915
6149
 
5916
6150
 
5917
6151
  def alpha_H_H2Ov_H2Om(PT, comp, models):
6152
+ """
6153
+ Alpha fractionation factor for D/H (R) between H2O(v) and H2Omol(m): a = R[H2O(v)]/R[H2Omol(m)].
6154
+
6155
+
6156
+ Parameters
6157
+ ----------
6158
+ PT: dict
6159
+ Pressure (bars) as "P" and temperature ('C) as "T".
6160
+
6161
+ comp: dict
6162
+ Melt composition (SiO2, TiO2, etc.), not normally used unless model option
6163
+ requires melt composition.
6164
+
6165
+ models: pandas.DataFrame
6166
+ Minimum requirement is index of "alpha_H_H2Ov_H2Om" and column label of "option".
6167
+
6168
+ Returns
6169
+ -------
6170
+ float
6171
+ alpha fractionation factor
6172
+
6173
+
6174
+ Model options for "alpha_H_H2Ov_H2Om"
6175
+ -------------
6176
+ - 'Rust04' [default] Rust et al. (2004) Geology 32(4) 349-352 https://doi.org/10.1130/G20388.2
6177
+ - 'no fractionation' Treat as no isotopic fractionation between these species
6178
+
6179
+ """
6180
+
5918
6181
  model = models.loc["alpha_H_H2Ov_H2Om", "option"]
5919
6182
  if model == "no fractionation":
5920
6183
  a = 1.0
@@ -5924,6 +6187,35 @@ def alpha_H_H2Ov_H2Om(PT, comp, models):
5924
6187
 
5925
6188
 
5926
6189
  def alpha_H_H2Ov_OHmm(PT, comp, models):
6190
+ """
6191
+ Alpha fractionation factor for D/H (R) between H2O(v) and OH-(m): a = R[H2O(v)]/R[OH-(m)].
6192
+
6193
+
6194
+ Parameters
6195
+ ----------
6196
+ PT: dict
6197
+ Pressure (bars) as "P" and temperature ('C) as "T".
6198
+
6199
+ comp: dict
6200
+ Melt composition (SiO2, TiO2, etc.), not normally used unless model option
6201
+ requires melt composition.
6202
+
6203
+ models: pandas.DataFrame
6204
+ Minimum requirement is index of "alpha_H_H2Ov_OHmm" and column label of "option".
6205
+
6206
+ Returns
6207
+ -------
6208
+ float
6209
+ alpha fractionation factor
6210
+
6211
+
6212
+ Model options for "alpha_H_H2Ov_OHmm"
6213
+ -------------
6214
+ - 'Rust04' [default] Rust et al. (2004) Geology 32(4) 349-352 https://doi.org/10.1130/G20388.2
6215
+ - 'no fractionation' Treat as no isotopic fractionation between these species
6216
+
6217
+ """
6218
+
5927
6219
  model = models.loc["alpha_H_H2Ov_OHmm", "option"]
5928
6220
  if model == "no fractionation":
5929
6221
  a = 1.0
@@ -5933,6 +6225,35 @@ def alpha_H_H2Ov_OHmm(PT, comp, models):
5933
6225
 
5934
6226
 
5935
6227
  def alpha_H_H2v_H2m(PT, comp, models): # alpha for D/H between H2(v) and H2(m)
6228
+ """
6229
+ Alpha fractionation factor for 13C/12C (R) between H2(v) and H2mol(m): a = R[H2(v)]/R[H2mol(m)].
6230
+
6231
+
6232
+ Parameters
6233
+ ----------
6234
+ PT: dict
6235
+ Pressure (bars) as "P" and temperature ('C) as "T".
6236
+
6237
+ comp: dict
6238
+ Melt composition (SiO2, TiO2, etc.), not normally used unless model option
6239
+ requires melt composition.
6240
+
6241
+ models: pandas.DataFrame
6242
+ Minimum requirement is index of "alpha_H_H2v_H2m" and column label of "option".
6243
+
6244
+ Returns
6245
+ -------
6246
+ float
6247
+ alpha fractionation factor
6248
+
6249
+
6250
+ Model options for "alpha_H_H2v_H2m"
6251
+ -------------
6252
+ - 'no fractionation' Treat as no isotopic fractionation between these species
6253
+ Only one option available currently, included for future development.
6254
+
6255
+ """
6256
+
5936
6257
  model = models.loc["alpha_H_H2v_H2m", "option"]
5937
6258
  if model == "no fractionation":
5938
6259
  a = 1.0
@@ -5940,6 +6261,35 @@ def alpha_H_H2v_H2m(PT, comp, models): # alpha for D/H between H2(v) and H2(m)
5940
6261
 
5941
6262
 
5942
6263
  def alpha_H_CH4v_CH4m(PT, comp, models): # alpha for D/H between CH4(v) and CH4(m)
6264
+ """
6265
+ Alpha fractionation factor for 13C/12C (R) between CH4(v) and CH4mol(m): a = R[CH4(v)]/R[CH4mol(m)].
6266
+
6267
+
6268
+ Parameters
6269
+ ----------
6270
+ PT: dict
6271
+ Pressure (bars) as "P" and temperature ('C) as "T".
6272
+
6273
+ comp: dict
6274
+ Melt composition (SiO2, TiO2, etc.), not normally used unless model option
6275
+ requires melt composition.
6276
+
6277
+ models: pandas.DataFrame
6278
+ Minimum requirement is index of "alpha_H_CH4v_CH4m" and column label of "option".
6279
+
6280
+ Returns
6281
+ -------
6282
+ float
6283
+ alpha fractionation factor
6284
+
6285
+
6286
+ Model options for "alpha_H_CH4v_CH4m"
6287
+ -------------
6288
+ - 'no fractionation' Treat as no isotopic fractionation between these species
6289
+ Only one option available currently, included for future development.
6290
+
6291
+ """
6292
+
5943
6293
  model = models.loc["alpha_H_CH4v_CH4m", "option"]
5944
6294
  if model == "no fractionation":
5945
6295
  a = 1.0
@@ -5947,6 +6297,34 @@ def alpha_H_CH4v_CH4m(PT, comp, models): # alpha for D/H between CH4(v) and CH4
5947
6297
 
5948
6298
 
5949
6299
  def alpha_H_H2Sv_H2Sm(PT, comp, models): # alpha for D/H between H2S(v) and H2S(m)
6300
+ """
6301
+ Alpha fractionation factor for 13C/12C (R) between H2S(v) and H2Smol(m): a = R[H2S(v)]/R[H2Smol(m)].
6302
+
6303
+
6304
+ Parameters
6305
+ ----------
6306
+ PT: dict
6307
+ Pressure (bars) as "P" and temperature ('C) as "T".
6308
+
6309
+ comp: dict
6310
+ Melt composition (SiO2, TiO2, etc.), not normally used unless model option
6311
+ requires melt composition.
6312
+
6313
+ models: pandas.DataFrame
6314
+ Minimum requirement is index of "alpha_H_H2Sv_H2Sm" and column label of "option".
6315
+
6316
+ Returns
6317
+ -------
6318
+ float
6319
+ alpha fractionation factor
6320
+
6321
+
6322
+ Model options for "alpha_H_H2Sv_H2Sm"
6323
+ -------------
6324
+ - 'no fractionation' Treat as no isotopic fractionation between these species
6325
+ Only one option available currently, included for future development.
6326
+
6327
+ """
5950
6328
  model = models.loc["alpha_H_H2Sv_H2Sm", "option"]
5951
6329
  if model == "no fractionation": #
5952
6330
  a = 1.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: VolFe
3
- Version: 0.4.2
3
+ Version: 1.0
4
4
  Summary: VolFe
5
5
  Author: Pip Liggins, Penny Wieser
6
6
  Author-email: Ery Hughes <ery.c.hughes@gmail.com>
@@ -38,7 +38,7 @@ Welcome to VolFe! an open-source framework for calculating melt-vapour equilibri
38
38
  [![Documentation Status](https://readthedocs.org/projects/VolFe/badge/?version=latest)](https://VolFe.readthedocs.io/en/latest/?badge=latest)
39
39
 
40
40
  Read more about the python package in the Earth ArXiv pre-print (and please cite if you use the package!):
41
- Hughes, E.C., Liggins, P., Wieser, P. and Stolper, E.M., 2024. VolFe: an open-source tool for calculating melt-vapor equilibria including silicate melt, carbon, hydrogen, sulfur, and noble gases. https://doi.org/10.31223/X52X3G
41
+ Hughes, E.C., Liggins, P., Wieser, P. and Stolper, E.M., 2024. VolFe: an open-source Python package for calculating melt-vapor equilibria including silicate melt, carbon, hydrogen, sulfur, and noble gases. https://doi.org/10.31223/X52X3G
42
42
 
43
43
  For more information and worked examples, see the ReadTheDocs page:
44
44
  https://volfe.readthedocs.io/en/latest/
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes