From cae975772e6faa9ba3d33e090d42b61f2f8d4d38 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Tue, 25 Jun 2024 16:51:31 -0400 Subject: [PATCH 01/26] jbibkbkj --- src/esbmtk/experiments.py | 125 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index bcc0051a..9cb4de1e 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -16,3 +16,128 @@ along with this program. If not, see . """ +import esbmtk +print(esbmtk.__file__) + +from esbmtk import ( + Model, + Reservoir, + ConnectionProperties, + SourceProperties, + SinkProperties, + Q_, +) + +#def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float, float, float, Model]: +def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float]: + """ + Runs the ESBMTK model with the given parameters and returns the final oxygen concentrations. + + :param F_w: Weathering flux in Gmol/year + :type F_w: str + :param tau: Residence time in years + :type tau: Q_ + :param thc: THC in Sverdrup (Sv) + :type thc: Q_ + :param F_b: Burial flux in fraction + :type F_b: Q_ + :return: Final oxygen concentrations in S_b and D_b + :rtype: tuple[float, float] + """ + + # Basic model parameters + M = Model( + stop="6 Myr", + timestep="1 kyr", + element=["Phosphor", "Oxygen"], + ) + + # Parameters + + SourceProperties( + name="weathering", + species=[M.PO4], + ) + + SinkProperties( + name="burial", + species=[M.PO4], + ) + + # Reservoir Definitions + Reservoir( + name="S_b", + volume="3E16 m**3", + concentration={M.PO4: "0 umol/l", M.O2: "300 umol/l"}, # Initial O2 set to 300 umol/l + ) + + Reservoir( + name="D_b", + volume="100E16 m**3", + concentration={M.PO4: "0 umol/l", M.O2: "100 umol/l"}, # Initial O2 set to 100 umol/l + ) + + # Connection Properties (Fluxes) + ConnectionProperties( + source=M.weathering, + sink=M.S_b, + rate=str(F_w), # Convert F_w to string + id="river", + ctype="regular", + ) + + ConnectionProperties( + source=M.S_b, + sink=M.D_b, + ctype="scale_with_concentration", + scale=thc, + id="downwelling", + species=[M.O2, M.PO4] + ) + + ConnectionProperties( + source=M.D_b, + sink=M.S_b, + ctype="scale_with_concentration", + scale=thc, + id="upwelling", + species=[M.O2, M.PO4] + ) + + ConnectionProperties( + source=M.S_b, + sink=M.D_b, + ctype="scale_with_concentration", + scale=M.S_b.volume / tau, + id="primary_production", + species=[M.PO4], + ) + + ConnectionProperties( + source=M.D_b, + sink=M.burial, + ctype="scale_with_flux", + ref_flux=M.flux_summary(filter_by="primary_production", return_list=True)[0], + scale=F_b, + id="burial", + species=[M.PO4], + ) + + ConnectionProperties( + source=M.D_b, + sink=M.S_b, + ctype="scale_with_flux", + ref_flux=M.flux_summary(filter_by="primary_production", return_list=True)[0], + scale=(1 - F_b) * 138, + id="O2upwelling", + species=[M.O2], + ) + M.read_state() + M.run() + + S_b_O2 = M.S_b.O2.c[-1] * 1E6 + D_b_O2 = M.D_b.O2.c[-1] * 1E6 + S_b_PO4 = M.S_b.PO4.c[-1] * 1E6 + D_b_PO4 = M.D_b.PO4.c[-1] * 1E6 + + return S_b_O2, D_b_O2, S_b_PO4, D_b_PO4 \ No newline at end of file From b3613482e6cd60dacdff05683fe4a5eb55ff9061 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Tue, 25 Jun 2024 16:52:03 -0400 Subject: [PATCH 02/26] Revert "jbibkbkj" This reverts commit cae975772e6faa9ba3d33e090d42b61f2f8d4d38. --- src/esbmtk/experiments.py | 125 -------------------------------------- 1 file changed, 125 deletions(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index 9cb4de1e..bcc0051a 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -16,128 +16,3 @@ along with this program. If not, see . """ -import esbmtk -print(esbmtk.__file__) - -from esbmtk import ( - Model, - Reservoir, - ConnectionProperties, - SourceProperties, - SinkProperties, - Q_, -) - -#def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float, float, float, Model]: -def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float]: - """ - Runs the ESBMTK model with the given parameters and returns the final oxygen concentrations. - - :param F_w: Weathering flux in Gmol/year - :type F_w: str - :param tau: Residence time in years - :type tau: Q_ - :param thc: THC in Sverdrup (Sv) - :type thc: Q_ - :param F_b: Burial flux in fraction - :type F_b: Q_ - :return: Final oxygen concentrations in S_b and D_b - :rtype: tuple[float, float] - """ - - # Basic model parameters - M = Model( - stop="6 Myr", - timestep="1 kyr", - element=["Phosphor", "Oxygen"], - ) - - # Parameters - - SourceProperties( - name="weathering", - species=[M.PO4], - ) - - SinkProperties( - name="burial", - species=[M.PO4], - ) - - # Reservoir Definitions - Reservoir( - name="S_b", - volume="3E16 m**3", - concentration={M.PO4: "0 umol/l", M.O2: "300 umol/l"}, # Initial O2 set to 300 umol/l - ) - - Reservoir( - name="D_b", - volume="100E16 m**3", - concentration={M.PO4: "0 umol/l", M.O2: "100 umol/l"}, # Initial O2 set to 100 umol/l - ) - - # Connection Properties (Fluxes) - ConnectionProperties( - source=M.weathering, - sink=M.S_b, - rate=str(F_w), # Convert F_w to string - id="river", - ctype="regular", - ) - - ConnectionProperties( - source=M.S_b, - sink=M.D_b, - ctype="scale_with_concentration", - scale=thc, - id="downwelling", - species=[M.O2, M.PO4] - ) - - ConnectionProperties( - source=M.D_b, - sink=M.S_b, - ctype="scale_with_concentration", - scale=thc, - id="upwelling", - species=[M.O2, M.PO4] - ) - - ConnectionProperties( - source=M.S_b, - sink=M.D_b, - ctype="scale_with_concentration", - scale=M.S_b.volume / tau, - id="primary_production", - species=[M.PO4], - ) - - ConnectionProperties( - source=M.D_b, - sink=M.burial, - ctype="scale_with_flux", - ref_flux=M.flux_summary(filter_by="primary_production", return_list=True)[0], - scale=F_b, - id="burial", - species=[M.PO4], - ) - - ConnectionProperties( - source=M.D_b, - sink=M.S_b, - ctype="scale_with_flux", - ref_flux=M.flux_summary(filter_by="primary_production", return_list=True)[0], - scale=(1 - F_b) * 138, - id="O2upwelling", - species=[M.O2], - ) - M.read_state() - M.run() - - S_b_O2 = M.S_b.O2.c[-1] * 1E6 - D_b_O2 = M.D_b.O2.c[-1] * 1E6 - S_b_PO4 = M.S_b.PO4.c[-1] * 1E6 - D_b_PO4 = M.D_b.PO4.c[-1] * 1E6 - - return S_b_O2, D_b_O2, S_b_PO4, D_b_PO4 \ No newline at end of file From a4335a7f1ef76c1db7d7be90440b46ea692a9522 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Tue, 25 Jun 2024 17:27:13 -0400 Subject: [PATCH 03/26] add experiments module --- src/esbmtk/experiments.py | 124 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index bcc0051a..ebb4be2f 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -16,3 +16,127 @@ along with this program. If not, see . """ +import esbmtk + +from esbmtk import ( + Model, + Reservoir, + ConnectionProperties, + SourceProperties, + SinkProperties, + Q_, +) + +#def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float, float, float, Model]: +def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float]: + """ + Runs the ESBMTK model with the given parameters and returns the final oxygen concentrations. + + :param F_w: Weathering flux in Gmol/year + :type F_w: str + :param tau: Residence time in years + :type tau: Q_ + :param thc: THC in Sverdrup (Sv) + :type thc: Q_ + :param F_b: Burial flux in fraction + :type F_b: Q_ + :return: Final oxygen concentrations in S_b and D_b + :rtype: tuple[float, float] + """ + + # Basic model parameters + M = Model( + stop="6 Myr", + timestep="1 kyr", + element=["Phosphor", "Oxygen"], + ) + + # Parameters + + SourceProperties( + name="weathering", + species=[M.PO4], + ) + + SinkProperties( + name="burial", + species=[M.PO4], + ) + + # Reservoir Definitions + Reservoir( + name="S_b", + volume="3E16 m**3", + concentration={M.PO4: "0 umol/l", M.O2: "300 umol/l"}, # Initial O2 set to 300 umol/l + ) + + Reservoir( + name="D_b", + volume="100E16 m**3", + concentration={M.PO4: "0 umol/l", M.O2: "100 umol/l"}, # Initial O2 set to 100 umol/l + ) + + # Connection Properties (Fluxes) + ConnectionProperties( + source=M.weathering, + sink=M.S_b, + rate=str(F_w), # Convert F_w to string + id="river", + ctype="regular", + ) + + ConnectionProperties( + source=M.S_b, + sink=M.D_b, + ctype="scale_with_concentration", + scale=thc, + id="downwelling", + species=[M.O2, M.PO4] + ) + + ConnectionProperties( + source=M.D_b, + sink=M.S_b, + ctype="scale_with_concentration", + scale=thc, + id="upwelling", + species=[M.O2, M.PO4] + ) + + ConnectionProperties( + source=M.S_b, + sink=M.D_b, + ctype="scale_with_concentration", + scale=M.S_b.volume / tau, + id="primary_production", + species=[M.PO4], + ) + + ConnectionProperties( + source=M.D_b, + sink=M.burial, + ctype="scale_with_flux", + ref_flux=M.flux_summary(filter_by="primary_production", return_list=True)[0], + scale=F_b, + id="burial", + species=[M.PO4], + ) + + ConnectionProperties( + source=M.D_b, + sink=M.S_b, + ctype="scale_with_flux", + ref_flux=M.flux_summary(filter_by="primary_production", return_list=True)[0], + scale=(1 - F_b) * 138, + id="O2upwelling", + species=[M.O2], + ) + M.read_state() + M.run() + + S_b_O2 = M.S_b.O2.c[-1] * 1E6 + D_b_O2 = M.D_b.O2.c[-1] * 1E6 + S_b_PO4 = M.S_b.PO4.c[-1] * 1E6 + D_b_PO4 = M.D_b.PO4.c[-1] * 1E6 + + return S_b_O2, D_b_O2, S_b_PO4, D_b_PO4 From 03b9cdf9364fd76c99f4ba92087514f8081ff6b1 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Wed, 26 Jun 2024 09:52:59 -0400 Subject: [PATCH 04/26] return to previous --- src/esbmtk/experiments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index ebb4be2f..fb7c7072 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -139,4 +139,4 @@ def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float]: S_b_PO4 = M.S_b.PO4.c[-1] * 1E6 D_b_PO4 = M.D_b.PO4.c[-1] * 1E6 - return S_b_O2, D_b_O2, S_b_PO4, D_b_PO4 + return S_b_O2, D_b_O2, S_b_PO4, D_b_PO4, M From 709ff94d3f961dc6a2f98e7ba7ae5b90e1273dda Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Wed, 26 Jun 2024 12:09:39 -0400 Subject: [PATCH 05/26] added calculate_burial --- src/esbmtk/experiments.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index fb7c7072..1f14b4ca 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -140,3 +140,28 @@ def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float]: D_b_PO4 = M.D_b.PO4.c[-1] * 1E6 return S_b_O2, D_b_O2, S_b_PO4, D_b_PO4, M + +def calculate_burial(po4_export_flux: float, o2_con: float) -> float: + """ + Calculate burial as a function of productivity and oxygen concentration. + + :param po4_export_flux: Surface ocean productivity in umol/L + :type po4_export_flux: float + :param o2_con: Oxygen concentration in the deep box in umol/L + :type o2_con: float + :return: Burial flux in mol/year + :rtype: float + """ + # burial fraction to [oxygen] approximation of relationship from 0.01 to 0.1 + min_burial_fraction = 0.01 + max_burial_fraction = 0.1 + burial_fraction = min_burial_fraction + (max_burial_fraction - min_burial_fraction) * (o2_con / 100) + + deep_ocean_v = 1E18 # in litres + + # productivity in mol/year + productivity_mol_year = po4_export_flux * deep_ocean_v * 1E-6 # Convert umol/L to mol + + burial_flux = productivity_mol_year * burial_fraction + + return burial_flux \ No newline at end of file From 7a74bd474f0e03f5fb76cb2461321f6dcb94e26f Mon Sep 17 00:00:00 2001 From: uliw Date: Wed, 26 Jun 2024 13:27:41 -0400 Subject: [PATCH 06/26] chore(esbmtk): Fix formatting in experiments.py file --- src/esbmtk/experiments.py | 42 +++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index 1f14b4ca..d2a91868 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -27,7 +27,8 @@ Q_, ) -#def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float, float, float, Model]: + +# def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float, float, float, Model]: def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float]: """ Runs the ESBMTK model with the given parameters and returns the final oxygen concentrations. @@ -43,7 +44,7 @@ def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float]: :return: Final oxygen concentrations in S_b and D_b :rtype: tuple[float, float] """ - + # Basic model parameters M = Model( stop="6 Myr", @@ -67,13 +68,19 @@ def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float]: Reservoir( name="S_b", volume="3E16 m**3", - concentration={M.PO4: "0 umol/l", M.O2: "300 umol/l"}, # Initial O2 set to 300 umol/l + concentration={ + M.PO4: "0 umol/l", + M.O2: "300 umol/l", + }, # Initial O2 set to 300 umol/l ) Reservoir( name="D_b", volume="100E16 m**3", - concentration={M.PO4: "0 umol/l", M.O2: "100 umol/l"}, # Initial O2 set to 100 umol/l + concentration={ + M.PO4: "0 umol/l", + M.O2: "100 umol/l", + }, # Initial O2 set to 100 umol/l ) # Connection Properties (Fluxes) @@ -91,7 +98,7 @@ def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float]: ctype="scale_with_concentration", scale=thc, id="downwelling", - species=[M.O2, M.PO4] + species=[M.O2, M.PO4], ) ConnectionProperties( @@ -100,7 +107,7 @@ def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float]: ctype="scale_with_concentration", scale=thc, id="upwelling", - species=[M.O2, M.PO4] + species=[M.O2, M.PO4], ) ConnectionProperties( @@ -133,14 +140,15 @@ def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float]: ) M.read_state() M.run() - - S_b_O2 = M.S_b.O2.c[-1] * 1E6 - D_b_O2 = M.D_b.O2.c[-1] * 1E6 - S_b_PO4 = M.S_b.PO4.c[-1] * 1E6 - D_b_PO4 = M.D_b.PO4.c[-1] * 1E6 + + S_b_O2 = M.S_b.O2.c[-1] * 1e6 + D_b_O2 = M.D_b.O2.c[-1] * 1e6 + S_b_PO4 = M.S_b.PO4.c[-1] * 1e6 + D_b_PO4 = M.D_b.PO4.c[-1] * 1e6 return S_b_O2, D_b_O2, S_b_PO4, D_b_PO4, M + def calculate_burial(po4_export_flux: float, o2_con: float) -> float: """ Calculate burial as a function of productivity and oxygen concentration. @@ -155,13 +163,17 @@ def calculate_burial(po4_export_flux: float, o2_con: float) -> float: # burial fraction to [oxygen] approximation of relationship from 0.01 to 0.1 min_burial_fraction = 0.01 max_burial_fraction = 0.1 - burial_fraction = min_burial_fraction + (max_burial_fraction - min_burial_fraction) * (o2_con / 100) + burial_fraction = min_burial_fraction + ( + max_burial_fraction - min_burial_fraction + ) * (o2_con / 100) - deep_ocean_v = 1E18 # in litres + deep_ocean_v = 1e18 # in litres # productivity in mol/year - productivity_mol_year = po4_export_flux * deep_ocean_v * 1E-6 # Convert umol/L to mol + productivity_mol_year = ( + po4_export_flux * deep_ocean_v * 1e-6 + ) # Convert umol/L to mol burial_flux = productivity_mol_year * burial_fraction - return burial_flux \ No newline at end of file + return burial_flux From 61e9fee4dcf1badde285b10df423c9510345d0f1 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Wed, 26 Jun 2024 13:32:12 -0400 Subject: [PATCH 07/26] commiting uli change --- src/esbmtk/experiments.py | 135 ++------------------------------------ 1 file changed, 5 insertions(+), 130 deletions(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index d2a91868..e007db76 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -28,129 +28,8 @@ ) -# def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float, float, float, Model]: -def define_model(F_w: str, tau: Q_, thc: Q_, F_b: Q_) -> tuple[float, float]: - """ - Runs the ESBMTK model with the given parameters and returns the final oxygen concentrations. - - :param F_w: Weathering flux in Gmol/year - :type F_w: str - :param tau: Residence time in years - :type tau: Q_ - :param thc: THC in Sverdrup (Sv) - :type thc: Q_ - :param F_b: Burial flux in fraction - :type F_b: Q_ - :return: Final oxygen concentrations in S_b and D_b - :rtype: tuple[float, float] - """ - - # Basic model parameters - M = Model( - stop="6 Myr", - timestep="1 kyr", - element=["Phosphor", "Oxygen"], - ) - - # Parameters - - SourceProperties( - name="weathering", - species=[M.PO4], - ) - - SinkProperties( - name="burial", - species=[M.PO4], - ) - - # Reservoir Definitions - Reservoir( - name="S_b", - volume="3E16 m**3", - concentration={ - M.PO4: "0 umol/l", - M.O2: "300 umol/l", - }, # Initial O2 set to 300 umol/l - ) - - Reservoir( - name="D_b", - volume="100E16 m**3", - concentration={ - M.PO4: "0 umol/l", - M.O2: "100 umol/l", - }, # Initial O2 set to 100 umol/l - ) - - # Connection Properties (Fluxes) - ConnectionProperties( - source=M.weathering, - sink=M.S_b, - rate=str(F_w), # Convert F_w to string - id="river", - ctype="regular", - ) - - ConnectionProperties( - source=M.S_b, - sink=M.D_b, - ctype="scale_with_concentration", - scale=thc, - id="downwelling", - species=[M.O2, M.PO4], - ) - - ConnectionProperties( - source=M.D_b, - sink=M.S_b, - ctype="scale_with_concentration", - scale=thc, - id="upwelling", - species=[M.O2, M.PO4], - ) - - ConnectionProperties( - source=M.S_b, - sink=M.D_b, - ctype="scale_with_concentration", - scale=M.S_b.volume / tau, - id="primary_production", - species=[M.PO4], - ) - - ConnectionProperties( - source=M.D_b, - sink=M.burial, - ctype="scale_with_flux", - ref_flux=M.flux_summary(filter_by="primary_production", return_list=True)[0], - scale=F_b, - id="burial", - species=[M.PO4], - ) - - ConnectionProperties( - source=M.D_b, - sink=M.S_b, - ctype="scale_with_flux", - ref_flux=M.flux_summary(filter_by="primary_production", return_list=True)[0], - scale=(1 - F_b) * 138, - id="O2upwelling", - species=[M.O2], - ) - M.read_state() - M.run() - - S_b_O2 = M.S_b.O2.c[-1] * 1e6 - D_b_O2 = M.D_b.O2.c[-1] * 1e6 - S_b_PO4 = M.S_b.PO4.c[-1] * 1e6 - D_b_PO4 = M.D_b.PO4.c[-1] * 1e6 - - return S_b_O2, D_b_O2, S_b_PO4, D_b_PO4, M - - def calculate_burial(po4_export_flux: float, o2_con: float) -> float: - """ + """#add an empty tuple Calculate burial as a function of productivity and oxygen concentration. :param po4_export_flux: Surface ocean productivity in umol/L @@ -163,17 +42,13 @@ def calculate_burial(po4_export_flux: float, o2_con: float) -> float: # burial fraction to [oxygen] approximation of relationship from 0.01 to 0.1 min_burial_fraction = 0.01 max_burial_fraction = 0.1 - burial_fraction = min_burial_fraction + ( - max_burial_fraction - min_burial_fraction - ) * (o2_con / 100) + burial_fraction = min_burial_fraction + (max_burial_fraction - min_burial_fraction) * (o2_con / 100) - deep_ocean_v = 1e18 # in litres + deep_ocean_v = 1E18 # in litres # productivity in mol/year - productivity_mol_year = ( - po4_export_flux * deep_ocean_v * 1e-6 - ) # Convert umol/L to mol + productivity_mol_year = po4_export_flux * deep_ocean_v * 1E-6 # Convert umol/L to mol burial_flux = productivity_mol_year * burial_fraction - return burial_flux + return burial_flux \ No newline at end of file From ba6c1c46a8944fd8512fc02cc80ef4aaed2c62ce Mon Sep 17 00:00:00 2001 From: uliw Date: Wed, 26 Jun 2024 13:33:10 -0400 Subject: [PATCH 08/26] chore(src/esbmtk): refactor code formatting for clarity and consistency --- src/esbmtk/experiments.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index e007db76..71971b64 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -42,13 +42,17 @@ def calculate_burial(po4_export_flux: float, o2_con: float) -> float: # burial fraction to [oxygen] approximation of relationship from 0.01 to 0.1 min_burial_fraction = 0.01 max_burial_fraction = 0.1 - burial_fraction = min_burial_fraction + (max_burial_fraction - min_burial_fraction) * (o2_con / 100) + burial_fraction = min_burial_fraction + ( + max_burial_fraction - min_burial_fraction + ) * (o2_con / 100) - deep_ocean_v = 1E18 # in litres + deep_ocean_v = 1e18 # in litres # productivity in mol/year - productivity_mol_year = po4_export_flux * deep_ocean_v * 1E-6 # Convert umol/L to mol + productivity_mol_year = ( + po4_export_flux * deep_ocean_v * 1e-6 + ) # Convert umol/L to mol burial_flux = productivity_mol_year * burial_fraction - return burial_flux \ No newline at end of file + return burial_flux From 79b40cb0d5cb93747559a4d13cf1233f94299e59 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Wed, 26 Jun 2024 15:39:15 -0400 Subject: [PATCH 09/26] function in proper format --- src/esbmtk/experiments.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index 71971b64..0cffe16d 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -56,3 +56,35 @@ def calculate_burial(po4_export_flux: float, o2_con: float) -> float: burial_flux = productivity_mol_year * burial_fraction return burial_flux + +# Define a function to add the custom burial to the model +def add_my_burial(source, sink, species, scale) -> None: + """This function initializes a user supplied function + so that it can be used within the ESBMTK eco-system + + Parameters + ---------- + source : Source | Species | Reservoir + A source + sink : Sink | Species | Reservoir + A sink + species : SpeciesProperties + A model species + scale : float + A scaling factor + + """ + from esbmtk import ExternalCode + + p = (scale,) # convert float into tuple + ec = ExternalCode( + name="mb", + species=source.species, + function=my_burial, + fname="my_burial", + function_input_data=[po4_export_flux],[o2_con] + function_params=p, + return_values=[ + {f"F_{sed}.{po4}": "po4_burial"}, + ], + ) \ No newline at end of file From 87f2170d5717599e3a4ac45d3b2dbcf951fa02f7 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Wed, 26 Jun 2024 16:44:59 -0400 Subject: [PATCH 10/26] changed function --- src/esbmtk/experiments.py | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index 0cffe16d..f54210db 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -57,10 +57,14 @@ def calculate_burial(po4_export_flux: float, o2_con: float) -> float: return burial_flux -# Define a function to add the custom burial to the model -def add_my_burial(source, sink, species, scale) -> None: + + + +from esbmtk import ExternalCode + +def add_my_burial(source, sink, species, po4_export_flux: float, o2_con: float, scale) -> None: """This function initializes a user supplied function - so that it can be used within the ESBMTK eco-system + so that it can be used within the ESBMTK ecosystem. Parameters ---------- @@ -70,21 +74,22 @@ def add_my_burial(source, sink, species, scale) -> None: A sink species : SpeciesProperties A model species + po4_export_flux : float + PO4 export flux in umol/L + o2_con : float + Oxygen concentration in umol/L scale : float A scaling factor - """ - from esbmtk import ExternalCode - p = (scale,) # convert float into tuple ec = ExternalCode( - name="mb", - species=source.species, - function=my_burial, - fname="my_burial", - function_input_data=[po4_export_flux],[o2_con] + name="calculate_burial", + species=species, + function=calculate_burial, + fname="calculate_burial", + function_input_data=[po4_export_flux, o2_con], function_params=p, return_values=[ - {f"F_{sed}.{po4}": "po4_burial"}, + {f"F_{sediment}.{po4}": "po4_burial"}, ], ) \ No newline at end of file From 401670065be5dc1db2437b76890016963fd2884f Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Thu, 27 Jun 2024 08:47:21 -0400 Subject: [PATCH 11/26] cleaned up code --- src/esbmtk/experiments.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index f54210db..200cf939 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -58,11 +58,12 @@ def calculate_burial(po4_export_flux: float, o2_con: float) -> float: return burial_flux - - from esbmtk import ExternalCode -def add_my_burial(source, sink, species, po4_export_flux: float, o2_con: float, scale) -> None: + +def add_my_burial( + source, sink, species, po4_export_flux: float, o2_con: float, scale +) -> None: """This function initializes a user supplied function so that it can be used within the ESBMTK ecosystem. @@ -81,7 +82,7 @@ def add_my_burial(source, sink, species, po4_export_flux: float, o2_con: float, scale : float A scaling factor """ - p = (scale,) # convert float into tuple + p = (scale,) # float into tuple ec = ExternalCode( name="calculate_burial", species=species, @@ -90,6 +91,6 @@ def add_my_burial(source, sink, species, po4_export_flux: float, o2_con: float, function_input_data=[po4_export_flux, o2_con], function_params=p, return_values=[ - {f"F_{sediment}.{po4}": "po4_burial"}, + {f"F_{sink}.{M.PO4}": "po4_burial"}, ], - ) \ No newline at end of file + ) From a272e003ef4db63437b6c2277405438312260b77 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Thu, 27 Jun 2024 10:58:31 -0400 Subject: [PATCH 12/26] updated with correct inputs? --- src/esbmtk/experiments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index 200cf939..b6b148a2 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -88,7 +88,7 @@ def add_my_burial( species=species, function=calculate_burial, fname="calculate_burial", - function_input_data=[po4_export_flux, o2_con], + function_input_data=[po4_export_flux, F_b], function_params=p, return_values=[ {f"F_{sink}.{M.PO4}": "po4_burial"}, From 6753d998fc2c9002cdba02c60f67e391bcede4c9 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Thu, 27 Jun 2024 12:23:04 -0400 Subject: [PATCH 13/26] restructured experiment --- src/esbmtk/experiments.py | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index b6b148a2..c496f608 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -16,19 +16,18 @@ along with this program. If not, see . """ -import esbmtk - from esbmtk import ( Model, - Reservoir, + # Reservoir, ConnectionProperties, SourceProperties, SinkProperties, + ExternalCode, Q_, ) -def calculate_burial(po4_export_flux: float, o2_con: float) -> float: +def calculate_burial(po4_export_flux: float, o2_c: float) -> float: """#add an empty tuple Calculate burial as a function of productivity and oxygen concentration. @@ -39,30 +38,26 @@ def calculate_burial(po4_export_flux: float, o2_con: float) -> float: :return: Burial flux in mol/year :rtype: float """ - # burial fraction to [oxygen] approximation of relationship from 0.01 to 0.1 + min_burial_fraction = 0.01 max_burial_fraction = 0.1 - burial_fraction = min_burial_fraction + ( - max_burial_fraction - min_burial_fraction - ) * (o2_con / 100) + F_burial = min_burial_fraction + (max_burial_fraction - min_burial_fraction) * ( + o2_c / 100 + ) - deep_ocean_v = 1e18 # in litres + dbv = 1e18 # L # productivity in mol/year - productivity_mol_year = ( - po4_export_flux * deep_ocean_v * 1e-6 - ) # Convert umol/L to mol + productivity_mol_year = po4_export_flux * dbv * 1e-6 # Convert umol/L to mol - burial_flux = productivity_mol_year * burial_fraction + burial_flux = productivity_mol_year * F_burial + p = F_burial, dbv return burial_flux -from esbmtk import ExternalCode - - def add_my_burial( - source, sink, species, po4_export_flux: float, o2_con: float, scale + source, sink, species, o2_c, po4_export_flux: float, F_burial, dbv ) -> None: """This function initializes a user supplied function so that it can be used within the ESBMTK ecosystem. @@ -79,16 +74,16 @@ def add_my_burial( PO4 export flux in umol/L o2_con : float Oxygen concentration in umol/L - scale : float - A scaling factor + F_b : float + A scaling factor of burial fraction """ - p = (scale,) # float into tuple + p = (F_burial, dbv) # float into tuple ec = ExternalCode( name="calculate_burial", species=species, function=calculate_burial, fname="calculate_burial", - function_input_data=[po4_export_flux, F_b], + function_input_data=[po4_export_flux, o2_c], function_params=p, return_values=[ {f"F_{sink}.{M.PO4}": "po4_burial"}, From a68f23bc865328c7692948052f68330e4c5ada34 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Thu, 27 Jun 2024 12:26:23 -0400 Subject: [PATCH 14/26] removed unaccessed esbmtk imports to test if q is a problem --- src/esbmtk/experiments.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index c496f608..3d10691c 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -17,13 +17,7 @@ """ from esbmtk import ( - Model, - # Reservoir, - ConnectionProperties, - SourceProperties, - SinkProperties, ExternalCode, - Q_, ) From 405786c24df85a79f76c5cf7b45e7efb2d784f35 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Thu, 27 Jun 2024 12:37:18 -0400 Subject: [PATCH 15/26] added p --- src/esbmtk/experiments.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index 3d10691c..3cc9baa3 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -21,7 +21,7 @@ ) -def calculate_burial(po4_export_flux: float, o2_c: float) -> float: +def calculate_burial(po4_export_flux: float, o2_c: float, p: tuple) -> float: """#add an empty tuple Calculate burial as a function of productivity and oxygen concentration. @@ -80,6 +80,6 @@ def add_my_burial( function_input_data=[po4_export_flux, o2_c], function_params=p, return_values=[ - {f"F_{sink}.{M.PO4}": "po4_burial"}, + {f"F_{sink}.{species}": "po4_burial"}, ], ) From 1f36c11c98d838046c852ffbee277b5fa6a78912 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Thu, 27 Jun 2024 12:40:24 -0400 Subject: [PATCH 16/26] changed frac_burial --- src/esbmtk/experiments.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index 3cc9baa3..5c71904d 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -35,7 +35,7 @@ def calculate_burial(po4_export_flux: float, o2_c: float, p: tuple) -> float: min_burial_fraction = 0.01 max_burial_fraction = 0.1 - F_burial = min_burial_fraction + (max_burial_fraction - min_burial_fraction) * ( + frac_burial = min_burial_fraction + (max_burial_fraction - min_burial_fraction) * ( o2_c / 100 ) @@ -44,14 +44,14 @@ def calculate_burial(po4_export_flux: float, o2_c: float, p: tuple) -> float: # productivity in mol/year productivity_mol_year = po4_export_flux * dbv * 1e-6 # Convert umol/L to mol - burial_flux = productivity_mol_year * F_burial - p = F_burial, dbv + burial_flux = productivity_mol_year * frac_burial + p = frac_burial, dbv return burial_flux def add_my_burial( - source, sink, species, o2_c, po4_export_flux: float, F_burial, dbv + source, sink, species, o2_c, po4_export_flux: float, frac_burial, dbv ) -> None: """This function initializes a user supplied function so that it can be used within the ESBMTK ecosystem. @@ -71,7 +71,7 @@ def add_my_burial( F_b : float A scaling factor of burial fraction """ - p = (F_burial, dbv) # float into tuple + p = (frac_burial, dbv) # float into tuple ec = ExternalCode( name="calculate_burial", species=species, From 86368b6ce899f97facd4900de878cfce5aa04208 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Thu, 27 Jun 2024 12:45:30 -0400 Subject: [PATCH 17/26] fixing p --- src/esbmtk/experiments.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index 5c71904d..bd4ff0aa 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -32,6 +32,7 @@ def calculate_burial(po4_export_flux: float, o2_c: float, p: tuple) -> float: :return: Burial flux in mol/year :rtype: float """ + frac_burial, dbv = p min_burial_fraction = 0.01 max_burial_fraction = 0.1 @@ -39,13 +40,10 @@ def calculate_burial(po4_export_flux: float, o2_c: float, p: tuple) -> float: o2_c / 100 ) - dbv = 1e18 # L - # productivity in mol/year productivity_mol_year = po4_export_flux * dbv * 1e-6 # Convert umol/L to mol burial_flux = productivity_mol_year * frac_burial - p = frac_burial, dbv return burial_flux From fac4082f0af2a1cdafcf4eab3140d6301356460a Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Thu, 27 Jun 2024 12:47:15 -0400 Subject: [PATCH 18/26] changes to p --- src/esbmtk/experiments.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index bd4ff0aa..a29f8205 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -32,10 +32,8 @@ def calculate_burial(po4_export_flux: float, o2_c: float, p: tuple) -> float: :return: Burial flux in mol/year :rtype: float """ - frac_burial, dbv = p + frac_burial, dbv, min_burial_fraction, max_burial_fraction = p - min_burial_fraction = 0.01 - max_burial_fraction = 0.1 frac_burial = min_burial_fraction + (max_burial_fraction - min_burial_fraction) * ( o2_c / 100 ) @@ -49,7 +47,15 @@ def calculate_burial(po4_export_flux: float, o2_c: float, p: tuple) -> float: def add_my_burial( - source, sink, species, o2_c, po4_export_flux: float, frac_burial, dbv + source, + sink, + species, + o2_c, + po4_export_flux: float, + frac_burial, + dbv, + min_burial_fraction, + max_burial_fraction, ) -> None: """This function initializes a user supplied function so that it can be used within the ESBMTK ecosystem. @@ -69,7 +75,7 @@ def add_my_burial( F_b : float A scaling factor of burial fraction """ - p = (frac_burial, dbv) # float into tuple + p = (frac_burial, dbv, min_burial_fraction, max_burial_fraction) # float into tuple ec = ExternalCode( name="calculate_burial", species=species, From d3ab502f1c4ff8cd90fec46ed180816c47548e14 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Thu, 27 Jun 2024 13:25:38 -0400 Subject: [PATCH 19/26] new sync --- src/esbmtk/experiments.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index a29f8205..98eda0ab 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -42,7 +42,6 @@ def calculate_burial(po4_export_flux: float, o2_c: float, p: tuple) -> float: productivity_mol_year = po4_export_flux * dbv * 1e-6 # Convert umol/L to mol burial_flux = productivity_mol_year * frac_burial - return burial_flux @@ -53,7 +52,7 @@ def add_my_burial( o2_c, po4_export_flux: float, frac_burial, - dbv, + dbv, # can query source.v min_burial_fraction, max_burial_fraction, ) -> None: From 0354fee079b72b4dda7a435ee7ab066c367da9e2 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Thu, 27 Jun 2024 14:19:21 -0400 Subject: [PATCH 20/26] change dbv to query --- src/esbmtk/experiments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index 98eda0ab..d2197697 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -52,7 +52,6 @@ def add_my_burial( o2_c, po4_export_flux: float, frac_burial, - dbv, # can query source.v min_burial_fraction, max_burial_fraction, ) -> None: @@ -74,6 +73,7 @@ def add_my_burial( F_b : float A scaling factor of burial fraction """ + dbv = source.v p = (frac_burial, dbv, min_burial_fraction, max_burial_fraction) # float into tuple ec = ExternalCode( name="calculate_burial", From 02f64ce7fe085c5c58a8018b7eccc0dd8038027e Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Thu, 27 Jun 2024 16:07:16 -0400 Subject: [PATCH 21/26] changed registry --- src/esbmtk/experiments.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index d2197697..ac2103e6 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -18,6 +18,7 @@ from esbmtk import ( ExternalCode, + register_return_values, ) @@ -73,7 +74,7 @@ def add_my_burial( F_b : float A scaling factor of burial fraction """ - dbv = source.v + dbv = source.volume p = (frac_burial, dbv, min_burial_fraction, max_burial_fraction) # float into tuple ec = ExternalCode( name="calculate_burial", @@ -83,6 +84,8 @@ def add_my_burial( function_input_data=[po4_export_flux, o2_c], function_params=p, return_values=[ - {f"F_{sink}.{species}": "po4_burial"}, + {f"F_{sink}.{species}": "M.burial"}, ], + register=source.model, ) + register_return_values(ec, source.model) From 7115eab3acb1511f72a00f16436e89b2f7e5c59e Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Fri, 28 Jun 2024 12:17:05 -0400 Subject: [PATCH 22/26] cleaned up structure --- src/esbmtk/experiments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index ac2103e6..e3762f59 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -84,7 +84,7 @@ def add_my_burial( function_input_data=[po4_export_flux, o2_c], function_params=p, return_values=[ - {f"F_{sink}.{species}": "M.burial"}, + {f"F_{sink.name}.{species.name}": "burial_flux"}, ], register=source.model, ) From aabaf1e1ccd0fdfd6c5dc356210bab182c14002c Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Fri, 28 Jun 2024 12:37:10 -0400 Subject: [PATCH 23/26] after looking at documentation, source is properly registered --- src/esbmtk/experiments.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index e3762f59..a7162b48 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -86,6 +86,6 @@ def add_my_burial( return_values=[ {f"F_{sink.name}.{species.name}": "burial_flux"}, ], - register=source.model, + register=source, ) - register_return_values(ec, source.model) + register_return_values(ec, source) From a75841ffea0382cee76047e0df4e3c5b6bda7c69 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Fri, 28 Jun 2024 13:11:42 -0400 Subject: [PATCH 24/26] added debug messaged --- src/esbmtk/experiments.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index a7162b48..4fafa322 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -56,8 +56,8 @@ def add_my_burial( min_burial_fraction, max_burial_fraction, ) -> None: - """This function initializes a user supplied function - so that it can be used within the ESBMTK ecosystem. + """ + This function initializes a user supplied function so that it can be used within the ESBMTK ecosystem. Parameters ---------- @@ -69,11 +69,19 @@ def add_my_burial( A model species po4_export_flux : float PO4 export flux in umol/L - o2_con : float + o2_c : float Oxygen concentration in umol/L - F_b : float + frac_burial : float A scaling factor of burial fraction + min_burial_fraction : float + Minimum burial fraction + max_burial_fraction : float + Maximum burial fraction """ + print(f"Type of source: {type(source)}") + print(f"Type of sink: {type(sink)}") + print(f"Type of species: {type(species)}") + dbv = source.volume p = (frac_burial, dbv, min_burial_fraction, max_burial_fraction) # float into tuple ec = ExternalCode( From 2f0a85fadc757b138c219d303d7a987b425c6448 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Fri, 28 Jun 2024 16:54:27 -0400 Subject: [PATCH 25/26] still same species properties error --- src/esbmtk/experiments.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index 4fafa322..d9ef4754 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -83,7 +83,9 @@ def add_my_burial( print(f"Type of species: {type(species)}") dbv = source.volume + p = (frac_burial, dbv, min_burial_fraction, max_burial_fraction) # float into tuple + ec = ExternalCode( name="calculate_burial", species=species, From 5070198057d809627db8d50effc791a1c04f3cd9 Mon Sep 17 00:00:00 2001 From: Magnus Roland Marun Date: Tue, 2 Jul 2024 10:48:34 -0400 Subject: [PATCH 26/26] persistent error --- src/esbmtk/experiments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/esbmtk/experiments.py b/src/esbmtk/experiments.py index d9ef4754..24106678 100644 --- a/src/esbmtk/experiments.py +++ b/src/esbmtk/experiments.py @@ -85,7 +85,7 @@ def add_my_burial( dbv = source.volume p = (frac_burial, dbv, min_burial_fraction, max_burial_fraction) # float into tuple - + print(f"Source name: {source.full_name}") ec = ExternalCode( name="calculate_burial", species=species,