From d4c0fff9af12227167c4adca3bbccead3f985856 Mon Sep 17 00:00:00 2001 From: Mieszko Makuch Date: Tue, 11 Mar 2025 10:32:28 +0100 Subject: [PATCH 1/3] ISEPOS-2325 Raise error if there is no b_method set: raise ValueError("Please chose an option for b-value") --- src/Mmax.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Mmax.py b/src/Mmax.py index 4a41ab1..3b747b6 100644 --- a/src/Mmax.py +++ b/src/Mmax.py @@ -206,7 +206,8 @@ def main(Input_catalog, Input_injection_rate, time_win_in_hours, time_step_in_ho Feat_dic['Param'][0]['C'] = C if f_indx in [0,1,2,4]: - Feat_dic['Param'][0]['b_method'] = b_method + if not b_method: + raise ValueError("Please chose an option for b-value") if f_indx in [0,4]: for cl_i in cl: From ac7933bd2c37cf7e71dc1bf55112e8ed33e92648 Mon Sep 17 00:00:00 2001 From: Mieszko Makuch Date: Tue, 11 Mar 2025 11:01:17 +0100 Subject: [PATCH 2/3] ISEPOS-2325 Added a default value like "b" to maxmagnitude_wrapper.py to fix 'NoneType' object is not iterable --- src/maxmagnitude_wrapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/maxmagnitude_wrapper.py b/src/maxmagnitude_wrapper.py index de02925..591b4f6 100644 --- a/src/maxmagnitude_wrapper.py +++ b/src/maxmagnitude_wrapper.py @@ -37,7 +37,7 @@ def main(argv): parser.add_argument("--G", help="Shear modulus of reservoir (in Pa).", type=float, default=35000000000) parser.add_argument("--ssd", help="Static stress drop (in Pa).", type=float, default=3000000) parser.add_argument("--C", help="Geometrical constant.", type=float, default=0.95) - parser.add_argument("--b_value_type", help="b-value type: parameter of type 'TEXT'", action='append') + parser.add_argument("--b_value_type", help="b-value type: parameter of type 'TEXT'", action='append', default="b") parser.add_argument("--cl", help="Confidence level in van der Elst model.", type=float, action='append') parser.add_argument("--mag_name", help="Magnitude column name", type=str) From 14182b79e651a18d453f8fdc26495654352cbefe Mon Sep 17 00:00:00 2001 From: Mieszko Makuch Date: Mon, 24 Mar 2025 12:45:00 +0100 Subject: [PATCH 3/3] ISEPOS-2325 Remove default value like "b" to maxmagnitude_wrapper.py. Default value is will not be added from maxmagnitude_wrapper.py script but rather required form MaxMagnitude app form This reverts commit ac7933bd2c37cf7e71dc1bf55112e8ed33e92648. --- src/maxmagnitude_wrapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/maxmagnitude_wrapper.py b/src/maxmagnitude_wrapper.py index 591b4f6..de02925 100644 --- a/src/maxmagnitude_wrapper.py +++ b/src/maxmagnitude_wrapper.py @@ -37,7 +37,7 @@ def main(argv): parser.add_argument("--G", help="Shear modulus of reservoir (in Pa).", type=float, default=35000000000) parser.add_argument("--ssd", help="Static stress drop (in Pa).", type=float, default=3000000) parser.add_argument("--C", help="Geometrical constant.", type=float, default=0.95) - parser.add_argument("--b_value_type", help="b-value type: parameter of type 'TEXT'", action='append', default="b") + parser.add_argument("--b_value_type", help="b-value type: parameter of type 'TEXT'", action='append') parser.add_argument("--cl", help="Confidence level in van der Elst model.", type=float, action='append') parser.add_argument("--mag_name", help="Magnitude column name", type=str)