<commit_before># -*- coding: utf-8 -*-
"""
Created on Mon Jul 11 10:00:25 2016

@author: <NAME>

Landlab component to calculate drainage density

"""
from warnings import warn
import numpy as np

from landlab import Component
from landlab import FieldError


class DrainageDensity(Component):

    """Calculate drainage density over a DEM.

    calc_drainage_density function returns drainage density for the model
    domain.

    Landlab component that implements the distance to channel algorithm of
    Tucker et al., 2001.

    This component requires EITHER a channel__mask array with 1's
    where channels exist and 0's elsewhere, OR a set of coefficients
    and exponents for a slope-area relationship and a
    channelization threshold to compare against that relationship.<commit_msg>adding more description to docstrings<commit_after># -*- coding: utf-8 -*-
"""
Created on Mon Jul 11 10:00:25 2016

@author: <NAME>

Landlab component to calculate drainage density

"""
from warnings import warn
import numpy as np

from landlab import Component
from landlab import FieldError


class DrainageDensity(Component):

    """Calculate drainage density over a DEM.

    Landlab component that implements the distance to channel algorithm of
    Tucker et al., 2001.
    
    calc_drainage_density function returns drainage density for the model
    domain.
    
    calc_drainage_density calculates the distance from every node to the 
    nearest channel node :math:`L` along the flow line of steepest descent 
    (assuming D8 routing). The drainage density is then (after Tucker et al., 
    2001):
        
    .. math::
        
        D_d=\frac{1}{2\overline{L}}
        
    where :math:`\overline{L}` is the mean L for the model domain.
            
    This component requires EITHER a channel__mask array with 1's
    where channels exist and 0's elsewhere, OR a set of coefficients
    and exponents for a slope-area relationship and a
    channelization threshold to compare against that relationship.
{'fraction_non_alphanumeric': 0.05591291439881247, 'fraction_numerical': 0.022266204849084613, 'mean_word_length': 3.3766233766233764, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7656318', 'n_tokens_mistral': 565, 'n_tokens_neox': 497, 'n_words': 248}