From 1e0537f51fd0cb4a0ce2fb1d86ddeae9b43ae331 Mon Sep 17 00:00:00 2001 From: Gavin Macaulay Date: Thu, 10 Oct 2024 19:22:36 +1300 Subject: [PATCH] add doc for validate_parameters in each model --- src/echosms/dcmmodel.py | 6 +++++- src/echosms/dwbamodel.py | 6 +++++- src/echosms/esmodel.py | 6 +++++- src/echosms/kamodel.py | 6 +++++- src/echosms/mssmodel.py | 6 +++++- src/echosms/psmsmodel.py | 6 +++++- src/echosms/ptdwbamodel.py | 6 +++++- src/echosms/sdwbamodel.py | 6 +++++- 8 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/echosms/dcmmodel.py b/src/echosms/dcmmodel.py index 7503efe..5a5e9ad 100644 --- a/src/echosms/dcmmodel.py +++ b/src/echosms/dcmmodel.py @@ -26,7 +26,11 @@ def __init__(self): self.max_ka = 20 # [1] def validate_parameters(self, params): - """Validate the model parameters.""" + """Validate the model parameters. + + See [here][echosms.ScatterModelBase.validate_parameters] for calling details. + """ + p = as_dict(params) super()._present_and_in(p, ['boundary_type'], self.boundary_types) super()._present_and_positive(p, ['medium_rho', 'medium_c', 'a', 'b', 'f']) diff --git a/src/echosms/dwbamodel.py b/src/echosms/dwbamodel.py index 3803b42..9ebfeb5 100644 --- a/src/echosms/dwbamodel.py +++ b/src/echosms/dwbamodel.py @@ -22,7 +22,11 @@ def __init__(self): self.max_ka = 20 def validate_parameters(self, params): - """Validate the model parameters.""" + """Validate the model parameters. + + See [here][echosms.ScatterModelBase.validate_parameters] for calling details. + """ + p = as_dict(params) def calculate_ts_single(self, theta, phi, f, target_rho, target_c, validate_parameters=True): diff --git a/src/echosms/esmodel.py b/src/echosms/esmodel.py index 4104cfb..e33cbb6 100644 --- a/src/echosms/esmodel.py +++ b/src/echosms/esmodel.py @@ -24,7 +24,11 @@ def __init__(self): self.max_ka = 20 # [1] def validate_parameters(self, params): - """Validate the model parameters.""" + """Validate the model parameters. + + See [here][echosms.ScatterModelBase.validate_parameters] for calling details. + """ + p = as_dict(params) super()._present_and_in(p, ['boundary_type'], self.boundary_types) super()._present_and_positive(p, ['medium_rho', 'medium_c', 'a', 'f', diff --git a/src/echosms/kamodel.py b/src/echosms/kamodel.py index 9fbe7c4..fd66cb7 100644 --- a/src/echosms/kamodel.py +++ b/src/echosms/kamodel.py @@ -24,7 +24,11 @@ def __init__(self): self.no_expand_parameters = ['mesh'] def validate_parameters(self, params): - """Validate the model parameters.""" + """Validate the model parameters. + + See [here][echosms.ScatterModelBase.validate_parameters] for calling details. + """ + p = as_dict(params) super()._present_and_in(p, ['boundary_type'], self.boundary_types) super()._present_and_positive(p, ['medium_c', 'f']) diff --git a/src/echosms/mssmodel.py b/src/echosms/mssmodel.py index 673dbf4..71dab34 100644 --- a/src/echosms/mssmodel.py +++ b/src/echosms/mssmodel.py @@ -28,7 +28,11 @@ def __init__(self): self.max_ka = 20 # [1] def validate_parameters(self, params): - """Validate the model parameters.""" + """Validate the model parameters. + + See [here][echosms.ScatterModelBase.validate_parameters] for calling details. + + """ p = as_dict(params) super()._present_and_in(p, ['boundary_type'], self.boundary_types) super()._present_and_positive(p, ['medium_rho', 'a', 'f']) diff --git a/src/echosms/psmsmodel.py b/src/echosms/psmsmodel.py index 88cc53f..1f18538 100644 --- a/src/echosms/psmsmodel.py +++ b/src/echosms/psmsmodel.py @@ -26,7 +26,11 @@ def __init__(self): self.max_ka = 10 # [1] def validate_parameters(self, params): - """Validate the model parameters.""" + """Validate the model parameters. + + See [here][echosms.ScatterModelBase.validate_parameters] for calling details. + """ + p = as_dict(params) super()._present_and_in(p, ['boundary_type'], self.boundary_types) super()._present_and_positive(p, ['medium_c', 'medium_rho', 'a', 'b', 'f']) diff --git a/src/echosms/ptdwbamodel.py b/src/echosms/ptdwbamodel.py index 3878f57..dd43e17 100644 --- a/src/echosms/ptdwbamodel.py +++ b/src/echosms/ptdwbamodel.py @@ -21,7 +21,11 @@ def __init__(self): self.no_expand_parameters = ['volume', 'voxel_size', 'rho', 'c'] def validate_parameters(self, params): - """Validate the model parameters.""" + """Validate the model parameters. + + See [here][echosms.ScatterModelBase.validate_parameters] for calling details. + """ + p = as_dict(params) def calculate_ts_single(self, volume, theta, phi, f, voxel_size, rho, c, diff --git a/src/echosms/sdwbamodel.py b/src/echosms/sdwbamodel.py index d05affd..3d12a05 100644 --- a/src/echosms/sdwbamodel.py +++ b/src/echosms/sdwbamodel.py @@ -22,7 +22,11 @@ def __init__(self): self.max_ka = 20 def validate_parameters(self, params): - """Validate the model parameters.""" + """Validate the model parameters. + + See [here][echosms.ScatterModelBase.validate_parameters] for calling details. + """ + p = as_dict(params) def calculate_ts_single(self, theta, phi, f, target_rho, target_c, validate_parameters=True):