Skip to content

Commit

Permalink
fix docstring and doc typos and mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinmacaulay committed Oct 10, 2024
1 parent 4dba3d2 commit 650a764
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Every commit to the echoSMs repository will generate a development package being

## Documentation

The echoSMs documentation is produced using [`mkdocs`](https://www.mkdocs.org/) and [`mkdocstring`](https://mkdocstrings.github.io/). The static documentation pages are hosted by github and are regenerated after every commit to the repository using a github [action](https://github.com/ices-tools-dev/echoSMs/actions/workflows/build-docs.yml).
The echoSMs documentation is produced using [`mkdocs`](https://www.mkdocs.org/) and [`mkdocstrings`](https://mkdocstrings.github.io/). The documentation pages are hosted by github and are regenerated after every commit to the repository using a github [action](https://github.com/ices-tools-dev/echoSMs/actions/workflows/build-docs.yml).

Documentation edits can be tested locally by running:

Expand Down
6 changes: 3 additions & 3 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Using echoSMs

EchoSMs is (currently) a Python package that implements acoustic scattering models. Each different model is a separate Python class in the echoSMs package. They all inherit from a common base class that defines a common calling convention for all models.
EchoSMs is (currently) a Python package that implements acoustic scattering models. Each different model is a separate Python class in the echoSMs package. They all inherit from a common base class that defines a common calling convention.

## Installation

Expand Down Expand Up @@ -97,7 +97,7 @@ It is also fine to have multiple items with multiple values:
model.calculate_ts(p)
```

The TS will be calculated for all combinations of the parameters. To do this, EchoSMs expands the parameters into a Pandas DataFrame with one column for each parameter and one row for each of the combinations. It then runs the model on each row of the DataFrame. That DataFrame, with the TS included, can be returned instead of a list of TS values by using the `expand` option:
The TS will be calculated for all combinations of the parameters. To do this, echoSMs expands the parameters into a Pandas DataFrame with one column for each parameter and one row for each of the combinations. It then runs the model on each row of the DataFrame. That DataFrame, with the TS included, can be returned instead of a list of TS values by using the `expand` option:

```py
model.calculate_ts(p, expand=True)
Expand All @@ -115,7 +115,7 @@ The benefit of using a DataFrame is that you have fine control over what model r

For a DataFrame, the number of model runs will be the number of rows in the DataFrame. For a DataArray the number of models run will be the size of the DataArray (e.g., `DataArray.size()`)

When passing a DataFrame to a model, you can choose whether the TS results are returned as a `Series` or are added to the existing DataFrame (in a column called `ts`). Use the `inplace = True` parameter in the call to `calculate_ts` for this. When passing a DataArray to a model, the TS results are always returned as the data part of the passed in DataArray.
When passing a DataFrame to a model, you can choose whether the TS results are returned as a `Series` or are added to the existing DataFrame (in a column called `ts`). Use the `inplace = True` parameter in the call to `calculate_ts` for this. When passing a DataArray to a model, the TS results are always returned in the data part of the passed in DataArray.

## More complex model parameters

Expand Down
4 changes: 2 additions & 2 deletions src/echosms/dcmmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def calculate_ts_single(self, medium_c, medium_rho, a, b, theta, f, boundary_typ
target_rho : float, optional
Density of the fluid inside the sphere [kg/m³].
Only required for `boundary_type` of ``fluid filled``.
validate_parameters :
validate_parameters : bool
Whether to validate the model parameters.
Returns
Expand All @@ -75,7 +75,7 @@ def calculate_ts_single(self, medium_c, medium_rho, a, b, theta, f, boundary_typ
Notes
-----
The class implements the code in Section B.1 of Ject et al. (2015).
The class implements the code in Section B.1 of Jech et al. (2015).
References
----------
Expand Down
2 changes: 1 addition & 1 deletion src/echosms/dwbamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def calculate_ts_single(self, theta, phi, f, target_rho, target_c, validate_para
target_c : iterable[float]
Sound speed of each material. Must have at least the same number of entries as unique
integers in `volume` [m/s].
validate_parameters :
validate_parameters : bool
Whether to validate the model parameters.
Returns
Expand Down
2 changes: 1 addition & 1 deletion src/echosms/esmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def calculate_ts_single(self, medium_c, medium_rho, a, f,
Transverse sound speed in the material inside the sphere [m/s].
target_rho : float
Density of the material inside the sphere [kg/m³].
validate_parameters :
validate_parameters : bool
Whether to validate the model parameters.
Returns
Expand Down
2 changes: 1 addition & 1 deletion src/echosms/kamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def calculate_ts_single(self, medium_c, theta, phi, f, mesh,
is [trimesh](https://trimesh.org).
boundary_type : str
The boundary type. Supported types are given in the `boundary_types` class variable.
validate_parameters :
validate_parameters : bool
Whether to validate the model parameters.
Returns
Expand Down
2 changes: 2 additions & 0 deletions src/echosms/mssmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ def calculate_ts_single(self, medium_c, medium_rho, a, f, boundary_type,
Thickness of the spherical shell [m]. This value is subtracted from ``a`` to give
the radius of the interior sphere.
Only required for `boundary_type`s that include a fluid shell.
validate_parameters : bool
Whether to validate the model parameters.
Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion src/echosms/psmsmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def calculate_ts_single(self, medium_c, medium_rho, a, b, theta, f, boundary_typ
target_rho : float
Density of the fluid inside the target [kg/m³].
Only required for `boundary_type` of ``fluid filled``.
validate_parameters :
validate_parameters : bool
Whether to validate the input parameters.
Returns
Expand Down
2 changes: 1 addition & 1 deletion src/echosms/ptdwbamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def calculate_ts_single(self, volume, theta, phi, f, voxel_size, rho, c,
c : iterable[float]
Sound speed of each material. Must have at least the same number of entries as unique
integers in `volume` [m/s].
validate_parameters :
validate_parameters : bool
Whether to validate the model parameters.
Returns
Expand Down
2 changes: 1 addition & 1 deletion src/echosms/sdwbamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def calculate_ts_single(self, theta, phi, f, target_rho, target_c, validate_para
target_c : iterable[float]
Sound speed of each material. Must have at least the same number of entries as unique
integers in `volume` [m/s].
validate_parameters :
validate_parameters : bool
Whether to validate the model parameters.
Returns
Expand Down

0 comments on commit 650a764

Please sign in to comment.