From b72ad9dc718f100c6ab34d3741164e41769ee324 Mon Sep 17 00:00:00 2001 From: Gavin Macaulay Date: Fri, 16 Aug 2024 15:27:19 +1200 Subject: [PATCH] Polishing of the documentation and formatting (#15) * update version * add pypi version number image * Get badges working * Change BenchMarkData to Benchmarkdata * Improve docstrings * Use Material for docstring style * Add a temporary project-specific logo * fix typo * Make logo background transparent * Add github stuff to docs * tweaks to mkdocs config * Polishing of documentation --- .github/workflows/build-docs.yml | 2 +- docs/api_reference.md | 5 ++--- docs/echoSMs_logo.png | Bin 0 -> 2993 bytes mkdocs.yml | 18 ++++++++++++++++-- src/echosms/__init__.py | 4 ++-- src/echosms/benchmarkdata.py | 2 +- src/echosms/dcmmodel.py | 3 ++- src/echosms/mssmodel.py | 6 +++--- src/echosms/psmsmodel.py | 3 ++- src/echosms/scattermodelbase.py | 22 +++++++++++++++------- src/echosms/utils.py | 11 ++++++++--- src/example_code.py | 4 ++-- 12 files changed, 54 insertions(+), 26 deletions(-) create mode 100644 docs/echoSMs_logo.png diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index c0795e4..99b3363 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -14,6 +14,6 @@ jobs: - uses: actions/setup-python@v5 with: python-version: 3.x - - run: pip install mkdocs mkdocs mkdocstrings[python] + - run: pip install mkdocs mkdocstrings[python] mkdocs-material - run: mkdocs gh-deploy --force --clean --verbose diff --git a/docs/api_reference.md b/docs/api_reference.md index 0530634..12aff33 100644 --- a/docs/api_reference.md +++ b/docs/api_reference.md @@ -24,9 +24,8 @@ Additional reference models may be defined in the future and can be added to the ::: echosms.ReferenceModels - -## BenchMarkData -::: echosms.BenchMarkData +## BenchmarkData +::: echosms.BenchmarkData ## Utilities diff --git a/docs/echoSMs_logo.png b/docs/echoSMs_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..edc0ecd2bdfecae5f670ee7629fb30fd76eb4020 GIT binary patch literal 2993 zcmd^>C&u1px^~NA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4|A0HI3IGN7`5KwBDy_ z{8AJAvZ@dokyBD_y)88=Di)9>cC4;WfUWLC1cm8=x0$MMnqI**6t@d2bw%DARXSrb zi#^u`G_fx|?b>`JQOKshvf^FvBc-PiUXo2`SQRYofQ#wFknE~b+)WMy?}QSY{}G}I z;IW>8^>a69$$BwzkY0T|r^MwMeK}{-e0;=J&b*+AP`q}m5#&B6>+Z?Z7P&` zSW+2>0)jxmm8@blS6k%3B}_n*SQ+sn@lv?UnY(h{KXV1WTITgVaTb$ls8Kh*HIpHM z!JvESX8Qk4SYjVk!R;K5?(U(M%S+iz7G?viiP0P(fHz%$eU)O9Z2NZcQ zzx5;TA0VPZTKiJ}>y+5{P73eHX6^1k!u@I!IMU{!5{&7y!5F0r>escii{yq*zs%Jed;Yhr0)7$1oWO(I>I10W?k9*N}o8{}_6z=e*N-cclfOz=a>pRM3EYd{6t zCuR?a+H1J+8Z@97w$}-6n0%~>p1My9wp|o^JEsk#us_6A0)rV)ek>ZDeRt-zwtf&a zK~|WxYSPxe4r7aMM(^P47SVXvZ+cQORp<3IAKTWj?LgM*ZH;q@>Dt;qRdDUDu?aDE zx{|wTpwm(O1yh>3HVypF;fJA4$2aM5ldoR-o6If}=4~*8LR>9l^TTgL(wr_WBUY=5 zpcr(T%HPo?;$ygi?1-%l(c0rqh(~eX6%R6}q(gPwzF#4RoVNGV rue|zKHTFqG$Cu4FXcmY2EIN!duQ)(O0VH1mGz float: Returns ------- - k : scalar or array_like - The acoustic wavenumber [m$^{-1}$]. + : + The acoustic wavenumber [m⁻¹]. """ return 2*np.pi*f/c @@ -96,7 +96,7 @@ def h1(n: int, z: float, derivative=False) -> complex: Parameters ---------- n : - Order (n >= 0). + Order (n ≥ 0). z : Argument of the Hankel function. derivative : @@ -107,6 +107,11 @@ def h1(n: int, z: float, derivative=False) -> complex: : Value of the spherical Hankel function + Raises + ------ + ValueError + For negative n values. + Notes ----- The value of the Hankel function is calculated from spherical Bessel functions [1]. diff --git a/src/example_code.py b/src/example_code.py index 2b74a1d..abff6fc 100644 --- a/src/example_code.py +++ b/src/example_code.py @@ -4,7 +4,7 @@ import numpy as np from echosms import MSSModel, PSMSModel, DCMModel -from echosms import BenchMarkData +from echosms import BenchmarkData from echosms import ReferenceModels from echosms import df_from_dict, da_from_dict @@ -15,7 +15,7 @@ print('\t' + n) # Load the benchmark data (from Jech et al., 2015) -bm = BenchMarkData() +bm = BenchmarkData() bmf = bm.dataset_freq() bm_theta = bm.dataset_angle()