Skip to content

Commit

Permalink
Merge pull request #169 from mcflugen/mcflugen/fix-warnings-errors-in…
Browse files Browse the repository at this point in the history
…-docs-build

Fix warnings and errors in docs build
  • Loading branch information
mcflugen authored Dec 8, 2024
2 parents 05f3204 + 0a521ee commit 8d58bd5
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Install dependencies
run: |
pip install -r requirements-docs.txt
sudo apt update -y && sudo apt install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended dvipng
sudo apt update -y && sudo apt install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended dvipng ffmpeg
- name: Install DeltaMetrics
run: |
pip install .
Expand Down
33 changes: 17 additions & 16 deletions deltametrics/mobility.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""Functions for channel mobility metrics.
Current available mobility metrics include:
- Dry fraction decay from [Cazanacli et al 2002]_
- Planform overlap from [Wickert et al 2013]_
- Reworking index from [Wickert et al 2013]_
- Channel abandonment from [Liang et al 2016]_
- Channelized response variance from [Jarriel et al 2019]_
- Dry fraction decay from [Cazanacli et al 2002]_
- Planform overlap from [Wickert et al 2013]_
- Reworking index from [Wickert et al 2013]_
- Channel abandonment from [Liang et al 2016]_
- Channelized response variance from [Jarriel et al 2019]_
Also included are functions to fit curves to the output from the mobility
functions, allowing for decay constants and timescales to be quantified.
Expand Down Expand Up @@ -330,7 +330,7 @@ def calculate_planform_overlap(chmap, landmap,
where :math:`K_B` and :math:`K_T` are the channel mask values at the base
and target maps, respectively.
:math:`\Phi` is calculated as:
:math:`\\Phi` is calculated as:
.. math::
Expand Down Expand Up @@ -736,18 +736,19 @@ def calculate_channelized_response_variance(
arr, threshold=0.2, normalize_input=False,
normalize_output=False):
"""
Calculate the Channelized Response Variance (CRV) [1]_.
Calculate the Channelized Response Variance (CRV).
This function takes a t-x-y array and calculates its directional CRV.
This function takes a t-x-y array and calculates its directional CRV [1]_.
In short, the function does the following:
1. Normalizes the array at each time slice if desired.
2. Calculates the CRV magnitude (aka variance along time-axis) and
normalizes this array if desired.
3. Does linear regressions through time for each pixel and returns
the slopes.
4. Calculates the directional CRV using a slope threshold value.
5. Returns the CRV magnitude, slopes, and directional CRV
values
1. Normalizes the array at each time slice if desired.
2. Calculates the CRV magnitude (aka variance along time-axis) and
normalizes this array if desired.
3. Does linear regressions through time for each pixel and returns
the slopes.
4. Calculates the directional CRV using a slope threshold value.
5. Returns the CRV magnitude, slopes, and directional CRV
values
.. [1] Jarriel, Teresa, Leo F. Isikdogan, Alan Bovik, and Paola
Passalacqua. "Characterization of deltaic channel morphodynamics
Expand Down
7 changes: 4 additions & 3 deletions deltametrics/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ def curve_fit(data, fit='harmonic'):
fit : :obj:`str`, optional
A string specifying the type of function to be fit. Options are as
follows:
* `exponential`, which evaluates :code:`(a - b) * np.exp(-c * x) + b`
* `harmonic`, (default) which evaluates :code:`a / (1 + b * x)`
* `linear`, which evaluates :code:`a * x + b`
* `exponential`, which evaluates :code:`(a - b) * np.exp(-c * x) + b`
* `harmonic`, (default) which evaluates :code:`a / (1 + b * x)`
* `linear`, which evaluates :code:`a * x + b`
Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXOPTS ?= -W
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Using the sedimentograph to evaluate time distribution in subsurface
:include-source:
:context: close-figs

time_bins = np.linspace(0, golfcube.t[-1], num=7)
time_bins = np.linspace(0, float(golfcube.t[-1]), num=7)
(time_sedimentograph,
time_radii,
_) = dm.strat.compute_sedimentograph(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Now plot
golf.meta['N0'].data *
golf.meta['dx'].data *
(golf.meta['C0_percent'][0].data / 100)) # sediment input, m3/s
t = np.linspace(0, golf.t[time_idxs[-1]], num=100)
t = np.linspace(0, float(golf.t[time_idxs[-1]]), num=100)

# make the figure
fig, ax = plt.subplots()
Expand Down
2 changes: 1 addition & 1 deletion docs/source/pyplots/guides/userguide_section_type_demos.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
axs = [fig.add_subplot(spec[i, j]) for i, j in zip(
np.repeat(np.arange(1, 4), 2), np.tile(np.arange(2), (4,)))]

t10cmap = plt.cm.get_cmap('tab10')
t10cmap = plt.get_cmap('tab10')
golfcube.quick_show('eta', idx=-1, ax=ax0, ticks=True)
for i, s in enumerate([_strike, _dip, _path, _circ, _rad]):
s.show_trace('--', color=t10cmap(i), ax=ax0)
Expand Down

0 comments on commit 8d58bd5

Please sign in to comment.