diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4931f60b1..1898345ab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - python-versions: ['3.11'] + python-versions: ['3.12'] steps: - uses: actions/checkout@v2 @@ -38,7 +38,7 @@ jobs: strategy: matrix: - python-versions: ['3.8', '3.9', '3.10', '3.11'] + python-versions: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v2 diff --git a/burnman/eos/aa.py b/burnman/eos/aa.py index aedba4314..e97a9db76 100644 --- a/burnman/eos/aa.py +++ b/burnman/eos/aa.py @@ -20,24 +20,24 @@ class AA(eos.EquationOfState): which gives volume as a function of pressure, coupled with the thermodynamic identity: - :math:`-\partial E/ \partial V |_S = P`. + :math:`-\\partial E/ \\partial V |_S = P`. The temperature along the isentrope is calculated via - :math:`\partial (\ln T)/\partial (\ln \\rho) |_S = \gamma` + :math:`\\partial (\\ln T)/\\partial (\\ln \\rho) |_S = \\gamma` which gives: - :math:`T_S/T_0 = \exp(\int( \gamma/\\rho ) d \\rho)` + :math:`T_S/T_0 = \\exp(\\int( \\gamma/\\rho ) d \\rho)` The thermal effect on internal energy is calculated at constant volume using expressions for the kinetic, electronic and potential contributions to the volumetric heat capacity, which can then be integrated with respect to temperature: - :math:`\partial E/\partial T |_V = C_V` + :math:`\\partial E/\\partial T |_V = C_V` - :math:`\partial E/\partial S |_V = T` + :math:`\\partial E/\\partial S |_V = T` We note that :cite:`AA1994` also include a detailed description of the Gruneisen parameter as a function of volume and energy (Equation 15), @@ -50,16 +50,16 @@ class AA(eos.EquationOfState): 1) As energy and entropy are defined by the equation of state at any temperature and volume, pressure can be found by via the expression: - :math:`\partial E/\partial V |_S = P` + :math:`\\partial E/\\partial V |_S = P` 2) The Grueneisen parameter can now be determined as - :math:`\gamma = V \partial P/\partial E |_V` + :math:`\\gamma = V \\partial P/\\partial E |_V` To reiterate: away from the reference isentrope, the Grueneisen parameter calculated using these expressions is *not* equal to the (thermodynamically inconsistent) analytical expression given by :cite:`AA1994`. - A final note: the expression for :math:`\Lambda` (Equation 17). + A final note: the expression for :math:`\\Lambda` (Equation 17). does not reproduce Figure 5. We assume here that the figure matches the model actually used by :cite:`AA1994`, which has the form: :math:`F(-325.23 + 302.07 (\\rho/\\rho_0) + 30.45 (\\rho/\\rho_0)^{0.4})`. @@ -249,7 +249,7 @@ def pressure(self, temperature, volume, params): E1 = self._isentropic_energy_change(volume, params) - params['E_0'] E2 = E1 + dE - # Integrate at constant volume (V \int dP = \int gr dE) + # Integrate at constant volume (V \\int dP = \\int gr dE) dP = (params['grueneisen_0']*(E2 - E1) + (0.5*params['grueneisen_prime'] * np.power(params['V_0']/volume, params['grueneisen_n']) * diff --git a/burnman/eos/birch_murnaghan.py b/burnman/eos/birch_murnaghan.py index 14f2758a8..269f3ac7b 100644 --- a/burnman/eos/birch_murnaghan.py +++ b/burnman/eos/birch_murnaghan.py @@ -153,13 +153,13 @@ def shear_modulus(self, pressure, temperature, volume, params): def entropy(self, pressure, temperature, volume, params): """ - Returns the molar entropy :math:`\mathcal{S}` of the mineral. :math:`[J/K/mol]` + Returns the molar entropy :math:`\\mathcal{S}` of the mineral. :math:`[J/K/mol]` """ return 0.0 def molar_internal_energy(self, pressure, temperature, volume, params): """ - Returns the internal energy :math:`\mathcal{E}` of the mineral. :math:`[J/mol]` + Returns the internal energy :math:`\\mathcal{E}` of the mineral. :math:`[J/mol]` """ x = np.power(volume / params["V_0"], -1.0 / 3.0) x2 = x * x @@ -184,7 +184,7 @@ def molar_internal_energy(self, pressure, temperature, volume, params): def gibbs_free_energy(self, pressure, temperature, volume, params): """ - Returns the Gibbs free energy :math:`\mathcal{G}` of the mineral. :math:`[J/mol]` + Returns the Gibbs free energy :math:`\\mathcal{G}` of the mineral. :math:`[J/mol]` """ # G = int VdP = [PV] - int PdV = E + PV diff --git a/burnman/eos/birch_murnaghan_4th.py b/burnman/eos/birch_murnaghan_4th.py index 3d04aab7d..db4c75fd7 100644 --- a/burnman/eos/birch_murnaghan_4th.py +++ b/burnman/eos/birch_murnaghan_4th.py @@ -116,13 +116,13 @@ def shear_modulus(self, pressure, temperature, volume, params): def entropy(self, pressure, temperature, volume, params): """ - Returns the molar entropy :math:`\mathcal{S}` of the mineral. :math:`[J/K/mol]` + Returns the molar entropy :math:`\\mathcal{S}` of the mineral. :math:`[J/K/mol]` """ return 0.0 def molar_internal_energy(self, pressure, temperature, volume, params): """ - Returns the internal energy :math:`\mathcal{E}` of the mineral. :math:`[J/mol]` + Returns the internal energy :math:`\\mathcal{E}` of the mineral. :math:`[J/mol]` """ x = np.power(volume / params["V_0"], -1.0 / 3.0) x2 = x * x @@ -157,7 +157,7 @@ def molar_internal_energy(self, pressure, temperature, volume, params): def gibbs_free_energy(self, pressure, temperature, volume, params): """ - Returns the Gibbs free energy :math:`\mathcal{G}` of the mineral. :math:`[J/mol]` + Returns the Gibbs free energy :math:`\\mathcal{G}` of the mineral. :math:`[J/mol]` """ # G = int VdP = [PV] - int PdV = E + PV diff --git a/burnman/eos/modified_tait.py b/burnman/eos/modified_tait.py index b5290fbe9..153a06642 100644 --- a/burnman/eos/modified_tait.py +++ b/burnman/eos/modified_tait.py @@ -137,13 +137,13 @@ def shear_modulus(self, pressure, temperature, volume, params): def entropy(self, pressure, temperature, volume, params): """ - Returns the molar entropy :math:`\mathcal{S}` of the mineral. :math:`[J/K/mol]` + Returns the molar entropy :math:`\\mathcal{S}` of the mineral. :math:`[J/K/mol]` """ return 0.0 def molar_internal_energy(self, pressure, temperature, volume, params): """ - Returns the internal energy :math:`\mathcal{E}` of the mineral. :math:`[J/mol]` + Returns the internal energy :math:`\\mathcal{E}` of the mineral. :math:`[J/mol]` """ return ( @@ -153,7 +153,7 @@ def molar_internal_energy(self, pressure, temperature, volume, params): def gibbs_free_energy(self, pressure, temperature, volume, params): """ - Returns the Gibbs free energy :math:`\mathcal{G}` of the mineral. :math:`[J/mol]` + Returns the Gibbs free energy :math:`\\mathcal{G}` of the mineral. :math:`[J/mol]` """ # G = int VdP = [PV] - int PdV = E + PV a, b, c = tait_constants(params) diff --git a/burnman/eos/morse_potential.py b/burnman/eos/morse_potential.py index e80b865b1..0918ec09b 100644 --- a/burnman/eos/morse_potential.py +++ b/burnman/eos/morse_potential.py @@ -111,13 +111,13 @@ def shear_modulus(self, pressure, temperature, volume, params): def entropy(self, pressure, temperature, volume, params): """ - Returns the molar entropy :math:`\mathcal{S}` of the mineral. :math:`[J/K/mol]` + Returns the molar entropy :math:`\\mathcal{S}` of the mineral. :math:`[J/K/mol]` """ return 0.0 def molar_internal_energy(self, pressure, temperature, volume, params): """ - Returns the internal energy :math:`\mathcal{E}` of the mineral. :math:`[J/mol]` + Returns the internal energy :math:`\\mathcal{E}` of the mineral. :math:`[J/mol]` """ x = (params["Kprime_0"] - 1) * (1 - np.power(volume / params["V_0"], 1.0 / 3.0)) @@ -134,7 +134,7 @@ def molar_internal_energy(self, pressure, temperature, volume, params): def gibbs_free_energy(self, pressure, temperature, volume, params): """ - Returns the Gibbs free energy :math:`\mathcal{G}` of the mineral. :math:`[J/mol]` + Returns the Gibbs free energy :math:`\\mathcal{G}` of the mineral. :math:`[J/mol]` """ return ( self.molar_internal_energy(pressure, temperature, volume, params) diff --git a/burnman/eos/murnaghan.py b/burnman/eos/murnaghan.py index 3d77c9a2e..0ac120052 100644 --- a/burnman/eos/murnaghan.py +++ b/burnman/eos/murnaghan.py @@ -76,14 +76,14 @@ def shear_modulus(self, pressure, temperature, volume, params): def entropy(self, pressure, temperature, volume, params): """ - Returns the molar entropy :math:`\mathcal{S}` of the mineral. + Returns the molar entropy :math:`\\mathcal{S}` of the mineral. :math:`[J/K/mol]` """ return 0.0 def molar_internal_energy(self, pressure, temperature, volume, params): """ - Returns the internal energy :math:`\mathcal{E}` of the mineral. + Returns the internal energy :math:`\\mathcal{E}` of the mineral. :math:`[J/mol]` """ return energy( @@ -92,7 +92,7 @@ def molar_internal_energy(self, pressure, temperature, volume, params): def gibbs_free_energy(self, pressure, temperature, volume, params): """ - Returns the Gibbs free energy :math:`\mathcal{G}` of the mineral. + Returns the Gibbs free energy :math:`\\mathcal{G}` of the mineral. :math:`[J/mol]` """ # G = E + PV diff --git a/burnman/eos/reciprocal_kprime.py b/burnman/eos/reciprocal_kprime.py index 201f839a9..488b03bb5 100644 --- a/burnman/eos/reciprocal_kprime.py +++ b/burnman/eos/reciprocal_kprime.py @@ -136,11 +136,11 @@ class RKprime(eos.EquationOfState): unstable at negative pressures, so should not be trusted to provide a good *HT-LP* equation of state using a thermal pressure formulation. The negative root of :math:`dP/dK` - can be found at :math:`K/P = K'_{\infty} - K'_0`, + can be found at :math:`K/P = K'_{\\infty} - K'_0`, which corresponds to a bulk modulus of - :math:`K = K_0 ( 1 - K'_{\infty}/K'_0 )^{K'_0/K'_{\infty}}` + :math:`K = K_0 ( 1 - K'_{\\infty}/K'_0 )^{K'_0/K'_{\\infty}}` and a volume of - :math:`V = V_0 ( K'_0 / (K'_0 - K'_{\infty}) )^{K'_0/{K'}^2_{\infty}} \exp{(-1/K'_{\infty})}`. + :math:`V = V_0 ( K'_0 / (K'_0 - K'_{\\infty}) )^{K'_0/{K'}^2_{\\infty}} \\exp{(-1/K'_{\\infty})}`. This equation of state has no temperature dependence. """ @@ -196,7 +196,7 @@ def shear_modulus(self, pressure, temperature, volume, params): def entropy(self, pressure, temperature, volume, params): """ - Returns the molar entropy :math:`\mathcal{S}` of the mineral. :math:`[J/K/mol]` + Returns the molar entropy :math:`\\mathcal{S}` of the mineral. :math:`[J/K/mol]` """ return 0.0 @@ -228,7 +228,7 @@ def _intVdP(self, xi, params): def gibbs_free_energy(self, pressure, temperature, volume, params): """ - Returns the Gibbs free energy :math:`\mathcal{G}` of the mineral. :math:`[J/mol]` + Returns the Gibbs free energy :math:`\\mathcal{G}` of the mineral. :math:`[J/mol]` """ # G = E0 + int VdP (when S = 0) K = self.isothermal_bulk_modulus(pressure, temperature, volume, params) @@ -241,7 +241,7 @@ def gibbs_free_energy(self, pressure, temperature, volume, params): def molar_internal_energy(self, pressure, temperature, volume, params): """ - Returns the internal energy :math:`\mathcal{E}` of the mineral. :math:`[J/mol]` + Returns the internal energy :math:`\\mathcal{E}` of the mineral. :math:`[J/mol]` """ # E = G - PV (+ TS) return ( @@ -276,7 +276,7 @@ def grueneisen_parameter(self, pressure, temperature, volume, params): def validate_parameters(self, params): """ Check for existence and validity of the parameters. - The value for :math:`K'_{\infty}` is thermodynamically bounded + The value for :math:`K'_{\\infty}` is thermodynamically bounded between 5/3 and :math:`K'_0` :cite:`StaceyDavis2004`. """ diff --git a/burnman/eos/vinet.py b/burnman/eos/vinet.py index 910100cbc..c330263d9 100644 --- a/burnman/eos/vinet.py +++ b/burnman/eos/vinet.py @@ -95,13 +95,13 @@ def shear_modulus(self, pressure, temperature, volume, params): def entropy(self, pressure, temperature, volume, params): """ - Returns the molar entropy :math:`\mathcal{S}` of the mineral. :math:`[J/K/mol]` + Returns the molar entropy :math:`\\mathcal{S}` of the mineral. :math:`[J/K/mol]` """ return 0.0 def molar_internal_energy(self, pressure, temperature, volume, params): """ - Returns the internal energy :math:`\mathcal{E}` of the mineral. :math:`[J/mol]` + Returns the internal energy :math:`\\mathcal{E}` of the mineral. :math:`[J/mol]` """ x = pow(volume / params["V_0"], 1.0 / 3.0) eta = (3.0 / 2.0) * (params["Kprime_0"] - 1.0) @@ -118,7 +118,7 @@ def molar_internal_energy(self, pressure, temperature, volume, params): def gibbs_free_energy(self, pressure, temperature, volume, params): """ - Returns the Gibbs free energy :math:`\mathcal{G}` of the mineral. :math:`[J/mol]` + Returns the Gibbs free energy :math:`\\mathcal{G}` of the mineral. :math:`[J/mol]` """ # G = int VdP = [PV] - int PdV = E + PV diff --git a/burnman/utils/chemistry.py b/burnman/utils/chemistry.py index 7e53e87ee..479d981ee 100644 --- a/burnman/utils/chemistry.py +++ b/burnman/utils/chemistry.py @@ -449,7 +449,7 @@ def process_solution_chemistry(solution_model): ) solution_model.empty_formula = re.sub( - "([\[]).*?([\]])", "\g<1>\g<2>", solution_model.formulas[0] + "([\\[]).*?([\\]])", "\\g<1>\\g<2>", solution_model.formulas[0] ) split_empty = solution_model.empty_formula.split("[") solution_model.general_formula = split_empty[0] diff --git a/burnman/utils/geotherm.py b/burnman/utils/geotherm.py index 49318f067..9afe561de 100644 --- a/burnman/utils/geotherm.py +++ b/burnman/utils/geotherm.py @@ -102,7 +102,7 @@ def adiabatic(pressures, T0, rock): pressure. A good first guess is provided by integrating: .. math:: - \\frac{\partial T}{\partial P} = \\frac{ \\gamma T}{ K_s } + \\frac{\\partial T}{\\partial P} = \\frac{ \\gamma T}{ K_s } where :math:`\\gamma` is the Grueneisen parameter and :math:`K_s` is the adiabatic bulk modulus. diff --git a/burnman/utils/misc.py b/burnman/utils/misc.py index 990756116..cfb36d6b8 100644 --- a/burnman/utils/misc.py +++ b/burnman/utils/misc.py @@ -105,7 +105,7 @@ def pretty_print_table(table, use_tabs=False): """ if use_tabs: for r in table: - print("\t".join(r).replace("_", "\_")) + print("\t".join(r).replace("_", "\\_")) return def col_width(table, colidx): diff --git a/contrib/CHRU2014/paper_benchmark.py b/contrib/CHRU2014/paper_benchmark.py index 9ad6db395..97c055c64 100644 --- a/contrib/CHRU2014/paper_benchmark.py +++ b/contrib/CHRU2014/paper_benchmark.py @@ -115,24 +115,24 @@ def check_slb_fig7_txt(): ) gr_comp[i] = (forsterite.grueneisen_parameter - gr[i]) / gr[i] - plt.plot(temperature, rho_comp, label=r"$\rho$") + plt.plot(temperature, rho_comp, label=r"$\\rho$") plt.plot(temperature, Kt_comp, label=r"$K_S$") plt.plot(temperature, Ks_comp, label=r"$K_T$") plt.plot(temperature, G_comp, label=r"$G$") plt.plot(temperature, VS_comp, label=r"$V_S$") plt.plot(temperature, VP_comp, label=r"$V_P$") - plt.plot(temperature, VB_comp, label=r"$V_\phi$") + plt.plot(temperature, VB_comp, label=r"$V_\\phi$") plt.plot(temperature, vol_comp, label=r"$V$") - plt.plot(temperature, alpha_comp, label=r"$\alpha$") + plt.plot(temperature, alpha_comp, label=r"$\\alpha$") plt.plot(temperature, Cp_comp, label=r"$c_P$") - plt.plot(temperature, gr_comp, label=r"$\gamma$") + plt.plot(temperature, gr_comp, label=r"$\\gamma$") plt.xlim([0, 2200]) plt.ylim([-0.002, 0.002]) plt.yticks([-0.002, -0.001, 0, 0.001, 0.002]) plt.xticks([0, 800, 1600, 2200]) plt.xlabel("Temperature (K)") - plt.ylabel("Difference (\%)") + plt.ylabel("Difference (\\%)") plt.legend(loc="lower center", prop=prop, ncol=4) if "RUNNING_TESTS" not in globals(): plt.savefig("benchmark1.pdf", bbox_inches="tight") diff --git a/contrib/CHRU2014/paper_onefit.py b/contrib/CHRU2014/paper_onefit.py index 7b732bf74..dbafe4f88 100644 --- a/contrib/CHRU2014/paper_onefit.py +++ b/contrib/CHRU2014/paper_onefit.py @@ -65,16 +65,16 @@ def output_rock(rock, file_handle): for ph in rock.staticphases: if isinstance(ph.mineral, HelperSolidSolution): for mineral in ph.mineral.endmembers: - file_handle.write("\t" + mineral.to_string() + "\n") + file_handle.write("\\t" + mineral.to_string() + "\\n") for key in mineral.params: file_handle.write( - "\t\t" + key + ": " + str(mineral.params[key]) + "\n" + "\\t\\t" + key + ": " + str(mineral.params[key]) + "\\n" ) else: - file_handle.write("\t" + ph.mineral.to_string() + "\n") + file_handle.write("\\t" + ph.mineral.to_string() + "\\n") for key in ph.mineral.params: file_handle.write( - "\t\t" + key + ": " + str(ph.mineral.params[key]) + "\n" + "\\t\\t" + key + ": " + str(ph.mineral.params[key]) + "\\n" ) @@ -351,7 +351,7 @@ def array_to_rock(arr, names): figsize = (6, 5) prop = {"size": 12} plt.rc("text", usetex=True) - plt.rcParams["text.latex.preamble"] = r"\usepackage{relsize}" + plt.rcParams["text.latex.preamble"] = r"\\usepackage{relsize}" plt.rc("font", family="sans-serif") figure = plt.figure(dpi=100, figsize=figsize) @@ -436,7 +436,7 @@ def array_to_rock(arr, names): ) plt.xlabel("Pressure (GPa)") - plt.ylabel("Velocities (km/s) and Density ($\cdot 10^3$ kg/m$^3$)") + plt.ylabel("Velocities (km/s) and Density ($\\cdot 10^3$ kg/m$^3$)") plt.legend(bbox_to_anchor=(1.0, 0.9), prop={"size": 12}) plt.xlim(25, 135) # plt.ylim(6,11) diff --git a/contrib/CHRU2014/paper_opt_pv.py b/contrib/CHRU2014/paper_opt_pv.py index 34e23757e..9ac395ad1 100644 --- a/contrib/CHRU2014/paper_opt_pv.py +++ b/contrib/CHRU2014/paper_opt_pv.py @@ -48,7 +48,7 @@ fig = plt.figure(dpi=100, figsize=(12, 10)) prop = {"size": 12} plt.rc("text", usetex=True) - plt.rcParams["text.latex.preamble"] = r"\usepackage{relsize}" + plt.rcParams["text.latex.preamble"] = r"\\usepackage{relsize}" plt.rc("font", family="sans-serif") figsize = (6, 5) @@ -141,7 +141,7 @@ def material_error(x): yy_vphi, "-", color=colors.color(3), - label=("$V_\phi$ error"), + label=("$V_\\phi$ error"), linewidth=1.5, ) # plt.plot (xx*100,yy_vs+yy_vphi,"g--",label=("sum"),linewidth=1.5) @@ -169,7 +169,7 @@ def material_error(x): [A * 100.0, A * 100.0], [ymin, ymax], color=colors.color(3), - label="A (%g\%% pv)" % (A * 100), + label="A (%g\\%% pv)" % (A * 100), linewidth=1.5, linestyle="-", ) @@ -177,7 +177,7 @@ def material_error(x): [B * 100.0, B * 100.0], [ymin, ymax], color=colors.color(1), - label="B (%g\%% pv)" % (B * 100), + label="B (%g\\%% pv)" % (B * 100), linewidth=1.5, dashes=dashstyle2, ) @@ -185,13 +185,13 @@ def material_error(x): [C * 100.0, C * 100.0], [ymin, ymax], color=colors.color(4), - label="C (%g\%% pv)" % (C * 100), + label="C (%g\\%% pv)" % (C * 100), linewidth=1.5, dashes=dashstyle3, ) plt.yscale("log") - plt.xlabel("\% Perovskite") + plt.xlabel("\\% Perovskite") plt.ylabel("Error") plt.legend(loc="lower left", prop=prop) # plt.tight_layout(pad=2) @@ -219,7 +219,7 @@ def material_error(x): A_vs / 1.0e3, color=colors.color(3), linestyle="-", - label="A (%g\%% pv)" % (A * 100), + label="A (%g\\%% pv)" % (A * 100), linewidth=1.5, markevery=5, marker="v", @@ -232,7 +232,7 @@ def material_error(x): B_vs / 1.0e3, color=colors.color(1), dashes=dashstyle2, - label="B (%g\%% pv)" % (B * 100), + label="B (%g\\%% pv)" % (B * 100), linewidth=1.5, markevery=5, marker="v", @@ -245,7 +245,7 @@ def material_error(x): C_vs / 1.0e3, color=colors.color(4), dashes=dashstyle3, - label="C (%g\%% pv)" % (C * 100), + label="C (%g\\%% pv)" % (C * 100), linewidth=1.5, markevery=5, marker="v", @@ -254,7 +254,9 @@ def material_error(x): markeredgecolor=colors.color(4), ) plt.xlabel("Pressure (GPa)") - plt.ylabel("Shear velocity $V_{\mathlarger{\mathlarger{\mathlarger{s}}}}$ (km/s)") + plt.ylabel( + "Shear velocity $V_{\\mathlarger{\\mathlarger{\\mathlarger{s}}}}$ (km/s)" + ) plt.xlim([30, 130]) plt.legend(loc="lower right", prop=prop) # plt.tight_layout() @@ -286,7 +288,7 @@ def material_error(x): markeredgecolor=colors.color(3), markerfacecolor="None", mew=1.5, - label="A (%g\%% pv)" % (A * 100), + label="A (%g\\%% pv)" % (A * 100), linewidth=1.5, ) plt.plot( @@ -300,7 +302,7 @@ def material_error(x): markeredgecolor=colors.color(1), markerfacecolor="None", mew=1.5, - label="B (%g\%% pv)" % (B * 100), + label="B (%g\\%% pv)" % (B * 100), linewidth=1.5, ) plt.plot( @@ -314,12 +316,12 @@ def material_error(x): markeredgecolor=colors.color(4), markerfacecolor="None", mew=1.5, - label="C (%g\%% pv)" % (C * 100), + label="C (%g\\%% pv)" % (C * 100), linewidth=1.5, ) plt.xlabel("Pressure (GPa)") plt.ylabel( - "Bulk sound velocity $V_{\mathlarger{\mathlarger{\mathlarger{\phi}}}}$ (km/s)" + "Bulk sound velocity $V_{\\mathlarger{\\mathlarger{\\mathlarger{\\phi}}}}$ (km/s)" ) plt.xlim([30, 130]) plt.legend(loc="lower right", prop=prop) @@ -335,7 +337,7 @@ def material_error(x): seis_p / 1.0e9, (A_vs - seis_vs) / seis_vs * 100.0, color=colors.color(3), - label="$V_s$: A (%g\%% pv)" % (A * 100), + label="$V_s$: A (%g\\%% pv)" % (A * 100), linewidth=1.5, linestyle="-", markevery=5, @@ -348,7 +350,7 @@ def material_error(x): seis_p / 1.0e9, (B_vs - seis_vs) / seis_vs * 100.0, color=colors.color(1), - label="$V_s$: B (%g\%% pv)" % (B * 100), + label="$V_s$: B (%g\\%% pv)" % (B * 100), linewidth=1.5, dashes=dashstyle2, markevery=5, @@ -361,7 +363,7 @@ def material_error(x): seis_p / 1.0e9, (C_vs - seis_vs) / seis_vs * 100.0, color=colors.color(4), - label="$V_s$: C (%g\%% pv)" % (C * 100), + label="$V_s$: C (%g\\%% pv)" % (C * 100), linewidth=1.5, dashes=dashstyle3, markevery=5, @@ -380,7 +382,7 @@ def material_error(x): markeredgecolor=colors.color(3), markerfacecolor="None", mew=1.5, - label="$V_\phi$: A", + label="$V_\\phi$: A", linewidth=1.5, linestyle="-", ) @@ -394,7 +396,7 @@ def material_error(x): markeredgecolor=colors.color(1), markerfacecolor="None", mew=1.5, - label="$V_\phi$: B", + label="$V_\\phi$: B", linewidth=1.5, dashes=dashstyle2, ) @@ -408,12 +410,12 @@ def material_error(x): markeredgecolor=colors.color(4), markerfacecolor="None", mew=1.5, - label="$V_\phi$: C", + label="$V_\\phi$: C", linewidth=1.5, dashes=dashstyle3, ) plt.xlabel("Pressure (GPa)") - plt.ylabel("Difference from PREM (\%)") + plt.ylabel("Difference from PREM (\\%)") plt.ylim([-5, 4]) plt.xlim([30, 130]) plt.legend(loc="lower center", ncol=2, prop=prop) diff --git a/contrib/CHRU2014/paper_uncertain.py b/contrib/CHRU2014/paper_uncertain.py index 60cb67741..24873a029 100644 --- a/contrib/CHRU2014/paper_uncertain.py +++ b/contrib/CHRU2014/paper_uncertain.py @@ -54,7 +54,7 @@ def __init__(self, uncertain): figure = plt.figure(dpi=100, figsize=(12, 10)) prop = {"size": 12} plt.rc("text", usetex=True) - plt.rcParams["text.latex.preamble"] = r"\usepackage{relsize}" + plt.rcParams["text.latex.preamble"] = r"\\usepackage{relsize}" plt.rc("font", family="sans-serif") dashstyle2 = (6, 3) @@ -96,9 +96,9 @@ def eval(uncertain): "$G_0$", "$G_0'$", "$\\theta_0$", - "$\gamma_0$", + "$\\gamma_0$", "$q_0$", - "$\eta_{S0}$", + "$\\eta_{S0}$", "$T_0$", ] @@ -193,7 +193,7 @@ def eval(uncertain): linewidth=1.5, markersize=6, markerfacecolor="None", - label="$V_\phi$", + label="$V_\\phi$", ) ax.plot( seis_p / 1.0e9, @@ -223,7 +223,7 @@ def eval(uncertain): interpolate=False, ) - ax.set_title("%s $\pm %d\\%%$ " % (names[i], spread[i] * 100)) + ax.set_title("%s $\\pm %d\\%%$ " % (names[i], spread[i] * 100)) ax.set_ylim([6.1, 11.8]) ax.set_xlim([30, 130]) diff --git a/contrib/cider_tutorial_2014/step_1.py b/contrib/cider_tutorial_2014/step_1.py index 18677a4bd..57ee93612 100644 --- a/contrib/cider_tutorial_2014/step_1.py +++ b/contrib/cider_tutorial_2014/step_1.py @@ -230,7 +230,7 @@ ) plt.xlim(min(pressure) / 1.0e9, max(pressure) / 1.0e9) plt.xlabel("Pressure (GPa)") - plt.title("density ($\cdot 10^3$ kg/m$^3$)") + plt.title("density ($\\cdot 10^3$ kg/m$^3$)") # Finally, we plot the goetherm used plt.subplot(2, 2, 4) diff --git a/examples/example_build_planet.py b/examples/example_build_planet.py index 5540809c5..9077f58f8 100644 --- a/examples/example_build_planet.py +++ b/examples/example_build_planet.py @@ -171,7 +171,7 @@ premradii / 1.0e3, premdensity / 1.0e3, "--k", linewidth=1.0, label="PREM" ) ax[0].set_ylim(0.0, (max(planet_zog.density) / 1.0e3) + 1.0) - ax[0].set_ylabel("Density ($\cdot 10^3$ kg/m$^3$)") + ax[0].set_ylabel("Density ($\\cdot 10^3$ kg/m$^3$)") ax[0].legend() # Make a subplot showing the calculated pressure profile diff --git a/examples/example_compare_all_methods.py b/examples/example_compare_all_methods.py index 7f268632d..47f3fd8f1 100644 --- a/examples/example_compare_all_methods.py +++ b/examples/example_compare_all_methods.py @@ -11,7 +11,7 @@ This example demonstrates how to call each of the individual calculation methodologies that exist within BurnMan. See below for current options. This example calculates seismic velocity profiles for the same set of minerals and -a plot of :math:`V_s, V_\phi` and :math:`\\rho` is produce for the user to compare each of the +a plot of :math:`V_s, V_\\phi` and :math:`\\rho` is produce for the user to compare each of the different methods. *Specifically uses:* @@ -140,7 +140,7 @@ ax[0].set_ylabel("Vs (km/s)") ax[1].set_ylabel("Vphi (km/s)") - ax[2].set_ylabel("Density ($\cdot 10^3$ kg/m^3)") + ax[2].set_ylabel("Density ($\\cdot 10^3$ kg/m^3)") ax[3].set_ylabel("Temperature (K)") fig.savefig("output_figures/example_compare_all_methods.png") plt.show() diff --git a/examples/example_dataset_uncertainties.py b/examples/example_dataset_uncertainties.py index f9944d799..b9507f57b 100644 --- a/examples/example_dataset_uncertainties.py +++ b/examples/example_dataset_uncertainties.py @@ -70,6 +70,6 @@ ax.set_xlim(-500.0, 500.0) ax.set_ylim(-500.0, 500.0) -ax.set_xlabel("$\sigma_{q+per}$ (J/mol MgSiO$_3$)") -ax.set_ylabel("$\sigma_{en/2}$ (J/mol MgSiO$_3$)") +ax.set_xlabel("$\\sigma_{q+per}$ (J/mol MgSiO$_3$)") +ax.set_ylabel("$\\sigma_{en/2}$ (J/mol MgSiO$_3$)") plt.show() diff --git a/examples/example_elastic_solution.py b/examples/example_elastic_solution.py index 61897b478..9634b1138 100644 --- a/examples/example_elastic_solution.py +++ b/examples/example_elastic_solution.py @@ -215,9 +215,9 @@ def mult(x, n): ax[0].set_ylabel("Gibbs (kJ/mol)") ax[1].set_ylabel("Volume (cm$^3$/mol)") ax[2].set_ylabel("Entropy (J/K/mol)") - ax[3].set_ylabel("Gibbs - $\mu(0.4)$ (kJ/mol)") - ax[4].set_ylabel("Volume - $d\mu(0.4)/dP$ (cm$^3$/mol)") - ax[5].set_ylabel("Entropy + $d\mu(0.4)/dT$ (J/K/mol)") + ax[3].set_ylabel("Gibbs - $\\mu(0.4)$ (kJ/mol)") + ax[4].set_ylabel("Volume - $d\\mu(0.4)/dP$ (cm$^3$/mol)") + ax[5].set_ylabel("Entropy + $d\\mu(0.4)/dT$ (J/K/mol)") fig.set_tight_layout(True) diff --git a/examples/example_olivine_binary.py b/examples/example_olivine_binary.py index 8ba583b14..65e51f68a 100644 --- a/examples/example_olivine_binary.py +++ b/examples/example_olivine_binary.py @@ -12,7 +12,7 @@ (olivine, wadsleyite and ringwoodite). The calculations use the equilibrate function. Unlike the -examples in example\_equilibrate.py, which are constrained to a +examples in example\\_equilibrate.py, which are constrained to a fixed bulk composition, the bulk composition is allowed to vary along the vector [n_Mg - n_Fe]. diff --git a/examples/example_spintransition_thermal.py b/examples/example_spintransition_thermal.py index 942b23e89..104e15bc1 100644 --- a/examples/example_spintransition_thermal.py +++ b/examples/example_spintransition_thermal.py @@ -9,7 +9,7 @@ ------------------------------ This example illustrates how to create a non-ideal solution model -for (Mg,Fe\ :sup:`HS`\ ,Fe\ :sup:`LS`\ )O ferropericlase that has a gradual +for (Mg,Fe\\ :sup:`HS`\\ ,Fe\\ :sup:`LS`\\ )O ferropericlase that has a gradual spin transition at finite temperature. First, we define the MgO endmember and two endmembers for the low and high spin states of FeO. Then we create a regular/symmetric solution that @@ -22,7 +22,7 @@ also implicitly apply the Bragg-Williams approximation (i.e., we assume that there is no short-range order by only incorporating interactions that are a function of the average occupancy of species on each distinct site). -Furthermore, the one site model [Mg,Fe\ :sup:`HS`\ ,Fe\ :sup:`LS`\ ]O +Furthermore, the one site model [Mg,Fe\\ :sup:`HS`\\ ,Fe\\ :sup:`LS`\\ ]O explicitly precludes long range order. *Specifically uses:* diff --git a/examples/example_user_input_material.py b/examples/example_user_input_material.py index aeae81b29..5de0c1ed1 100644 --- a/examples/example_user_input_material.py +++ b/examples/example_user_input_material.py @@ -9,7 +9,7 @@ --------------------------- Shows user how to input a mineral of his/her choice without usint the library and which physical values -need to be input for BurnMan to calculate :math:`V_P, V_\Phi, V_S` and density at depth. +need to be input for BurnMan to calculate :math:`V_P, V_\\Phi, V_S` and density at depth. *Specifically uses:* diff --git a/pyproject.toml b/pyproject.toml index 8891b7682..473623ac3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,6 +15,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] [tool.poetry.dependencies] @@ -31,7 +32,7 @@ ipython = "^8.5" numba = "^0.57" [tool.poetry.group.dev.dependencies] -black = "23.3.0" +black = "24.1.1" [build-system] requires = ["poetry-core>=1.0.0"]