Skip to content

Commit

Permalink
add doc for validate_parameters in each model
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinmacaulay committed Oct 10, 2024
1 parent 650a764 commit 1e0537f
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 8 deletions.
6 changes: 5 additions & 1 deletion src/echosms/dcmmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
6 changes: 5 additions & 1 deletion src/echosms/dwbamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 5 additions & 1 deletion src/echosms/esmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 5 additions & 1 deletion src/echosms/kamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
6 changes: 5 additions & 1 deletion src/echosms/mssmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
6 changes: 5 additions & 1 deletion src/echosms/psmsmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
6 changes: 5 additions & 1 deletion src/echosms/ptdwbamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion src/echosms/sdwbamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 1e0537f

Please sign in to comment.